/** * Creates a new Scheduledetail model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Scheduledetail(); 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 actionSetOutCase($tgl, $userid, $group, $grpid, $username) { $model = new Scheduledetail(); if ($model->load(Yii::$app->request->post())) { $model->USER_ID = $userid; $model->SCDL_GROUP = $group; $model->CREATE_AT = date('Y-m-d'); $model->CREATE_BY = Yii::$app->user->identity->username; $model->STATUS_CASE = 1; $model->save(); return $this->redirect(['index?tab=3']); } else { return $this->renderAjax('_setoutcase', ['model' => $model, 'user' => $username, 'tgl' => $tgl, 'group' => $grpid, 'cus' => self::ary_customers(), 'note' => self::get_aryUserSalesmanager()]); } }