Ejemplo n.º 1
0
 public function actionAddpaymentpercentage()
 {
     $model = new PaymentToAdmin();
     if (isset($_POST['PaymentToAdmin'])) {
         //echo "<pre>";print_r($_REQUEST);die;
         $model->attributes = $_POST['PaymentToAdmin'];
         if ($model->validate()) {
             $q = $_REQUEST['PaymentToAdmin']['cost_percentage'];
             $date = date('Y-m-d');
             $model->date = $date;
             if ($model->save(false)) {
                 $this->redirect(array('paymentpercentagelisting'));
             }
         }
     } else {
         $errors = $model->getErrors();
     }
     $this->render('addpaymentpercentage', array('model' => $model));
 }