
<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">
                                    <a href="#statistics/onlineplaying2" class="btn btn-primary">查询</a>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
        <div class="row"  style="display: none">
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>Spin在线在玩查询（北京时区）</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 class="row">
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>Fox在线在玩查询（北京时区）</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div id="containerFox" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
        <div class="row" style="display: none">
            <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="container2" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </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">
Highcharts.chart('container', {
    title: {
        text: 'Spin 在线在玩查询（北京时区）'
    },
    subtitle: {
        text: ''
    },
    xAxis: {
        categories: [<?php
                foreach($dayList as $date){
                    echo "'".date("H:i",strtotime(date("Ymd")." ".$date)+3600*8)."',";
                }
            ?>]
    },
    yAxis: {
        title: {
            text: '人数'
        },
        title: {
            title: { text: 'Histogram' },
            opposite: true
        },
    },
    series: [{
        color: '#00ff00',
        name: '在线玩家',
        data: [<?php
            foreach ($list['totalOnline'] as $key=>$row){
                $temp = substr($key,0,4);
                $eNum = substr($key,4,1);
                if($eNum < 5){
                    $temp .= "0";
                }else if($eNum <= 9){
                    $temp .= "5";
                }
                $list['totalOnline'][$temp] = $row;
            }
            ksort($list['totalOnline']);
        	end($list['totalOnline']);
        	$endTemp = key($list['totalOnline']);
        	foreach($dayList as $k => $time){
        		if(strtotime(date("Y-m-d")." ".$endTemp) >= strtotime(date("Y-m-d")." ".$time)){
        			$temp = substr($time,0,5);
        			echo (isset($list['totalOnline'][$temp])?$list['totalOnline'][$temp]:0).",";
        		}

        	}
        ?>]
    },{
        color: '#3333ff',
        name: '昨日在线玩家',
        data: [<?php
            foreach ($list['totalYOnline'] as $key=>$row){
                $temp = substr($key,0,4);
                $eNum = substr($key,4,1);
                if($eNum < 5){
                    $temp .= "0";
                }else if($eNum <= 9){
                    $temp .= "5";
                }
                $list['totalYOnline'][$temp] = $row;
            }
            ksort($list['totalYOnline']);
        	end($list['totalYOnline']);
        	$endTemp = key($list['totalYOnline']);
        	foreach($dayList as $k => $time){
        		if(strtotime(date("Y-m-d")." ".$endTemp) >= strtotime(date("Y-m-d")." ".$time)){
        			$temp = substr($time,0,5);
        			echo (isset($list['totalYOnline'][$temp])?$list['totalYOnline'][$temp]:0).",";
        		}

        	}
        ?>]
    },{
        color: '#000000',
        name: '上周同一天在玩玩家',
        data: [<?php
            foreach ($list['totalLWOnline'] as $key=>$row){
                $temp = substr($key,0,4);
                $eNum = substr($key,4,1);
                if($eNum < 5){
                    $temp .= "0";
                }else if($eNum <= 9){
                    $temp .= "5";
                }
                $list['totalLWOnline'][$temp] = $row;
            }
            ksort($list['totalLWOnline']);
        	end($list['totalLWOnline']);
        	$endTemp = key($list['totalLWOnline']);
        	foreach($dayList as $k => $time){
        		if(strtotime(date("Y-m-d")." ".$endTemp) >= strtotime(date("Y-m-d")." ".$time)){
        			$temp = substr($time,0,5);
        			echo (isset($list['totalLWOnline'][$temp])?$list['totalLWOnline'][$temp]:0).",";
        		}
        	}
        ?>]
    }],
    responsive: {
        rules: [{
            condition: {
                maxWidth: 500
            },
            chartOptions: {
                legend: {
                    layout: 'horizontal',
                    align: 'center',
                    verticalAlign: 'bottom'
                }
            }
        }]
    }
});
Highcharts.chart('containerFox', {
    title: {
        text: 'Fox在线在玩查询（北京时区）'
    },
    subtitle: {
        text: ''
    },
    xAxis: {
        categories: [<?php
                foreach($dayList as $date){
                    echo "'".date("H:i",strtotime(date("Ymd")." ".$date)+3600*8)."',";
                }
            ?>]
    },
    yAxis: {
        title: {
            text: '人数'
        },
        title: {
            title: { text: 'Histogram' },
            opposite: true
        },
    },
    series: [
        {
            color: '#00ff00',
            name: 'Fox实时在线玩家',
            data: [<?php echo implode(',', $foxOnlineData['realtime'])?>]
        },{
            color: '#3333ff',
            name: 'Fox昨日在线玩家',
            data: [<?php echo implode(',', $foxOnlineData['yesterDay'])?>]
        },{
            color: '#000000',
            name: 'Fox上周同一天在线玩家',
            data: [<?php echo implode(',', $foxOnlineData['lastWeek'])?>]
        }
    ],
    responsive: {
        rules: [{
            condition: {
                maxWidth: 500
            },
            chartOptions: {
                legend: {
                    layout: 'horizontal',
                    align: 'center',
                    verticalAlign: 'bottom'
                }
            }
        }]
    }
});
Highcharts.chart('container2', {
    title: {
        text: '在线在玩查询（服务器时区）'
    },
    subtitle: {
        text: ''
    },
    xAxis: {
        categories: [<?php
                foreach($dayList as $date){
                    echo "'".date("H:i",strtotime(date("Ymd")." ".$date))."',";
                }
            ?>]
    },
    yAxis: {
        title: {
            text: '人数'
        },
        title: {
            title: { text: 'Histogram' },
            opposite: true
        },
    },
    series: [{
        color: '#00ff00',
        name: '在线玩家',
        data: [<?php
            foreach ($list['totalOnline'] as $key=>$row){
                $temp = substr($key,0,4);
                $eNum = substr($key,4,1);
                if($eNum < 5){
                    $temp .= "0";
                }else if($eNum <= 9){
                    $temp .= "5";
                }
                $list['totalOnline'][$temp] = $row;
            }
            ksort($list['totalOnline']);
        	end($list['totalOnline']);
        	$endTemp = key($list['totalOnline']);
        	foreach($dayList as $k => $time){
        		if(strtotime(date("Y-m-d")." ".$endTemp) >= strtotime(date("Y-m-d")." ".$time)){
        			$temp = substr($time,0,5);
        			echo (isset($list['totalOnline'][$temp])?$list['totalOnline'][$temp]:0).",";
        		}

        	}
        ?>]
    },{
        color: '#3333ff',
        name: '昨日在线玩家',
        data: [<?php
            foreach ($list['totalYOnline'] as $key=>$row){
                $temp = substr($key,0,4);
                $eNum = substr($key,4,1);
                if($eNum < 5){
                    $temp .= "0";
                }else if($eNum <= 9){
                    $temp .= "5";
                }
                $list['totalYOnline'][$temp] = $row;
            }
            ksort($list['totalYOnline']);
        	end($list['totalYOnline']);
        	$endTemp = key($list['totalYOnline']);
        	foreach($dayList as $k => $time){
        		if(strtotime(date("Y-m-d")." ".$endTemp) >= strtotime(date("Y-m-d")." ".$time)){
        			$temp = substr($time,0,5);
        			echo (isset($list['totalYOnline'][$temp])?$list['totalYOnline'][$temp]:0).",";
        		}

        	}
        ?>]
    },{
        color: '#000000',
        name: '上周同一天在玩玩家',
        data: [<?php
            foreach ($list['totalLWOnline'] as $key=>$row){
                $temp = substr($key,0,4);
                $eNum = substr($key,4,1);
                if($eNum < 5){
                    $temp .= "0";
                }else if($eNum <= 9){
                    $temp .= "5";
                }
                $list['totalLWOnline'][$temp] = $row;
            }
            ksort($list['totalLWOnline']);
        	end($list['totalLWOnline']);
        	$endTemp = key($list['totalLWOnline']);
        	foreach($dayList as $k => $time){
        		if(strtotime(date("Y-m-d")." ".$endTemp) >= strtotime(date("Y-m-d")." ".$time)){
        			$temp = substr($time,0,5);
        			echo (isset($list['totalLWOnline'][$temp])?$list['totalLWOnline'][$temp]:0).",";
        		}
        	}
        ?>]
    }],
    responsive: {
        rules: [{
            condition: {
                maxWidth: 500
            },
            chartOptions: {
                legend: {
                    layout: 'horizontal',
                    align: 'center',
                    verticalAlign: 'bottom'
                }
            }
        }]
    }
});

