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)); }
public function actionTambahhasil() { /* untuk cek apakah user telah login atau belum */ IsAuth::Peserta(); /* findbyPK data user yang login */ $model = new Hasil(); /* jika POST maka * ubahpassword */ if (isset($_POST['Hasil'])) { $model->attributes = $_POST['Hasil']; $model->ID_PESERTA = Yii::app()->user->id; $model->NAMA_HASIL = CUploadedFile::getInstance($model, 'NAMA_HASIL'); $model->NAMA_HASIL2 = CUploadedFile::getInstance($model, 'NAMA_HASIL2'); /* jika changepassword maka direct ke halaman success */ if ($model->save()) { $model->NAMA_HASIL->saveAs(Yii::app()->basePath . self::URLUPLOADHASIL . $model->NAMA_HASIL . ''); $model->NAMA_HASIL2->saveAs(Yii::app()->basePath . self::URLUPLOADHASIL . $model->NAMA_HASIL2 . ''); $this->redirect(array('akun/pesertainfo/')); } } /* render ke view ubah password */ $this->render('tambahhasil', array('model' => $model)); }
public function actionIndex() { IsAuth::Peserta(); $dataProvider = new CActiveDataProvider('Peserta'); $this->render('index', array('dataProvider' => $dataProvider)); }