/** * Creates a new SopSalesHeader model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreateDetailSop($id) { $model = new SopSalesDetail(); if ($model->load(Yii::$app->request->post())) { $model->CREATE_BY = Yii::$app->user->identity->username; $model->CREATE_AT = date("Y-m-d H:i:s"); $model->SOP_ID = $id; $model->save(); return $this->redirect(['index']); } else { return $this->renderAjax('create_sop_detail', ['model' => $model, 'score' => self::ary_scoreresult()]); } }