Dashboard.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. <?php
  2. namespace app\admin\controller;
  3. use think\facade\View;
  4. use think\facade\Db;
  5. use think\facade\Lang;
  6. /**
  7. * ============================================================================
  8. * DSMall多用户商城
  9. * ============================================================================
  10. * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
  11. * 网站地址: http://www.csdeshang.com
  12. * ----------------------------------------------------------------------------
  13. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
  14. * 不允许对程序代码以任何形式任何目的的再发布。
  15. * ============================================================================
  16. * 控制器
  17. */
  18. class Dashboard extends AdminControl {
  19. public function initialize() {
  20. parent::initialize(); // TODO: Change the autogenerated stub
  21. Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/dashboard.lang.php');
  22. include_once root_path(). 'extend/mall/statistics.php';
  23. include_once root_path(). 'extend/mall/datehelper.php';
  24. }
  25. function index() {
  26. $this->welcome();
  27. }
  28. /*
  29. * 检查是否为最新版本
  30. */
  31. function version() {
  32. //当前版本
  33. $curent_version = file_get_contents(base_path() . 'version.php');
  34. //获取最新版本信息
  35. $vaules = array(
  36. 'domain'=>$_SERVER['HTTP_HOST'],
  37. 'version'=>$curent_version,
  38. );
  39. $service_url = "http://service.csdeshang.com/index.php/home/Version/checkDsmall.html?".http_build_query($vaules);
  40. //设置超时时间
  41. $opts = array(
  42. 'http' =>
  43. array(
  44. 'timeout' => 3
  45. )
  46. );
  47. $context = stream_context_create($opts);
  48. $service_info = @file_get_contents($service_url,FALSE,$context);
  49. $version_message = json_decode($service_info);
  50. View::assign('version_message', $version_message);
  51. }
  52. function welcome() {
  53. $this->version();
  54. /**
  55. * 管理员信息
  56. */
  57. $admin_model = model('admin');
  58. $tmp = $this->getAdminInfo();
  59. $condition = array();
  60. $condition[] = array('admin_id','=',$tmp['admin_id']);
  61. $admin_info = $admin_model->infoAdmin($condition);
  62. $admin_info['admin_login_time'] = date('Y-m-d H:i:s', ($admin_info['admin_login_time'] == '' ? TIMESTAMP : $admin_info['admin_login_time']));
  63. /**
  64. * 系统信息
  65. */
  66. $setup_date = config('ds_config.setup_date');
  67. $statistics['tp_version'] = \think\App::VERSION;
  68. $statistics['os'] = PHP_OS;
  69. $statistics['web_server'] = $_SERVER['SERVER_SOFTWARE'];
  70. $statistics['php_version'] = PHP_VERSION;
  71. $statistics['sql_version'] = $this->_mysql_version();
  72. //$statistics['shop_version'] = $version;
  73. $statistics['setup_date'] = substr($setup_date, 0, 10);
  74. $statistics['domain'] = $_SERVER['HTTP_HOST'];
  75. $statistics['ip'] = GetHostByName($_SERVER['SERVER_NAME']);
  76. $statistics['zlib'] = function_exists('gzclose') ? 'YES' : 'NO'; //zlib
  77. $statistics['safe_mode'] = (boolean) ini_get('safe_mode') ? 'YES' : 'NO'; //safe_mode = Off
  78. $statistics['timezone'] = function_exists("date_default_timezone_get") ? date_default_timezone_get() : "no_timezone";
  79. $statistics['curl'] = function_exists('curl_init') ? 'YES' : 'NO';
  80. $statistics['fileupload'] = @ini_get('file_uploads') ? ini_get('upload_max_filesize') : 'unknown';
  81. $statistics['max_ex_time'] = @ini_get("max_execution_time") . 's'; //脚本最大执行时间
  82. $statistics['set_time_limit'] = function_exists("set_time_limit") ? true : false;
  83. $statistics['memory_limit'] = ini_get('memory_limit');
  84. $statistics['version'] = file_get_contents(base_path() . 'version.php');
  85. if (function_exists("gd_info")) {
  86. $gd = gd_info();
  87. $statistics['gdinfo'] = $gd['GD Version'];
  88. } else {
  89. $statistics['gdinfo'] = lang('ds_unknown');
  90. }
  91. View::assign('statistics', $statistics);
  92. View::assign('admin_info', $admin_info);
  93. $this->_stat_json();
  94. $this->setAdminCurItem('welcome');
  95. echo View::fetch('welcome');
  96. exit;
  97. }
  98. private function _stat_json()
  99. {
  100. $this->_get_week_member();
  101. $this->_get_week_goods();
  102. $this->_get_week_store();
  103. $this->_get_week_order();
  104. }
  105. /**
  106. * 获取本周新增订单数量
  107. */
  108. private function _get_week_order()
  109. {
  110. $field = ' COUNT(*) as allnum ';
  111. $current_weekarr = getWeek_SdateAndEdate(TIMESTAMP);
  112. $stime = strtotime($current_weekarr['sdate']) - 86400 * 7;
  113. $etime = strtotime($current_weekarr['edate']) + 86400 - 1;
  114. //总计的查询时间
  115. $count_arr['seartime'] = ($stime + 86400 * 7) . '|' . $etime;
  116. $up_week = @date('W', $stime); //上周
  117. $curr_week = @date('W', $etime); //本周
  118. //构造横轴数据
  119. for ($i = 1; $i <= 7; $i++) {
  120. //统计图数据
  121. $up_arr[$i] = 0;
  122. $curr_arr[$i] = 0;
  123. $tmp_weekarr = getSystemWeekArr();
  124. //统计表数据
  125. $currlist_arr[$i]['timetext'] = $tmp_weekarr[$i];
  126. //方便搜索会员列表,计算开始时间和结束时间
  127. $currlist_arr[$i]['stime'] = strtotime($current_weekarr['sdate']) + ($i - 1) * 86400;
  128. $currlist_arr[$i]['etime'] = $currlist_arr[$i]['stime'] + 86400 - 1;
  129. $uplist_arr[$i]['val'] = 0;
  130. $currlist_arr[$i]['val'] = 0;
  131. //横轴
  132. $stat_arr['xAxis']['categories'][] = $tmp_weekarr[$i];
  133. unset($tmp_weekarr);
  134. }
  135. $where = array();
  136. $where[] = array('add_time','between', array($stime, $etime));
  137. $field .= ',WEEKOFYEAR(FROM_UNIXTIME(add_time)) as weekval,WEEKDAY(FROM_UNIXTIME(add_time))+1 as dayofweekval ';
  138. $orderlist = Db::name('order')->field($field)->where($where)->group('weekval,dayofweekval')->select()->toArray();
  139. if ($orderlist) {
  140. foreach ($orderlist as $k => $v) {
  141. if ($up_week == intval($v['weekval'])) {
  142. $up_arr[$v['dayofweekval']] = intval($v['allnum']);
  143. $uplist_arr[$v['dayofweekval']]['val'] = intval($v['allnum']);
  144. if(isset($count_arr['up'])){
  145. $count_arr['up'] += intval($v['allnum']);
  146. }else{
  147. $count_arr['up'] = 0;
  148. }
  149. }
  150. if ($curr_week == $v['weekval']) {
  151. $curr_arr[$v['dayofweekval']] = intval($v['allnum']);
  152. $currlist_arr[$v['dayofweekval']]['val'] = intval($v['allnum']);
  153. if(isset($count_arr['curr'])){
  154. $count_arr['curr'] += intval($v['allnum']);
  155. }else{
  156. $count_arr['curr'] = 0;
  157. }
  158. }
  159. }
  160. }
  161. $stat_arr['series'][0]['name'] = lang('last_week');
  162. $stat_arr['series'][0]['data'] = array_values($up_arr);
  163. $stat_arr['series'][1]['name'] = lang('this_week');
  164. $stat_arr['series'][1]['data'] = array_values($curr_arr);
  165. //得到统计图数据
  166. $stat_arr['title'] = lang('new_order_statistics');
  167. $stat_arr['yAxis'] = lang('new_order_count');
  168. $stat_json = getStatData_LineLabels($stat_arr);
  169. View::assign('stat_json_week_order', $stat_json);
  170. }
  171. /**
  172. * 获取本周新增店铺数量
  173. */
  174. private function _get_week_store()
  175. {
  176. $field = ' COUNT(*) as allnum ';
  177. $current_weekarr = getWeek_SdateAndEdate(TIMESTAMP);
  178. $stime = strtotime($current_weekarr['sdate']) - 86400 * 7;
  179. $etime = strtotime($current_weekarr['edate']) + 86400 - 1;
  180. //总计的查询时间
  181. $count_arr['seartime'] = ($stime + 86400 * 7) . '|' . $etime;
  182. $up_week = @date('W', $stime); //上周
  183. $curr_week = @date('W', $etime); //本周
  184. //构造横轴数据
  185. for ($i = 1; $i <= 7; $i++) {
  186. //统计图数据
  187. $up_arr[$i] = 0;
  188. $curr_arr[$i] = 0;
  189. $tmp_weekarr = getSystemWeekArr();
  190. //统计表数据
  191. $currlist_arr[$i]['timetext'] = $tmp_weekarr[$i];
  192. //方便搜索会员列表,计算开始时间和结束时间
  193. $currlist_arr[$i]['stime'] = strtotime($current_weekarr['sdate']) + ($i - 1) * 86400;
  194. $currlist_arr[$i]['etime'] = $currlist_arr[$i]['stime'] + 86400 - 1;
  195. $uplist_arr[$i]['val'] = 0;
  196. $currlist_arr[$i]['val'] = 0;
  197. //横轴
  198. $stat_arr['xAxis']['categories'][] = $tmp_weekarr[$i];
  199. unset($tmp_weekarr);
  200. }
  201. $where = array();
  202. $where[] = array('store_addtime','between', array($stime, $etime));
  203. $field .= ',WEEKOFYEAR(FROM_UNIXTIME(store_addtime)) as weekval,WEEKDAY(FROM_UNIXTIME(store_addtime))+1 as dayofweekval ';
  204. $storelist = Db::name('store')->field($field)->where($where)->group('weekval,dayofweekval')->select()->toArray();
  205. if ($storelist) {
  206. foreach ($storelist as $k => $v) {
  207. if ($up_week == intval($v['weekval'])) {
  208. $up_arr[$v['dayofweekval']] = intval($v['allnum']);
  209. $uplist_arr[$v['dayofweekval']]['val'] = intval($v['allnum']);
  210. if(isset($count_arr['up'])){
  211. $count_arr['up'] += intval($v['allnum']);
  212. }else{
  213. $count_arr['up'] = 0;
  214. }
  215. }
  216. if ($curr_week == $v['weekval']) {
  217. $curr_arr[$v['dayofweekval']] = intval($v['allnum']);
  218. $currlist_arr[$v['dayofweekval']]['val'] = intval($v['allnum']);
  219. if(isset($count_arr['curr'])){
  220. $count_arr['curr'] += intval($v['allnum']);
  221. }else{
  222. $count_arr['curr'] = 0;
  223. }
  224. }
  225. }
  226. }
  227. $stat_arr['series'][0]['name'] = lang('last_week');
  228. $stat_arr['series'][0]['data'] = array_values($up_arr);
  229. $stat_arr['series'][1]['name'] = lang('this_week');
  230. $stat_arr['series'][1]['data'] = array_values($curr_arr);
  231. //得到统计图数据
  232. $stat_arr['title'] = lang('new_store_statistics');
  233. $stat_arr['yAxis'] = lang('new_store_count');
  234. $stat_json = getStatData_LineLabels($stat_arr);
  235. View::assign('stat_json_week_store', $stat_json);
  236. }
  237. /**
  238. * 获取本周新增商品数量
  239. */
  240. private function _get_week_goods() {
  241. $field = ' COUNT(*) as allnum ';
  242. $current_weekarr = getWeek_SdateAndEdate(TIMESTAMP);
  243. $stime = strtotime($current_weekarr['sdate']) - 86400 * 7;
  244. $etime = strtotime($current_weekarr['edate']) + 86400 - 1;
  245. //总计的查询时间
  246. $count_arr['seartime'] = ($stime + 86400 * 7) . '|' . $etime;
  247. $up_week = @date('W', $stime); //上周
  248. $curr_week = @date('W', $etime); //本周
  249. //构造横轴数据
  250. for ($i = 1; $i <= 7; $i++) {
  251. //统计图数据
  252. $up_arr[$i] = 0;
  253. $curr_arr[$i] = 0;
  254. $tmp_weekarr = getSystemWeekArr();
  255. //统计表数据
  256. $currlist_arr[$i]['timetext'] = $tmp_weekarr[$i];
  257. //方便搜索会员列表,计算开始时间和结束时间
  258. $currlist_arr[$i]['stime'] = strtotime($current_weekarr['sdate']) + ($i - 1) * 86400;
  259. $currlist_arr[$i]['etime'] = $currlist_arr[$i]['stime'] + 86400 - 1;
  260. $uplist_arr[$i]['val'] = 0;
  261. $currlist_arr[$i]['val'] = 0;
  262. //横轴
  263. $stat_arr['xAxis']['categories'][] = $tmp_weekarr[$i];
  264. unset($tmp_weekarr);
  265. }
  266. $where = array();
  267. $where[] = array('goods_addtime','between', array($stime, $etime));
  268. $field .= ',WEEKOFYEAR(FROM_UNIXTIME(goods_addtime)) as weekval,WEEKDAY(FROM_UNIXTIME(goods_addtime))+1 as dayofweekval ';
  269. $goodslist = Db::name('goodscommon')->field($field)->where($where)->group('weekval,dayofweekval')->select()->toArray();
  270. if ($goodslist) {
  271. foreach ($goodslist as $k => $v) {
  272. if ($up_week == intval($v['weekval'])) {
  273. $up_arr[$v['dayofweekval']] = intval($v['allnum']);
  274. $uplist_arr[$v['dayofweekval']]['val'] = intval($v['allnum']);
  275. if(isset($count_arr['up'])){
  276. $count_arr['up'] += intval($v['allnum']);
  277. }else{
  278. $count_arr['up'] = 0;
  279. }
  280. }
  281. if ($curr_week == $v['weekval']) {
  282. $curr_arr[$v['dayofweekval']] = intval($v['allnum']);
  283. $currlist_arr[$v['dayofweekval']]['val'] = intval($v['allnum']);
  284. if(isset($count_arr['curr'])){
  285. $count_arr['curr'] += intval($v['allnum']);
  286. }else{
  287. $count_arr['curr'] = 0;
  288. }
  289. }
  290. }
  291. }
  292. $stat_arr['series'][0]['name'] = lang('last_week');
  293. $stat_arr['series'][0]['data'] = array_values($up_arr);
  294. $stat_arr['series'][1]['name'] = lang('this_week');
  295. $stat_arr['series'][1]['data'] = array_values($curr_arr);
  296. //得到统计图数据
  297. $stat_arr['title'] = lang('new_goods_statistics');
  298. $stat_arr['yAxis'] = lang('new_goods_count');
  299. $stat_json = getStatData_LineLabels($stat_arr);
  300. View::assign('stat_json_week_goods', $stat_json);
  301. }
  302. /**
  303. * 获取本周新增会员数量
  304. */
  305. private function _get_week_member() {
  306. $field = ' COUNT(*) as allnum ';
  307. $current_weekarr = getWeek_SdateAndEdate(TIMESTAMP);
  308. $stime = strtotime($current_weekarr['sdate']) - 86400 * 7;
  309. $etime = strtotime($current_weekarr['edate']) + 86400 - 1;
  310. //总计的查询时间
  311. $count_arr['seartime'] = ($stime + 86400 * 7) . '|' . $etime;
  312. $up_week = @date('W', $stime); //上周
  313. $curr_week = @date('W', $etime); //本周
  314. //构造横轴数据
  315. for ($i = 1; $i <= 7; $i++) {
  316. //统计图数据
  317. $up_arr[$i] = 0;
  318. $curr_arr[$i] = 0;
  319. $tmp_weekarr = getSystemWeekArr();
  320. //统计表数据
  321. $currlist_arr[$i]['timetext'] = $tmp_weekarr[$i];
  322. //方便搜索会员列表,计算开始时间和结束时间
  323. $currlist_arr[$i]['stime'] = strtotime($current_weekarr['sdate']) + ($i - 1) * 86400;
  324. $currlist_arr[$i]['etime'] = $currlist_arr[$i]['stime'] + 86400 - 1;
  325. $uplist_arr[$i]['val'] = 0;
  326. $currlist_arr[$i]['val'] = 0;
  327. //横轴
  328. $stat_arr['xAxis']['categories'][] = $tmp_weekarr[$i];
  329. unset($tmp_weekarr);
  330. }
  331. $where = array();
  332. $where[] = array('member_addtime','between', array($stime, $etime));
  333. $field .= ',WEEKOFYEAR(FROM_UNIXTIME(member_addtime)) as weekval,WEEKDAY(FROM_UNIXTIME(member_addtime))+1 as dayofweekval ';
  334. $memberlist = Db::name('member')->field($field)->where($where)->group('weekval,dayofweekval')->select()->toArray();
  335. if ($memberlist) {
  336. foreach ($memberlist as $k => $v) {
  337. if ($up_week == intval($v['weekval'])) {
  338. $up_arr[$v['dayofweekval']] = intval($v['allnum']);
  339. $uplist_arr[$v['dayofweekval']]['val'] = intval($v['allnum']);
  340. if(isset($count_arr['up'])){
  341. $count_arr['up'] += intval($v['allnum']);
  342. }else{
  343. $count_arr['up'] = 0;
  344. }
  345. }
  346. if ($curr_week == $v['weekval']) {
  347. $curr_arr[$v['dayofweekval']] = intval($v['allnum']);
  348. $currlist_arr[$v['dayofweekval']]['val'] = intval($v['allnum']);
  349. if(isset($count_arr['curr'])){
  350. $count_arr['curr'] += intval($v['allnum']);
  351. }else{
  352. $count_arr['curr'] = 0;
  353. }
  354. }
  355. }
  356. }
  357. $stat_arr['series'][0]['name'] = lang('last_week');
  358. $stat_arr['series'][0]['data'] = array_values($up_arr);
  359. $stat_arr['series'][1]['name'] = lang('this_week');
  360. $stat_arr['series'][1]['data'] = array_values($curr_arr);
  361. //得到统计图数据
  362. $stat_arr['title'] = lang('new_member_statistics');
  363. $stat_arr['yAxis'] = lang('new_member_count');
  364. $stat_json = getStatData_LineLabels($stat_arr);
  365. View::assign('stat_json_week_member', $stat_json);
  366. }
  367. /**
  368. * 获取当前数据库版本
  369. */
  370. private function _mysql_version() {
  371. $version = Db::query("select version() as ver");
  372. return $version[0]['ver'];
  373. }
  374. function aboutus() {
  375. $this->setAdminCurItem('aboutus');
  376. return View::fetch();
  377. }
  378. /**
  379. * 统计
  380. */
  381. public function statistics() {
  382. $statistics = array();
  383. // 本周开始时间点
  384. $tmp_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - (date('w') == 0 ? 7 : date('w') - 1) * 24 * 60 * 60;
  385. /**
  386. * 会员
  387. */
  388. $member_model = model('member');
  389. // 会员总数
  390. $statistics['member'] = $member_model->getMemberCount(array());
  391. // 新增会员数
  392. $statistics['week_add_member'] = $member_model->getMemberCount(array(array('member_addtime','>=', $tmp_time)));
  393. // 预存款提现
  394. $statistics['cashlist'] = model('predeposit')->getPdcashCount(array('pdc_payment_state' => 0));
  395. /**
  396. * 店铺
  397. */
  398. $store_model = model('store');
  399. // 店铺总数
  400. $statistics['store'] = model('store')->getStoreCount(array());
  401. // 店铺申请数
  402. $statistics['store_joinin'] = model('storejoinin')->getStorejoininCount(array(array('joinin_state','in', array(10, 11))));
  403. //经营类目申请
  404. $statistics['store_bind_class_applay'] = model('storebindclass')->getStorebindclassCount(array('storebindclass_state' => 0));
  405. //店铺续签申请
  406. $statistics['store_reopen_applay'] = model('storereopen')->getStorereopenCount(array('storereopen_state' => 1));
  407. // 即将到期
  408. $statistics['store_expire'] = $store_model->getStoreCount(array(array('store_state','=',1),array('store_endtime','between',array(TIMESTAMP, TIMESTAMP + 864000))));
  409. // 已经到期
  410. $statistics['store_expired'] = $store_model->getStoreCount(array(array('store_state','=',1),array('store_endtime','between',array(1, TIMESTAMP))));
  411. /**
  412. * 商品
  413. */
  414. $goods_model = model('goods');
  415. // 商品总数
  416. $statistics['goods'] = $goods_model->getGoodsCommonCount(array());
  417. // 新增商品数
  418. $statistics['week_add_product'] = $goods_model->getGoodsCommonCount(array(array('goods_addtime','>=', $tmp_time)));
  419. // 等待审核
  420. $statistics['product_verify'] = $goods_model->getGoodsCommonWaitVerifyCount(array());
  421. // 举报
  422. $statistics['inform_list'] = model('inform')->getInformCount(array('inform_state' => 1));
  423. // 品牌申请
  424. $statistics['brand_apply'] = model('brand')->getBrandCount(array('brand_apply' => '0'));
  425. /**
  426. * 交易
  427. */
  428. $order_model = model('order');
  429. $refundreturn_model = model('refundreturn');
  430. $vrrefund_model = model('vrrefund');
  431. $complain_model = model('complain');
  432. // 订单总数
  433. $statistics['order'] = $order_model->getOrderCount(array());
  434. // 退款
  435. $statistics['refund'] = $refundreturn_model->getRefundreturnCount(array('refund_type' => 1, 'refund_state' => 2));
  436. // 退货
  437. $statistics['return'] = $refundreturn_model->getRefundreturnCount(array('refund_type' => 2, 'refund_state' => 2));
  438. // 虚拟订单退款
  439. $statistics['vr_refund'] = $vrrefund_model->getVrrefundCount(array('admin_state' => 1));
  440. // 投诉
  441. $statistics['complain_new_list'] = $complain_model->getComplainCount(array('complain_state' => 10));
  442. // 待仲裁
  443. $statistics['complain_handle_list'] = $complain_model->getComplainCount(array('complain_state' => 40));
  444. /**
  445. * 运营
  446. */
  447. // 抢购数量
  448. $statistics['groupbuy_verify_list'] = model('groupbuy')->getGroupbuyCount(array('groupbuy_state' => 10));
  449. // 积分订单
  450. $pointsorder_model = model('pointorder');
  451. $condition =array();
  452. $condition =array(array('point_orderstate','in', array(11, 20)));
  453. $statistics['points_order'] = $pointsorder_model->getPointorderCount($condition);
  454. //待审核账单
  455. $bill_model = model('bill');
  456. $statistics['check_billno'] = $bill_model->getOrderbillCount(array('ob_state'=>BILL_STATE_STORE_COFIRM));
  457. //待支付账单
  458. $statistics['pay_billno'] = $bill_model->getOrderbillCount(array('ob_state'=>BILL_STATE_STORE_COFIRM));
  459. // 平台客服
  460. $statistics['mall_consult'] = model('mallconsult')->getMallconsultCount(array('mallconsult_isreply' => 0));
  461. // 服务站
  462. $statistics['chain'] = model('chain')->getChainWaitVerifyCount(array());
  463. echo json_encode($statistics);
  464. exit;
  465. }
  466. }
  467. ?>