Ejemplo n.º 1
0
 /**
  * @Author: ANH DUNG Jul 29, 2014
  * @Todo: TENANCIES MANAGEMENT
  */
 public function actionApproveTransaction($id)
 {
     $model = $this->loadModel($id);
     $model->scenario = "ApproveTransaction";
     $this->layout = 'ajax';
     if (isset($_POST['ProTransactions'])) {
         $model->attributes = $_POST['ProTransactions'];
         $model->validate();
         if (!$model->hasErrors()) {
             if ($model->admin_approved) {
                 ProTransactions::UpdateAdminStatus($model, $model->admin_approved);
                 ProTransactionsInvoice::AutoGenInvoice($model);
             }
             die('<script type="text/javascript">parent.$.fn.colorbox.close(); parent.$.fn.yiiGridView.update("pro-transactions-grid");</script>');
         }
     }
     $this->render('ApproveTransaction', array('model' => $model, 'actions' => $this->listActionsCanAccess));
 }