<?php /* Smarty version 2.6.17, created on 2018-05-26 12:08:31
         compiled from admin/activity/statis.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'admin/activity/statis.html', 26, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/left.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/nav.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<style>
.input-group-addon {
	padding: 5px 7px;
	border-radius: 1px;
}
</style>
<script src="<?php echo $this->_tpl_vars['web_cfg']['cdn']; ?>
/public/echarts/build/dist/echarts.js"></script>

<div id="activity_container">

<div class="activity_center">
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/activity/common_nav.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

	<form class="form-inline" method="get" action="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
/?c=Admin_Activity_Log&a=PageList&events_id=<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
">
		<input name="events_id" type="hidden" value="<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
">
		<input name="c" type="hidden" value="Admin_Activity_Log">
		<input name="a" type="hidden" value="PageList">
		<div class="form-group"><label>时间选择:</label></div>
		<div class="form-group"><label><a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
/?c=Admin_Activity_Log&a=PageList&events_id=<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
&select=7" class="button button-tiny">最近7天</a></label></div>
		<div class="form-group"><label><a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
/?c=Admin_Activity_Log&a=PageList&events_id=<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
&select=30" class="button button-tiny">最近30天</a></label></div>
		<div class="form-group"><label>
			<input name="b_time" type="text" class="form-control" placeholder="开始时间" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['b_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
">
		</label></div>
		<div class="form-group"><label>
			<input name="e_time" type="text" class="form-control" placeholder="结束时间" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['e_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
">
		</label></div>
		<div class="form-group"><label><input type="submit" class="button button-inverse button-tiny" value="查看"></label></div>
	</form>
	
	<div  class="panel panel-default">
		<div class="panel-body">
			<div id="chart" style="height:400px"></div>
 		</div>
	</div>
	<div  class="panel panel-default">
		<div class="panel-body">
			<table class="table">
				<thead>
					<tr>
						<th>概况统计</th>
						<th>浏览量(pv)</th>
						<th>访问数量(uv)</th>
					</tr>
				</thead>
				<tbody>
					<?php $_from = $this->_tpl_vars['logData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item']):
?>
					<tr>
						<td><?php echo ((is_array($_tmp=$this->_tpl_vars['item']['date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
</td>
						<td><?php echo $this->_tpl_vars['item']['pv_num']; ?>
</td>
						<td><?php echo $this->_tpl_vars['item']['uv_num']; ?>
</td>
					</tr>
					<?php endforeach; endif; unset($_from); ?>
				</tbody>
			</table>
 		</div>
	</div>
</div>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/activity/common_right.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
</div>

<script type="text/javascript">
//路径配置
require.config({
    paths: {
        echarts: VG.conf.cdn_domain + '/public/echarts/build/dist'
    }
});
//使用
require(
    [
        'echarts',
        'echarts/chart/line' // 使用柱状图就加载bar模块,按需加载
    ],
    
    function (ec) {
        // 基于准备好的dom,初始化echarts图表
        var myChart = ec.init(document.getElementById('chart')); 
        
        var option = {
       	    title : {
       	        text: '流量统计图',
       	        subtext: '<?php echo ((is_array($_tmp=$this->_tpl_vars['b_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
 至 <?php echo ((is_array($_tmp=$this->_tpl_vars['e_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
'
       	    },
       	    tooltip : {
       	        trigger: 'axis'
       	    },
       	    legend: {
       	        data:['浏览量(pv)','访问数量(uv)']
       	    },
       	    toolbox: {
       	        show : true,
       	        feature : {
       	            mark : {show: true},
       	            saveAsImage : {show: true}
       	        }
       	    },
       	    calculable : true,
       	    xAxis : [
       	        {
       	            type : 'category',
       	            boundaryGap : false,
       	            data : [<?php echo $this->_tpl_vars['xAxis']; ?>
]
       	        }
       	    ],
       	    yAxis : [
       	        {
       	            type : 'value',
       	            axisLabel : {
       	                formatter: '{value}'
       	            }
       	        }
       	    ],
       	    series : [
       	        {
       	            name:'浏览量(pv)',
       	            type:'line',
       	            data:[<?php echo $this->_tpl_vars['pvs']; ?>
],
       	            markLine : {
       	                data : [
       	                    {type : 'average', name: '平均值'}
       	                ]
       	            }
       	        },
       	    	{
       	            name:'访问数量(uv)',
       	            type:'line',
       	            data:[<?php echo $this->_tpl_vars['uvs']; ?>
],
       	            markLine : {
       	                data : [
       	                    {type : 'average', name: '平均值'}
       	                ]
       	            }
       	        }
       	    ]
       	};

        // 为echarts对象加载数据
        myChart.setTheme('macarons');
        myChart.setOption(option); 
    }
);

KISSY.use('node, io, gallery/datetimepicker/2.0.0/index', function (S, Node, IO, Datetimepicker) {
	var $ = S.all;
	
	//日期
    new Datetimepicker({
        start : 'input[name=b_time]',
        timepicker : false,
        closeOnDateSelect : true
    });
 	//日期
    new Datetimepicker({
        start : 'input[name=e_time]',
        timepicker : false,
        closeOnDateSelect : true
    });
});
</script>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/bottom.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>