Highcharts.chart('container_ios', {

    title: {
        text: '在线在玩查询 - 苹果'
    },

    subtitle: {
        text: ''
    },
    xAxis: {
        categories: [<?php echo "'".implode("','", $dayList)."'";?>]
    },
    yAxis: {
        title: {
            text: '人数'
        }
    },
    series: [{
        color: '#00ff00',
        name: '在线玩家',
        data: [<?php 
        	end($list['totalOnline_ios']);
        	$endTemp = key($list['totalOnline_ios']);
        	foreach($dayList as $k => $time){
        		if(strtotime(date("Y-m-d")." ".$endTemp) >= strtotime(date("Y-m-d")." ".$time)){
        			$temp = substr($time,0,5);
        			echo (isset($list['totalOnline_ios'][$temp])?$list['totalOnline_ios'][$temp]:0).",";
        		}
        		
        	}
        ?>]
    },
    {
        color: '#3333ff',
        name: '昨日在线玩家',
        data: [<?php 
        	end($list['totalYOnline_ios']);
        	$endTemp = key($list['totalYOnline_ios']);
        	foreach($dayList as $k => $time){
        		if(strtotime(date("Y-m-d")." ".$endTemp) >= strtotime(date("Y-m-d")." ".$time)){
        			$temp = substr($time,0,5);
        			echo (isset($list['totalYOnline_ios'][$temp])?$list['totalYOnline_ios'][$temp]:0).",";
        		}
        		
        	}
        ?>]
    },
	{
        color: '#000000',
        name: '上周同一天在玩玩家',
        data: [<?php 
        	end($list['totalLWOnline_ios']);
        	$endTemp = key($list['totalLWOnline_ios']);
        	foreach($dayList as $k => $time){
        		if(strtotime(date("Y-m-d")." ".$endTemp) >= strtotime(date("Y-m-d")." ".$time)){
        			$temp = substr($time,0,5);
        			echo (isset($list['totalLWOnline_ios'][$temp])?$list['totalLWOnline_ios'][$temp]:0).",";
        		}
        	}
        ?>]
    },
    ],

    responsive: {
        rules: [{
            condition: {
                maxWidth: 500
            },
            chartOptions: {
                legend: {
                    layout: 'horizontal',
                    align: 'center',
                    verticalAlign: 'bottom'
                }
            }
        }]
    }

});

