/**
  * Creates a new NotulenModul model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new NotulenModul();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->ID]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
示例#2
0
 /**
  * Creates a new Notulen model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate($start, $end)
 {
     $model = new Notulen();
     // $model->scenario = Notulen::SCENARIO_NOTE;
     $model_modul = new NotulenModul();
     if ($model->load(Yii::$app->request->post())) {
         $transaction = Notulen::getDb()->beginTransaction();
         try {
             $model->start = $start;
             $model->end = $end;
             $model->CREATE_BY = self::Get_profile()->id;
             $model->CREATE_AT = date("Y-m-d H:i:s");
             $model->save();
             $model_modul->NOTULEN_ID = $model->id;
             $model_modul->save();
             // ...other DB operations...
             $transaction->commit();
         } catch (\Exception $e) {
             $transaction->rollBack();
             throw $e;
         }
         return $this->redirect(['review', 'id' => $model->id]);
     } else {
         return $this->renderAjax('create', ['model' => $model, 'data_modul' => self::getary_modul(), 'data_emp' => self::get_aryEmploye()]);
     }
 }