public function actionUpdateEngage() { try { $this->pageTitle = 'Update Engage - ' . Yii::app()->params['title']; $this->layout = 'application.views.layouts.ajax'; $model = ProEngageUs::model()->findByPk($_GET['engage_id']); $model->scenario = 'engage'; if (isset($_POST['ProEngageUs'])) { $model->attributes = $_POST['ProEngageUs']; if ($model->validate()) { if (!$model->getErrors()) { if ($model->save('price', 'remark')) { Yii::app()->user->setFlash('success', "Your Engage has been sended!"); $model->price = ''; $model->remark = ''; $model->termandcondition = 0; die('<script type="text/javascript">parent.$.fancybox.close(); parent.fnUpdateGridView("#list-engage-grid"); </script>'); } } } } $this->render('engageus', array('model' => $model)); } catch (Exception $exc) { echo $exc->getMessage(); } }