Highcharts.chart('container_total', {

    title: {
        text: '在线在玩查询'
    },

    subtitle: {
        text: ''
    },
    xAxis: {
        categories: [<?php echo "'".implode("','", $dayList)."'";?>]
    },
    yAxis: {
        title: {
            text: '人数'
        }
    },
    series: [{
        color: '#00ff00',
        name: '在线玩家',
        data: [<?php 
        	end($list['totalOnline_total']);
        	$endTemp = key($list['totalOnline_total']);
        	foreach($dayList as $k => $time){
        		if(strtotime(date("Y-m-d")." ".$endTemp) >= strtotime(date("Y-m-d")." ".$time)){
        			$temp = substr($time,0,5);
        			echo (isset($list['totalOnline_ios'][$temp])?$list['totalOnline_total'][$temp]:0).",";
        		}
        		
        	}
        ?>]
    },
    {
        color: '#3333ff',
        name: '昨日在线玩家',
        data: [<?php 
        	end($list['totalYOnline_total']);
        	$endTemp = key($list['totalYOnline_total']);
        	foreach($dayList as $k => $time){
        		if(strtotime(date("Y-m-d")." ".$endTemp) >= strtotime(date("Y-m-d")." ".$time)){
        			$temp = substr($time,0,5);
        			echo (isset($list['totalYOnline_total'][$temp])?$list['totalYOnline_total'][$temp]:0).",";
        		}
        		
        	}
        ?>]
    },
	{
        color: '#000000',
        name: '上周同一天在玩玩家',
        data: [<?php 
        	end($list['totalLWOnline_total']);
        	$endTemp = key($list['totalLWOnline_total']);
        	foreach($dayList as $k => $time){
        		if(strtotime(date("Y-m-d")." ".$endTemp) >= strtotime(date("Y-m-d")." ".$time)){
        			$temp = substr($time,0,5);
        			echo (isset($list['totalLWOnline_total'][$temp])?$list['totalLWOnline_total'][$temp]:0).",";
        		}
        	}
        ?>]
    },
    ],

    responsive: {
        rules: [{
            condition: {
                maxWidth: 500
            },
            chartOptions: {
                legend: {
                    layout: 'horizontal',
                    align: 'center',
                    verticalAlign: 'bottom'
                }
            }
        }]
    }

});

</script>