public function fnAddProperty() { if (isset($_GET['row_number'])) { $this->layout = 'ajax'; $model = new FiInvoiceDetail('AddProperty'); if (isset($_POST['FiInvoiceDetail'])) { $model->attributes = $_POST['FiInvoiceDetail']; if ($model->save()) { $returnVal = array(); $returnVal[] = array('id' => $model->id, 'row_number' => $_GET['row_number'], 'description' => $model->description); $json = CJSON::encode($returnVal); die("<script type='text/javascript'>parent.\$.fn.colorbox.close(); parent.fnUpdateAddProperty('{$json}');</script>"); } } $this->render('AddProperty', array('model' => $model, 'actions' => $this->listActionsCanAccess)); die; } }