/** * Creates a new EntriSheetDtl model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new EntriSheetDtl(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id_esheet' => $model->id_esheet, 'id_coa' => $model->id_coa]); } else { return $this->render('create', ['model' => $model]); } }
/** * Updates an existing EntriSheet 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); $dval = Yii::$app->request->post(); if (isset($dval['EntriSheetDtl'])) { $modelDtl = new EntriSheetDtl(); $modelDtl->load($dval); if (!$modelDtl->save()) { print_r($modelDtl->errors); } } if (isset($dval['EntriSheet']) && $model->load($dval) && $model->save()) { return $this->redirect(['view', 'id' => $model->id_esheet]); } else { return $this->render('update', ['model' => $model]); } }