/** * Manages all models. */ public function actionIndex() { $model = new Monitor('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Monitor'])) { $model->attributes = $_GET['Monitor']; } $this->render('index', array('model' => $model)); }
/** * Updates a particular model. * @param integer $id the ID of the model to be updated */ public function actionUbah($id) { $model = $this->loadModel($id); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Server'])) { $model->attributes = $_POST['Server']; $model->save(); } $monitorListBukan = new Monitor('search'); $monitorListBukan->unsetAttributes(); $monitorListBukan->serverId = $id; $monitorList = new ServerMonitor('search'); $monitorList->unsetAttributes(); $monitorList->server_id = $id; $this->render('ubah', array('model' => $model, 'monitorListBukan' => $monitorListBukan, 'monitorList' => $monitorList)); }
/** * Manages all models. */ public function actionAdmin() { // page size drop down changed if (isset($_GET['pageSize'])) { Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']); unset($_GET['pageSize']); // would interfere with pager and repetitive page size change } $model = new Monitor('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Monitor'])) { $model->attributes = $_GET['Monitor']; } if ($this->isExportRequest()) { $this->exportCSV($model->search(), array('name', 'location.name', 'category_id', 'commodity.name', 'user.name', 'status.status', 'manufacturer.name', 'monitortype.name', 'managementtype.name', 'size', 'serial_number', 'comments', 'imageFileName', 'documentFileName', 'enable_financial', 'available_on_loan')); } $this->render('admin', array('model' => $model)); }