public function actionAdmin() { IsAuth::Admin(); $model = new Admin('search'); $model->unsetAttributes(); if (isset($_GET['Admin'])) { $model->attributes = $_GET['Admin']; } $this->render('admin', array('model' => $model)); }
public function actionAdmin() { IsAuth::Admin(); $model = new Deal('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Deal'])) { $model->attributes = $_GET['Deal']; } $this->render('admin', array('model' => $model)); }
/** * function untuk findByPk untuk data order */ public function loadModel($id) { /* untuk cek login admin */ IsAuth::Admin(); /* findbyPk data order */ $model = Order::model()->findByPk($id); /* jika datanya tidak ada maka * alihkan ke error 404 */ if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } /* kembalikan nilai ke $model */ return $model; }
public function actionUpdate($id) { IsAuth::Admin(); $model = $this->loadModel($id); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); $model->date_modified = new CDbExpression('NOW()'); if (isset($_POST['SupportTicket'])) { $model->attributes = $_POST['SupportTicket']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->support_ticket_id)); } } $this->render('update', array('model' => $model)); }