Exemple #1
0
 public function actionAjaxUpdate()
 {
     $model = new Pay();
     $val1 = $_POST['val_id'];
     sscanf($val1, "js:_id=%d;_exp=%d;", $id, $exp);
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Pay'])) {
         $model->attributes = $_POST['Pay'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
         //				$this->redirect(array('admin'));
     }
     $row = $model->with('exp')->findByAttributes(array('id' => $id, 'exp_id' => $exp));
     if (!($row == null)) {
         echo $this->renderPartial('_form', array('model' => $model));
     }
 }