<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/networkReportSta" name="stanpform">
                                        <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="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-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>
                            <button type="button" class="btn btn-primary" id="all_checked1">全选</button>
                            <button type="button" class="btn btn-primary" id="all_no_checked1">全不选</button>
                        </div>
                    </section>
                </aside>
            </div>
        </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" src="<?php echo base_url();?>public/js/highcharts/modules/export-data.js"></script>
<script type="text/javascript">

//设置图表导出格式选项
Highcharts.setOptions({
    lang: {
        printChart: '打印图表',
        downloadJPEG: '下载 JPEG 文件',
        downloadPDF: '下载 PDF   文件',
        downloadPNG: '下载 PNG  文件',
        downloadSVG: '下载 SVG  文件',
        downloadCSV: '下载 CSV  文件',
        downloadXLS: '下载 XLS   文件',
        viewData: '查看数据表格'
    },
    navigation: {
        menuItemStyle: {
            padding: '6px 14px'
        }
    },
    exporting: {
        url: ''
    },
    credits: {
        text: '',
        url: ''
    }
});

    var chart1 = Highcharts.chart('container', {
        chart: {
            type: 'line'
        },
        title: {
            text: '网络断线重连统计'
        },
        subtitle: {
            text: ''
        },
        xAxis: {
            categories: [<?php echo "'".implode("','", $date)."'";?>]
        },
        yAxis: {
            title: {
                text: '数值'
            }
        },
        plotOptions: {
            line: {
                dataLabels: {
                    enabled: true
                },
                enableMouseTracking: false
            }
        },
        series: [{
            name: '自动重连 老虎机(安卓)',
            visible: false,
            data: [<?php 
            	foreach($date as $day){
            		if(empty($data[$day]['sid'][1]['1-slot'])){
            			echo "0,";
            		}else{
            			echo $data[$day]['sid'][1]['1-slot'].",";
            		}
            	}
            ?>]
        },{
            name: '自动重连 老虎机(苹果)',
            visible: false,
            data: [<?php 
            	foreach($date as $day){
            		if(empty($data[$day]['sid'][2]['1-slot'])){
            			echo "0,";
            		}else{
            			echo $data[$day]['sid'][2]['1-slot'].",";
            		}
            	}
            ?>]
        },{
            name: '自动重连 老虎机(总)',
            data: [<?php 
            	foreach($date as $day){
            		echo intval($data[$day]['sid'][1]['1-slot'] + $data[$day]['sid'][2]['1-slot'] + $data[$day]['sid'][0]['1-slot']).",";
            	}
            ?>]
        },{
            name: '手动重连 老虎机(安卓)',
            visible: false,
            data: [<?php 
            	foreach($date as $day){
            		if(empty($data[$day]['sid'][1]['2-slot'])){
            			echo "0,";
            		}else{
            			echo $data[$day]['sid'][1]['2-slot'].",";
            		}
            	}
            ?>]
        },{
            name: '手动重连 老虎机(苹果)',
            visible: false,
            data: [<?php 
            	foreach($date as $day){
            		if(empty($data[$day]['sid'][2]['2-slot'])){
            			echo "0,";
            		}else{
            			echo $data[$day]['sid'][2]['2-slot'].",";
            		}
            	}
            ?>]
        },{
            name: '手动重连 老虎机(总)',
            data: [<?php 
            	foreach($date as $day){
            		echo intval($data[$day]['sid'][1]['2-slot'] + $data[$day]['sid'][2]['2-slot'] + $data[$day]['sid'][0]['2-slot']).",";
            	}
            ?>]
        },{
            name: '老虎机重新绑定(安卓)',
            visible: false,
            data: [<?php 
            	foreach($date as $day){
            		if(empty($data[$day]['sid'][1]['1-slot_bind'])){
            			echo "0,";
            		}else{
            			echo $data[$day]['sid'][1]['1-slot_bind'].",";
            		}
            	}
            ?>]
        },{
            name: '老虎机重新绑定(苹果)',
            visible: false,
            data: [<?php 
            	foreach($date as $day){
            		if(empty($data[$day]['sid'][2]['1-slot_bind'])){
            			echo "0,";
            		}else{
            			echo $data[$day]['sid'][2]['1-slot_bind'].",";
            		}
            	}
            ?>]
        },{
            name: '老虎机重新绑定(总)',
            data: [<?php 
            	foreach($date as $day){
            		echo intval($data[$day]['sid'][1]['1-slot_bind'] + $data[$day]['sid'][2]['1-slot_bind'] + $data[$day]['sid'][0]['1-slot_bind']).",";
            	}
            ?>]
        },{
            name: '手动重连 登录(安卓)',
            visible: false,
            data: [<?php 
            	foreach($date as $day){
            		if(empty($data[$day]['sid'][1]['2-login'])){
            			echo "0,";
            		}else{
            			echo $data[$day]['sid'][1]['2-login'].",";
            		}
            	}
            ?>]
        },{
            name: '手动重连 登录(苹果)',
            visible: false,
            data: [<?php 
            	foreach($date as $day){
            		if(empty($data[$day]['sid'][2]['2-login'])){
            			echo "0,";
            		}else{
            			echo $data[$day]['sid'][2]['2-login'].",";
            		}
            	}
            ?>]
        },{
            name: '手动重连 登录(总)',
            data: [<?php 
            	foreach($date as $day){
            		echo intval($data[$day]['sid'][1]['2-login'] + $data[$day]['sid'][2]['2-login'] + $data[$day]['sid'][0]['2-login']).",";
            	}
            ?>]
        },{
            name: '手动重连 登录加载资源(安卓)',
            visible: false,
            data: [<?php 
            	foreach($date as $day){
            		if(empty($data[$day]['sid'][1]['2-login_assets'])){
            			echo "0,";
            		}else{
            			echo $data[$day]['sid'][1]['2-login_assets'].",";
            		}
            	}
            ?>]
        },{
            name: '手动重连 登录加载资源(苹果)',
            visible: false,
            data: [<?php 
            	foreach($date as $day){
            		if(empty($data[$day]['sid'][2]['2-login_assets'])){
            			echo "0,";
            		}else{
            			echo $data[$day]['sid'][2]['2-login_assets'].",";
            		}
            	}
            ?>]
        },{
            name: '手动重连 登录加载资源(总)',
            data: [<?php 
            	foreach($date as $day){
            		echo intval($data[$day]['sid'][1]['2-login_assets'] + $data[$day]['sid'][2]['2-login_assets'] + $data[$day]['sid'][0]['2-login_assets']).",";
            	}
            ?>]
        }]
    });

	$(document).on("click","#all_checked1",function(){
    	$(".highcharts-legend-item").each(function(index){
    		chart1.series[index].show();//显示
    	})
    })
    $(document).on("click","#all_no_checked1",function(){
    	$(".highcharts-legend-item").each(function(index){
    		chart1.series[index].hide();//隐藏
    	})
    })
    
	//选择日期
    $('.datetimepicker').datepicker({
        language:'zh-CN',
        format:'yyyy-mm-dd',
        zIndexOffset:906  //控制z-index
    });
</script>