/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return MedicamentosBiologicos the loaded model * @throws CHttpException */ public function loadModel($id) { $model = MedicamentosBiologicos::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
$nCiclo = $losCiclos; } } else { if ($model->id == "") { $nCiclo = $losCiclos + 1; } else { $nCiclo = $losCiclos; } } } } //Calculo de Edad $anio_nacimiento = Yii::app()->dateformatter->format("yyyy", $paciente->fecha_nacimiento); $edadpaciente = date("Y") - $anio_nacimiento; //array('name'=>'Edad', 'value'=>$edadpaciente, ''), $medicamentos = MedicamentosBiologicos::model()->findAll(array("condition" => "id > 0", 'order' => 'medicamento asc')); ?> <div class="row"> <h4 class="text-center">Datos de Paciente</h4> <div class="span1"></div> <div class="span5"> <?php $this->widget('zii.widgets.CDetailView', array('data' => $paciente, 'attributes' => array('nombreCompleto', 'n_identificacion', array('name' => 'Edad', 'value' => $edadpaciente, '')))); ?> </div> <div class="span5"> <?php $this->widget('zii.widgets.CDetailView', array('data' => $paciente, 'attributes' => array('email', 'telefono1', 'celular'))); ?> </div> <div class="span1"></div>