Example #1
0
 /**
  * Creates a new Tmaster model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Tmaster();
     if ($model->load(Yii::$app->request->post())) {
         $model->datecreated = date('Y-m -d');
         //$models->tgllhpsp = x1 ;
         // $models->tglbc11 = x2 ;
         // if x1>x2
         if ($model->validate() and $model->save()) {
         }
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->renderAjax('create', ['model' => $model]);
     }
 }