public function actionIndex()
 {
     if (isset($_POST['limit'])) {
         $limit = $_POST['limit'];
     } else {
         $limit = 20;
     }
     if (isset($_POST['start'])) {
         $start = $_POST['start'];
     } else {
         $start = 0;
     }
     //$model = new PeSysPrefs('search');
     //$model->unsetAttributes();
     $criteria = new CDbCriteria();
     //$criteria->limit = $limit;
     //$criteria->offset = $start;
     $model = PeSysPrefs::model()->findAll($criteria);
     $total = PeSysPrefs::model()->count($criteria);
     if (isset($_GET['PeSysPrefs'])) {
         $model->attributes = $_GET['PeSysPrefs'];
     }
     if (isset($_GET['output']) && $_GET['output'] == 'json') {
         $this->renderJson($model, $total);
     } else {
         $model = new PeSysPrefs('search');
         $model->unsetAttributes();
         $this->render('admin', array('model' => $model));
     }
 }
Пример #2
0
 static function TypePendapatanAct()
 {
     $model = PeSysPrefs::model()->findByPk('type_pendapatan_act');
     return $model->value;
 }