/**
  * 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 Laboratorio the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Laboratorio::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Ejemplo n.º 2
0
?>

<div class="form">

<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'paciente-fotografias-form', 'enableAjaxValidation' => false));
?>

<?php 
if (isset($_GET['idPaciente'])) {
    $elPaciente = $_GET['idPaciente'];
} else {
    $elPaciente = "0";
}
$paciente = Paciente::model()->find("id={$elPaciente}");
$laboratorios = Laboratorio::model()->findAll(array("condition" => "id > 0", 'order' => 'nombre 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', 'edad')));
?>
		</div>
		<div class="span5">
			<?php 
$this->widget('zii.widgets.CDetailView', array('data' => $paciente, 'attributes' => array('email', 'telefono1', 'celular')));
?>
		</div>
		<div class="span1"></div>