static function get_chart_master_beban() { $criteria = new CDbCriteria(); $criteria->addCondition("account_type = " . MtPrefs::TypeCostAct()); return MtChartMaster::model()->findAll($criteria); }
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 MtChartMaster('search'); // $model->unsetAttributes(); $criteria = new CDbCriteria(); // $criteria->limit = $limit; // $criteria->offset = $start; $model = MtChartMaster::model()->findAll($criteria); $total = MtChartMaster::model()->count($criteria); if (isset($_GET['MtChartMaster'])) { $model->attributes = $_GET['MtChartMaster']; } if (isset($_GET['output']) && $_GET['output'] == 'json') { $this->renderJson($model, $total); } else { $model = new MtChartMaster('search'); $model->unsetAttributes(); $this->render('admin', array('model' => $model)); } }