/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new Pengeluaran(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Pengeluaran'])) { $model->attributes = $_POST['Pengeluaran']; $model->created_at = date('Y-m-d H:i:s'); if ($model->save()) { $this->redirect(array('view', 'id' => $model->id_pengeluaran)); } } $this->render('create', array('model' => $model)); }
/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'ubah' page. */ public function actionTambah() { $model = new Pengeluaran(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Pengeluaran'])) { $model->attributes = $_POST['Pengeluaran']; if ($model->save()) { $this->redirect(array('ubah', 'id' => $model->id)); } } $profil = new Profil('search'); $profil->unsetAttributes(); // clear any default values if (isset($_GET['Profil'])) { $profil->attributes = $_GET['Profil']; } $this->render('tambah', array('model' => $model, 'profil' => $profil)); }