/** * Manages all models. */ public function actionIndex() { $model = new Server('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Server'])) { $model->attributes = $_GET['Server']; } $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['Monitor'])) { $model->attributes = $_POST['Monitor']; $model->save(); } $serverBukanList = new Server('search'); $serverBukanList->unsetAttributes(); $serverBukanList->monitorId = $id; $serverList = new ServerMonitor('search'); $serverList->unsetAttributes(); $serverList->monitor_id = "={$id}"; $this->render('ubah', array('model' => $model, 'serverBukanList' => $serverBukanList, 'serverList' => $serverList)); }
public function actionAdmin() { $model = new Server('search'); $model->unsetAttributes(); if (isset($_GET['Server'])) { $model->attributes = $_GET['Server']; } $this->render('admin', array('model' => $model)); }