<!DOCTYPE html>
<!--[if IE 8 ]><html dir="ltr" lang="zh-TW" class="ie8"><![endif]-->
<!--[if IE 9 ]><html dir="ltr" lang="zh-TW" class="ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html dir="ltr" lang="zh-TW">
<!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<title>管理後臺</title>
<meta name="robots" content="noindex, nofollow" />
<link href="less/page.less" rel="stylesheet/less">
<link href="css/main.css" rel="stylesheet">
<link href="css/page.css" rel="stylesheet">
<script src="/jquery/jquery-1.10.js"></script>
<script src="/js/less.min.js" ></script>
<!-- 圖表-圓餅圖效果 -->
<script src="/js/Highcharts/highcharts.js"></script>
<script src="/js/Highcharts/modules/series-label.js"></script>
<script src="/js/Highcharts/modules/exporting.js"></script>
<script src="/js/Highcharts/modules/export-data.js"></script>
<script src="/js/Highcharts/modules/accessibility.js"></script>
<script>
	function chganalysis(a=1){
		var xtype = [<?# ylistD ?>];
		var seriesname = '<?# date2 ?>';
		var seriesdata = [<?# ylistN ?>];
		if(a == 2){
			var xtype = [<?# mlistD ?>];
			var seriesname = '<?# date3 ?>';
			var seriesdata = [<?# mlistN ?>];
		}else if(a == 3){
			var xtype = [<?# dlistD ?>];
			var seriesname = '<?# date4 ?>';
			var seriesdata = [<?# dlistN ?>];
		}
		$('#container').highcharts({
			chart: { type: 'areaspline' },
			title: { text: '' },
			legend: { layout: 'vertical', align: 'left', verticalAlign: 'top', x: 150, y: 100, floating: true, borderWidth: 1, backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF' },
			xAxis: { categories: xtype },
			yAxis: {
				title: { text: '瀏覽人數' }
			},
			tooltip: { shared: true, valueSuffix: ' 人' },
			credits: { enabled: false },
			plotOptions: {
				areaspline: { fillOpacity: 0.5 }
			},
			series: [{
				name: seriesname,
				data: seriesdata
			}]
		}); 
		window.dispatchEvent(new Event('resize'));
	}
	$(function(){
		$('#chgTimeBox a[data-action="chgview"]').on('click', function(){
			$('#chgTimeBox a').attr('class', 'btn btn_g_400');
			if($(this).data('type') == "2"){
				$('#ymdTitle').text('<?# date3 ?>');
				$('#ymdNum').text('<?# num3 ?>人');
			}else if($(this).data('type') == "3"){
				$('#ymdTitle').text('<?# date4 ?>');
				$('#ymdNum').text('<?# num4 ?>人');
			}else{
				$('#ymdTitle').text('<?# date2 ?>');
				$('#ymdNum').text('<?# num2 ?>人');
			}
			$(this).attr('class', 'btn btn_dark');
			chganalysis($(this).data('type'));
		});
		$('#page_refresh').click(function(){
			location.href = location.href;
		});
	});
	$(window).load(function(){
		chganalysis();
	});
</script>
</head>
<body>
	<?# sidePage ?>
	<div class="pos_rel count_page" id="content">
		<?# header ?>
		<div class="row mt_10 mb_5 h3 page_title"><?# page_name ?></div>
        <div class="mb_2 d_flex flex_wrap f_justify_center f_aitems_center" id="SearchEngine">
            <php:repeater id="listC">
            <template>
            <div class="mb_3 col_lg_offset_3 col_offset_6 card">
                <div class="card_body">
                    <p class="mb_2"><?# title ?></p>
                    <b class="<?# type ?> h2" id="c<?# NO ?>"><?# count ?></b>
                </div>
            </div>
            </template>
            </php:repeater>
        </div>
        <div class="card">
			<div class="pos_rel bg_g_100 tabs_warp" id="tabs_warp">
                <div class="tabs_list">
                    <a class="tabs_item" data-action="true" href="javascript:void(0);">全站瀏覽人數分析</a>
                    <a class="tabs_item" href="countLast100.php">最後一百位訪客</a>
                    <a class="tabs_item" href="countIP.php">IP點擊次數</a>
                </div>
            </div>
            <div class="d_flex flex_wrap f_justify_space_b f_aitems_center card_body">
                <p class="mr_3"><font class="h6" id="ymdTitle"><?# date2 ?></font><font class="h6">瀏覽人數：</font><strong class="h6" id="ymdNum"><?# num2 ?>人</strong></p>
                <div class="over_hid" id="chgTimeBox">
                    <a class="btn btn_g_400" href="javascript:void(0);" data-action="chgview" data-type="3">日</a>
                    <a class="btn btn_g_400" href="javascript:void(0);" data-action="chgview" data-type="2">月</a>
                    <a class="btn btn_dark" id="year_view" href="javascript:void(0);" data-action="chgview" data-type="1">年</a>
                </div>
            </div>
            <div class="card_body" id="highcharts_box"><div id="container"></div></div>
        </div>
		<footer class="pos_fix bg_white txt_g_400"><?# Y ?>© Copyright All Rights Reserved</footer>
		<a class="pos_fix d_flex bg_primary" id="gotop" href="javascript:goTop();"><i class="txt_white fas fa-angle-up"></i></a>
	</div>
</body>
</html>
<script src="/js/countUp.js"></script>
<script src="/jquery/admin-jquery.js"></script>
<script>
	var options = {
		useEasing : true, 
		useGrouping : true, 
		separator : ',', 
		decimal : '.' 
	}
	<php:repeater id="listC2">
	<template>
	var demo<?# NO ?> = new countUp("c<?# NO ?>", 0, <?# count ?>, 0, 8.5, options);
	demo<?# NO ?>.start();
	</template>
	</php:repeater>
	
	function goTop(){ $('html,body').animate({'scrollTop':0},600); }
</script>