<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/useronlinetime" name="useronlinePost">
                                        <input type="hidden" name="useronline-post" value="1">
                                        <span class="gap"></span>
                                        <div class="form-group">
                                                <label>开始时间</label>
                                                <input type="text" class="form-control datetimepicker" value="<?php if($stime) echo $stime;?>" placeholder="开始时间" name="useronline_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="useronline_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-12">
                <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>
    </div>

</div>
<!--<script type="text/javascript" src="--><?php //echo base_url().'public/js/chart/chart.js';?><!--"></script>-->
<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">
    $(function () {


        //选择日期
        $('.datetimepicker').datepicker({
            language:'zh-CN',
            format:'yyyy-mm-dd',
            zIndexOffset:906  //控制z-index
        });

        Highcharts.chart('container', {
            chart: {
                type: 'line'
            },
            title: {
                text: '活跃用户在线时间'
            },
            subtitle: {
                text: ''
            },
            xAxis: {
                categories: [<?php echo "'".implode("','", $dayList)."'";?>]
            },
            yAxis: {
                title: {
                    text: '数值'
                }
            },
            plotOptions: {
                line: {
                    dataLabels: {
                        enabled: true
                    },
                    enableMouseTracking: false
                }
            },
            series: [<?php echo $str;?>]
        });


//        $('#container').highcharts({
//            chart: {
//                type: 'column'
//            },
//            title: {
//                text: '活跃用户在线时间'
//            },
////            subtitle: {
////                text: '数据来源: WorldClimate.com'
////            },
//            xAxis: {
//                categories: [
//                <?php //echo implode(',', array_map(function($v){
//                    return "'".$v."'";
//                }, $dayList));?>
//
//                ],
//                crosshair: true
//            },
//            yAxis: {
//                min: 0,
//                title: {
//                    text: '人数'
//                }
//            },
//            tooltip: {
//                headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
//                pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
//                '<td style="padding:0"><b>{point.y} 人</b></td></tr>',
//                footerFormat: '</table>',
//                shared: true,
//                useHTML: true
//            },
//            plotOptions: {
//                column: {
//                    borderWidth: 0
//                }
//            },
//            series: [<?php //echo $str;?>//]
//        });
    });


</script>