Пример #1
0
 /**
  * Displays a search view.
  */
 public function actionSearch()
 {
     // is current user has the required privilege ?
     if (!Yii::app()->user->checkAccess('site_search')) {
         throw new CHttpException(403, 'You are not authorized to perform this action.');
     }
     $dataProvider = new CActiveDataProvider('Agenda');
     $model = new Agenda('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Agenda'])) {
         $model->attributes = $_GET['Agenda'];
     }
     $this->render('searchAgenda', array('model' => $model, 'dataProvider' => $dataProvider));
 }
Пример #2
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     date_default_timezone_set("Asia/Manila");
     $activity = new Activity();
     $activity->act_desc = 'Viewed Agenda List';
     $activity->act_datetime = date('Y-m-d G:i:s');
     $activity->act_by = User::model()->findByPK(Yii::app()->user->name)->emp_id;
     $activity->save();
     $model = new Agenda('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Agenda'])) {
         $model->attributes = $_GET['Agenda'];
     }
     $this->render('admin', array('model' => $model));
 }