/** * Updates an existing ClnTranInj model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed */ public function actionUpdate($id) { $model = $this->findModel($id); $modelClnDiagnose = ClnDiagnose::findOne(['TRAN_INJ_GEN_NO' => $id]); $sportItems = ArrayHelper::map(ClnSport::find()->all(), 'SPORT_GEN_NO', 'SPORT_NAME'); $causeItems = ArrayHelper::map(ClnCauseInj::find()->all(), 'CAUSE_GEN_NO', 'CAUSE_NAME'); $bondItems = ArrayHelper::map(ClnBoundaryInj::find()->all(), 'BOND_GEN_NO', 'BOND_NAME'); $searchClnMedicineTestSearchModel = new \app\models\ClnMedicineTestSearch(); $queryParams = array(); $queryParams = Yii::$app->request->queryParams; $queryParams['ClnMedicineTestSearch']['TRAN_INJ_GEN_NO'] = $id; $dataClnMedicineTestProvider = $searchClnMedicineTestSearchModel->search($queryParams); //Yii::$app->request->queryParams); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->TRAN_INJ_GEN_NO]); } else { return $this->render('update', ['model' => $model, 'modelClnDiagnose' => $modelClnDiagnose, 'sportItems' => $sportItems, 'causeItems' => $causeItems, 'bondItems' => $bondItems, 'searchClnMedicineTestSearchModel' => $searchClnMedicineTestSearchModel, 'dataClnMedicineTestProvider' => $dataClnMedicineTestProvider]); } }
/** * Updates an existing ClnTranInjTest model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed */ public function actionUpdate($id) { $model = $this->findModel($id); //$modelClnDiagnose = ClnDiagnose::findOne(['TRAN_INJ_GEN_NO' => $id]); //$sportItems = ArrayHelper::map(ClnSport::find()->all(),'SPORT_GEN_NO','SPORT_NAME') ; //$causeItems = ArrayHelper::map(ClnCauseInj::find()->all(),'CAUSE_GEN_NO','CAUSE_NAME') ; //$bondItems = ArrayHelper::map(ClnBoundaryInj::find()->all(),'BOND_GEN_NO','BOND_NAME') ; $clnRegisterModel = ClnRegister::findOne(['REGISTER_GEN_NO' => $model->REGISTER_GEN_NO]); $searchClnMedicineTestSearchModel = new \app\models\ClnMedicineTestSearch(); $queryParams = array(); $queryParams = Yii::$app->request->queryParams; $queryParams['ClnMedicineTestSearch']['TRAN_INJ_GEN_NO'] = $id; $dataClnMedicineTestProvider = $searchClnMedicineTestSearchModel->search($queryParams); //Yii::$app->request->queryParams); $searchClnTranInjRespSearchModel = new \app\models\ClnTranInjRespSearch(); $queryParams = array(); $queryParams = Yii::$app->request->queryParams; $queryParams['ClnTranInjRespSearch']['TRAN_INJ_GEN_NO'] = $id; $dataClnTranInjRespProvider = $searchClnTranInjRespSearchModel->search($queryParams); //Yii::$app->request->queryParams); //if ($model->load(Yii::$app->request->post()) && $model->save()) { // return $this->redirect(['view', 'id' => $model->TRAN_INJ_GEN_NO]); if ($model->load(Yii::$app->request->post())) { if ($model->save()) { $data['result'] = 'success'; $data['result_desc'] = print_r(Yii::$app->request->post(), 1); } else { $data['result'] = 'error'; } header('Content-type: application/json'); echo json_encode($data); } else { return $this->render('update', ['model' => $model, 'clnRegisterModel' => $clnRegisterModel, 'searchClnMedicineTestSearchModel' => $searchClnMedicineTestSearchModel, 'dataClnMedicineTestProvider' => $dataClnMedicineTestProvider, 'searchClnTranInjRespSearchModel' => $searchClnTranInjRespSearchModel, 'dataClnTranInjRespProvider' => $dataClnTranInjRespProvider]); } }