XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
counter.admin.view.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 
9 class counterAdminView extends counter
10 {
11 
17  function init()
18  {
19  // set the template path
20  $this->setTemplatePath($this->module_path . 'tpl');
21  }
22 
29  {
30  // set today's if no date is given
31  $selected_date = (int)Context::get('selected_date');
32 
33  if(!$selected_date)
34  {
35  $selected_date = date("Ymd");
36  }
37 
38  Context::set('selected_date', $selected_date);
39 
40  // create the counter model object
41  $oCounterModel = getModel('counter');
42 
43  // get a total count and daily count
44  $site_module_info = Context::get('site_module_info');
45  $status = $oCounterModel->getStatus(array(0, $selected_date), $site_module_info->site_srl);
46 
47  Context::set('total_counter', $status[0]);
48  Context::set('selected_day_counter', $status[$selected_date]);
49 
50  // get data by time, day, month, and year
51  $type = Context::get('type');
52 
53  if(!$type)
54  {
55  $type = 'day';
56  Context::set('type', $type);
57  }
58 
59  $detail_status = $oCounterModel->getHourlyStatus($type, $selected_date, $site_module_info->site_srl);
60  Context::set('detail_status', $detail_status);
61 
62  // display
63  $this->setTemplateFile('index');
64  }
65 
66 }
67 /* End of file counter.admin.view.php */
68 /* Location: ./modules/counter/counter.admin.view.php */
setTemplateFile($filename)
set($key, $val, $set_to_get_vars=0)
getModel($module_name)
Definition: func.inc.php:145