예제 #1
0
 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 PahSys('search');
     //$model->unsetAttributes();
     $criteria = new CDbCriteria();
     //        $criteria->limit = $limit;
     //        $criteria->offset = $start;
     $model = PahSys::model()->findAll($criteria);
     $total = PahSys::model()->count($criteria);
     if (isset($_GET['PahSys'])) {
         $model->attributes = $_GET['PahSys'];
     }
     if (isset($_GET['output']) && $_GET['output'] == 'json') {
         $this->renderJson($model, $total);
     } else {
         $model = new PahSys('search');
         $model->unsetAttributes();
         $this->render('admin', array('model' => $model));
     }
 }
예제 #2
0
 static function TypePendapatanAct()
 {
     $model = PahSys::model()->findByPk('type_pendapatan_act');
     return $model->value;
 }