/** * Creates a new TransaksiBeli model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new TransaksiBeli(); if ($model->load(Yii::$app->request->post())) { $model->tgl_beli = date('Y-m-d', strtotime($_POST['TransaksiBeli']['tgl_beli'])); $model->id_beli = $model->nomor(); if ($model->save()) { return $this->redirect(['view', 'id' => $model->id_beli]); } } else { return $this->render('create', ['model' => $model]); } }