%%BE^BE9^BE9D5209%%statis.html.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <?php /* Smarty version 2.6.17, created on 2018-05-26 12:08:31
  2. compiled from admin/activity/statis.html */ ?>
  3. <?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
  4. smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'admin/activity/statis.html', 26, false),)), $this); ?>
  5. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  6. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/header.html", 'smarty_include_vars' => array()));
  7. $this->_tpl_vars = $_smarty_tpl_vars;
  8. unset($_smarty_tpl_vars);
  9. ?>
  10. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  11. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/left.html", 'smarty_include_vars' => array()));
  12. $this->_tpl_vars = $_smarty_tpl_vars;
  13. unset($_smarty_tpl_vars);
  14. ?>
  15. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  16. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/nav.html", 'smarty_include_vars' => array()));
  17. $this->_tpl_vars = $_smarty_tpl_vars;
  18. unset($_smarty_tpl_vars);
  19. ?>
  20. <style>
  21. .input-group-addon {
  22. padding: 5px 7px;
  23. border-radius: 1px;
  24. }
  25. </style>
  26. <script src="<?php echo $this->_tpl_vars['web_cfg']['cdn']; ?>
  27. /public/echarts/build/dist/echarts.js"></script>
  28. <div id="activity_container">
  29. <div class="activity_center">
  30. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  31. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/activity/common_nav.html", 'smarty_include_vars' => array()));
  32. $this->_tpl_vars = $_smarty_tpl_vars;
  33. unset($_smarty_tpl_vars);
  34. ?>
  35. <form class="form-inline" method="get" action="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
  36. /?c=Admin_Activity_Log&a=PageList&events_id=<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
  37. ">
  38. <input name="events_id" type="hidden" value="<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
  39. ">
  40. <input name="c" type="hidden" value="Admin_Activity_Log">
  41. <input name="a" type="hidden" value="PageList">
  42. <div class="form-group"><label>时间选择:</label></div>
  43. <div class="form-group"><label><a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
  44. /?c=Admin_Activity_Log&a=PageList&events_id=<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
  45. &select=7" class="button button-tiny">最近7天</a></label></div>
  46. <div class="form-group"><label><a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
  47. /?c=Admin_Activity_Log&a=PageList&events_id=<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
  48. &select=30" class="button button-tiny">最近30天</a></label></div>
  49. <div class="form-group"><label>
  50. <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')); ?>
  51. ">
  52. </label></div>
  53. <div class="form-group"><label>
  54. <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')); ?>
  55. ">
  56. </label></div>
  57. <div class="form-group"><label><input type="submit" class="button button-inverse button-tiny" value="查看"></label></div>
  58. </form>
  59. <div class="panel panel-default">
  60. <div class="panel-body">
  61. <div id="chart" style="height:400px"></div>
  62. </div>
  63. </div>
  64. <div class="panel panel-default">
  65. <div class="panel-body">
  66. <table class="table">
  67. <thead>
  68. <tr>
  69. <th>概况统计</th>
  70. <th>浏览量(pv)</th>
  71. <th>访问数量(uv)</th>
  72. </tr>
  73. </thead>
  74. <tbody>
  75. <?php $_from = $this->_tpl_vars['logData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  76. foreach ($_from as $this->_tpl_vars['item']):
  77. ?>
  78. <tr>
  79. <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')); ?>
  80. </td>
  81. <td><?php echo $this->_tpl_vars['item']['pv_num']; ?>
  82. </td>
  83. <td><?php echo $this->_tpl_vars['item']['uv_num']; ?>
  84. </td>
  85. </tr>
  86. <?php endforeach; endif; unset($_from); ?>
  87. </tbody>
  88. </table>
  89. </div>
  90. </div>
  91. </div>
  92. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  93. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/activity/common_right.html", 'smarty_include_vars' => array()));
  94. $this->_tpl_vars = $_smarty_tpl_vars;
  95. unset($_smarty_tpl_vars);
  96. ?>
  97. </div>
  98. <script type="text/javascript">
  99. //路径配置
  100. require.config({
  101. paths: {
  102. echarts: VG.conf.cdn_domain + '/public/echarts/build/dist'
  103. }
  104. });
  105. //使用
  106. require(
  107. [
  108. 'echarts',
  109. 'echarts/chart/line' // 使用柱状图就加载bar模块,按需加载
  110. ],
  111. function (ec) {
  112. // 基于准备好的dom,初始化echarts图表
  113. var myChart = ec.init(document.getElementById('chart'));
  114. var option = {
  115. title : {
  116. text: '流量统计图',
  117. 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')); ?>
  118. 至 <?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')); ?>
  119. '
  120. },
  121. tooltip : {
  122. trigger: 'axis'
  123. },
  124. legend: {
  125. data:['浏览量(pv)','访问数量(uv)']
  126. },
  127. toolbox: {
  128. show : true,
  129. feature : {
  130. mark : {show: true},
  131. saveAsImage : {show: true}
  132. }
  133. },
  134. calculable : true,
  135. xAxis : [
  136. {
  137. type : 'category',
  138. boundaryGap : false,
  139. data : [<?php echo $this->_tpl_vars['xAxis']; ?>
  140. ]
  141. }
  142. ],
  143. yAxis : [
  144. {
  145. type : 'value',
  146. axisLabel : {
  147. formatter: '{value}'
  148. }
  149. }
  150. ],
  151. series : [
  152. {
  153. name:'浏览量(pv)',
  154. type:'line',
  155. data:[<?php echo $this->_tpl_vars['pvs']; ?>
  156. ],
  157. markLine : {
  158. data : [
  159. {type : 'average', name: '平均值'}
  160. ]
  161. }
  162. },
  163. {
  164. name:'访问数量(uv)',
  165. type:'line',
  166. data:[<?php echo $this->_tpl_vars['uvs']; ?>
  167. ],
  168. markLine : {
  169. data : [
  170. {type : 'average', name: '平均值'}
  171. ]
  172. }
  173. }
  174. ]
  175. };
  176. // 为echarts对象加载数据
  177. myChart.setTheme('macarons');
  178. myChart.setOption(option);
  179. }
  180. );
  181. KISSY.use('node, io, gallery/datetimepicker/2.0.0/index', function (S, Node, IO, Datetimepicker) {
  182. var $ = S.all;
  183. //日期
  184. new Datetimepicker({
  185. start : 'input[name=b_time]',
  186. timepicker : false,
  187. closeOnDateSelect : true
  188. });
  189. //日期
  190. new Datetimepicker({
  191. start : 'input[name=e_time]',
  192. timepicker : false,
  193. closeOnDateSelect : true
  194. });
  195. });
  196. </script>
  197. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  198. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/bottom.html", 'smarty_include_vars' => array()));
  199. $this->_tpl_vars = $_smarty_tpl_vars;
  200. unset($_smarty_tpl_vars);
  201. ?>