public function actionHistoria($id) { $model_historia = $this->loadModel($id); $model_historiaO_paciente = HistoriaObstetricia::model()->getHistoriasObstetriciaByPaciente($model_historia->paciente->id); $model_historiaG_paciente = HistoriaGinecologia::model()->getHistoriasGinecologicasByPaciente($model_historia->paciente->id); $historia = array($model_historiaG_paciente, $model_historiaO_paciente); $this->render('historia', array('model' => $model_historia->paciente->id, 'historia' => $historia)); }
/** * Updates a particular model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id the ID of the model to be updated */ public function actionUpdate($id) { $modelGineco = $this->loadModel($id); $model_historia_paciente = HistoriaGinecologia::model()->getHistoriasGinecologicasByPaciente($modelGineco->paciente->id); // Uncomment the following line if AJAX validation is needed $this->performAjaxValidation($modelGineco); if (isset($_POST['HistoriaGinecologia'])) { $ginecologiaEnfermedadsOLD = $modelGineco->ginecologiaEnfermedads; $modelGineco->attributes = $_POST['HistoriaGinecologia']; if ($modelGineco->save()) { $modelGineco->updateMtM($modelGineco->relData, $modelGineco->id, $modelGineco->ginecologiaEnfermedads, $ginecologiaEnfermedadsOLD); $this->redirect(array('view', 'id' => $modelGineco->id)); } //$this->redirect(array('/dashboard/index','id' => $modelGineco->paciente_id,'opt' => $this->id),true); } $this->render('update', array('modelGineco' => $modelGineco, 'model_historia_paciente' => $model_historia_paciente)); }