/** * 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 Fiador the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Fiador::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<div class="clearfix"></div> <?php } ?> <?php $fiador_rut = ""; $fiador_nombre = ""; $fiador_apellido = ""; $fiador_email = ""; $fiador_telefono = ""; $fiador_direccion = ""; $cliente_fiador = ClienteFiador::model()->findByAttributes(array('cliente_id' => $model->id)); if ($cliente_fiador != null) { $fiador = Fiador::model()->findByAttributes(array('id' => $cliente_fiador->fiador_id)); if ($fiador != null) { $fiador_rut = $fiador->rut; $fiador_nombre = $fiador->nombre; $fiador_apellido = $fiador->apellido; $fiador_email = $fiador->email; $fiador_telefono = $fiador->telefono; $fiador_direccion = $fiador->direccion; } } ?> <br/> <fieldset> <legend>Opcionalmente puede agregar un Fiador a este cliente</legend> <div class="span2"> <?php