<link rel="stylesheet" href="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css">
<script src="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
<script src="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>


<div class="content_wrapper">

    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>查询</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <form class="form-inline" role="form" method="POST" action="#statistics/trafficPermitSta/<?php echo $type;?>" name="stanpform">
                                        <input type="hidden" name="fromsta_traffic" value="1">
                                        <div class="form-group">
                                            <label>开始时间</label>
                                            <input type="text" class="form-control datetimepicker" value="<?php if($stime) echo $stime;?>" placeholder="开始时间" name="stime" />
                                        </div>
                                        <span class="gap"></span>
                                        <div class="form-group">
                                            <label>结束时间</label>
                                            <input type="text" class="form-control datetimepicker" value="<?php if($etime) echo $etime;?>" placeholder="结束时间" name="etime" />
                                        </div>
                                        <button type="submit" class="btn btn-primary">查询</button>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>进度领取次数</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
            <div class="col-sm-6">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>限时奖励次数</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div id="container2" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>进度领取金额总数</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div id="container3" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="table-responsive">
                                    <table id="reportTable" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                        <thead>
                                        <tr>
                                            <th style="text-align: center;vertical-align: middle;">日期</th>
                                            <th style="text-align: center;vertical-align: middle;">进度</th>
                                            <?php if(is_array($props)){ foreach($props as $k => $val){ ?>
                                                <th style="text-align: center;vertical-align: middle;"><?php echo $val['msg'];?></th>
                                            <?php } } ?>
                                        </tr>
                                        </thead>
                                        <tbody id="reportBody">
                                        <?php if(is_array($dayList)){ foreach(array_reverse($dayList) as $k => $day){ ?>
                                            <tr>
                                                <td style="white-space: nowrap" rowspan="3"><?php echo $day;?></td>
                                                <td style="white-space: nowrap" rowspan="1">进度1</td>
                                                <?php foreach($list[str_replace("-","",$day)]['props'][1] as $num){ ?>
                                                    <td style="white-space: nowrap" rowspan="1"><?php echo $num;?></td>
                                                <?php } ?>
                                            </tr>
                                            <tr>
                                                <td style="white-space: nowrap" rowspan="1">进度2</td>
                                                <?php foreach($list[str_replace("-","",$day)]['props'][2] as $num){ ?>
                                                    <td style="white-space: nowrap" rowspan="1"><?php echo $num;?></td>
                                                <?php } ?>
                                            </tr>
                                            <tr>
                                                <td style="white-space: nowrap" rowspan="1">进度3</td>
                                                <?php foreach($list[str_replace("-","",$day)]['props'][3] as $num){ ?>
                                                    <td style="white-space: nowrap" rowspan="1"><?php echo $num;?></td>
                                                <?php } ?>
                                            </tr>
                                        <?php } } ?>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="<?php echo base_url();?>public/js/highcharts/highcharts.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>public/js/highcharts/modules/exporting.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>public/js/highcharts/modules/export-data.js"></script>
<script type="text/javascript">
    Highcharts.chart('container', {
        chart: {
            type: 'line'
        },
        title: {
            text: ''
        },
        subtitle: {
            text: ''
        },
        xAxis: {
            categories: [<?php echo "'".implode("','", $dayList)."'";?>]
        },
        yAxis: [{
            labels: {
                format: '{value}',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            title: {
                text: '数值',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            }
        }, { // Secondary yAxis
            title: {
                text: '百分比',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            labels: {
                format: '{value} %',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            opposite: true
        }],
        plotOptions: {
            line: {
                dataLabels: {
                    enabled: true
                },
                enableMouseTracking: false
            }
        },
        series: [{
            name: '进度1',
            data: [<?php echo implode(",", $times1);?>]
        },{
            name: '进度2',
            data: [<?php echo implode(",", $times2);?>]
        },{
            name: '进度3',
            data: [<?php echo implode(",", $times3);?>]
        }]
    });
    Highcharts.chart('container2', {
        chart: {
            type: 'line'
        },
        title: {
            text: ''
        },
        subtitle: {
            text: ''
        },
        xAxis: {
            categories: [<?php echo "'".implode("','", $dayList)."'";?>]
        },
        yAxis: [{
            labels: {
                format: '{value}',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            title: {
                text: '数值',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            }
        }, { // Secondary yAxis
            title: {
                text: '百分比',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            labels: {
                format: '{value} %',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            opposite: true
        }],
        plotOptions: {
            line: {
                dataLabels: {
                    enabled: true
                },
                enableMouseTracking: false
            }
        },
        series: [{
            name: '进度1',
            data: [<?php echo implode(",", $limit1);?>]
        },{
            name: '进度2',
            data: [<?php echo implode(",", $limit2);?>]
        },{
            name: '进度3',
            data: [<?php echo implode(",", $limit3);?>]
        }]
    });
    Highcharts.chart('container3', {
        chart: {
            type: 'line'
        },
        title: {
            text: ''
        },
        subtitle: {
            text: ''
        },
        xAxis: {
            categories: [<?php echo "'".implode("','", $dayList)."'";?>]
        },
        yAxis: [{
            labels: {
                format: '{value}',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            title: {
                text: '数值',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            }
        }, { // Secondary yAxis
            title: {
                text: '百分比',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            labels: {
                format: '{value} %',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            opposite: true
        }],
        plotOptions: {
            line: {
                dataLabels: {
                    enabled: true
                },
                enableMouseTracking: false
            }
        },
        series: [{
            name: '进度1',
            data: [<?php echo implode(",", $coins1);?>]
        },{
            name: '进度2',
            data: [<?php echo implode(",", $coins2);?>]
        },{
            name: '进度3',
            data: [<?php echo implode(",", $coins3);?>]
        }]
    });
    //选择日期
    $('.datetimepicker').datepicker({
        language:'zh-CN',
        format:'yyyy-mm-dd',
        zIndexOffset:906  //控制z-index
    });
</script>