Ejemplo n.º 1
0
 public function actionIndex()
 {
     $model = new Report('search');
     $model->unsetAttributes();
     if ($_GET['Report']) {
         $model->attributes = $_GET['Report'];
     }
     list($users, $report) = Report::model()->getUser();
     $this->render('index', ['model' => $model, 'users' => $users, 'report' => $report]);
 }
Ejemplo n.º 2
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new Report('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Report'])) {
         $model->attributes = $_GET['Report'];
     }
     $this->render('admin', array('model' => $model));
 }
 public function actionItemInactive($mfilter = '1')
 {
     $report = new Report();
     $report->unsetAttributes();
     // clear any default values
     if (Yii::app()->request->isAjaxRequest) {
         Yii::app()->clientScript->scriptMap['*.js'] = false;
         Yii::app()->clientScript->scriptMap['*.css'] = false;
         if (isset($_GET['ajax']) && $_GET['ajax'] == 'rpt-item-inactive-grid') {
             $this->render('item_expiry', array('report' => $report, 'mfilter' => $mfilter));
         } else {
             echo CJSON::encode(array('status' => 'success', 'div' => $this->renderPartial('item_inactive_ajax', array('report' => $report, 'mfilter' => $mfilter), true, true)));
             Yii::app()->end();
         }
     } else {
         $this->render('item_inactive', array('report' => $report, 'mfilter' => $mfilter));
     }
 }
Ejemplo n.º 4
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     if ($this->menu_use[7]) {
         $report_type_list = array();
         $criteria = new CDbCriteria();
         $criteria->condition = 'status=:status';
         $criteria->params = array(':status' => 1);
         $criteria->order = 'name_th';
         $report_type = ReportType::model()->findAll($criteria);
         foreach ($report_type as $type) {
             $report_type_list[$type->report_type_id] = $type->name_th;
         }
         $model = new Report('search');
         $model->unsetAttributes();
         // clear any default values
         if (isset($_GET['Report'])) {
             $model->attributes = $_GET['Report'];
         }
         $this->render('admin', array('model' => $model, 'report_type_list' => $report_type_list));
     } else {
         $this->redirect(array('site/index'));
     }
 }