/**
  * Creates a new ModulEvent model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new ModulEvent();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->ID]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
 public function actionSaveEvent()
 {
     if (Yii::$app->request->isAjax) {
         $request = Yii::$app->request;
         $profile = Yii::$app->getUserOpt->Profile_user();
         $tgl2 = $request->post('title');
         $modulid = $request->post('modulid');
         $tgl1 = $request->post('tgl1');
         $mdl_parent = $request->post('parent');
         // echo $title;
         $model = new ModulEvent();
         $model->MODUL_ID = $modulid;
         $model->MODUL_PRN = $mdl_parent;
         $model->start = $tgl1;
         $model->end = $tgl2;
         $model->CREATE_BY = $profile->emp->EMP_ID;
         $model->CREATE_AT = date('Y-m-d H:i:s');
         $model->USER_ID = $profile->emp->EMP_ID;
         // $model->
         $model->save();
         return true;
     }
 }