/** * Creates a new Interview model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Interview(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->interview_id]); } else { return $this->render('create', ['model' => $model]); } }
public function actionSetting() { //$data=Yii::$app->request->post(); $data = array('interview_id' => '面试序号', 'user_id' => '面试者序号', 'interview_city' => '城市', 'interview_date' => '面试日期', 'interview_time' => '面试开始时间', 'create_time' => '创建时间', 'export_time' => '导出时间', 'notified' => '通知时间', 'status' => '预约状态'); $model = new Interview(); if ($model->load($data) && $model->save()) { return $this->redirect('success'); } else { return $this->render('setting', ['model' => $model]); } }
public function postNewInterview(LoggedInRequest $request) { $date = $request->input('date'); $hour = $request->input('hour'); $minute = $request->input('minute'); $ampm = $request->input('ampm'); $interviewDate = Carbon::createFromFormat('m/d/Y \\a\\t g:i A', $date . ' at ' . $hour . ":" . $minute . " " . $ampm); $interview = new Interview(); $interview->interviewDate = $interviewDate; $interview->location = $request->input('location'); $interview->save(); return $this->getInterviews($request); }