コード例 #1
0
 /**
  * @Author: ANH DUNG Dec 02, 2014
  * @Todo: TENANCIES approve status
  */
 public function actionApproveTenancy($id)
 {
     $model = $this->loadModel($id);
     $this->layout = 'ajax';
     $model->scenario = "ApproveTenancy";
     if (isset($_POST['ProTransactions'])) {
         $model->attributes = $_POST['ProTransactions'];
         $model->validate();
         if (!$model->hasErrors()) {
             if ($model->status == STATUS_TENANCY_APPROVE) {
                 ProTransactions::UpdateTenancyStatus($model, $model->status);
             }
             die('<script type="text/javascript">parent.$.fn.colorbox.close(); parent.$.fn.yiiGridView.update("pro-transactions-grid");</script>');
         }
     }
     $this->render('ApproveTenancy', array('model' => $model, 'actions' => $this->listActionsCanAccess));
 }