Ejemplo n.º 1
0
 public function actionList()
 {
     $where = '1';
     //comment here
     if (isset($_POST['tarikh'])) {
         $tarikh = $_POST['tarikh'];
         $module = $_POST['module'];
         if (!empty($module)) {
             $where .= " AND module = '{$module}'";
         }
         if (!empty($tarikh)) {
             $where .= " AND event_dt LIKE '" . MyDate::dateFormat('dmy', 'ymd', $tarikh, '-') . "%'";
         }
     } else {
         $module = '0';
         $event_dt = '';
     }
     $count = Audit::find()->where($where)->count();
     $pages = new Pagination(['totalCount' => $count]);
     $pages->pageSize = 10;
     $data['pages'] = $pages;
     $data['module'] = $module;
     $data['event_dt'] = $event_dt;
     $audits = Audit::find()->where($where)->offset($pages->offset)->limit($pages->limit)->all();
     $data['audits'] = $audits;
     $data['mod'] = Ref::getList('mod');
     return $this->render('list', $data);
 }
Ejemplo n.º 2
0
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert)) {
         if (!empty($this->bod)) {
             $this->bod = MyDate::dateFormat('dmy', 'ymd', $this->bod, '-');
         }
         return true;
     } else {
         return false;
     }
 }
Ejemplo n.º 3
0
 public function afterFind()
 {
     $this->create_dt = MyDate::dateFormat('ymd', 'dmy', $this->create_dt);
 }