Ejemplo n.º 1
0
 /**
  * Creates a new Pembukuan model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Pembukuan();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->ID]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
Ejemplo n.º 2
0
 public function actionSimpan()
 {
     if (!Yii::$app->user->isGuest) {
         $model = new Pembukuan();
         $nw = Yii::$app->esmcode->kode_ref();
         //print_r($nw);
         //die();
         if ($model->load(Yii::$app->request->post())) {
             $model->SRC_DSC_REF = $nw;
             $model->SRC = Yii::$app->user->identity->warga;
             $model->CREATED_BY = Yii::$app->user->identity->username;
             $model->CREATED_AT = date('Y-m-d H:i:s');
             $model->save();
             return $this->redirect(['index']);
         } else {
             return ActiveForm::validate($model);
         }
     }
 }