/** * 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 Egresos the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Egresos::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<?php /* @var $this EgresosController */ /* @var $model Egresos */ $this->menu = array(array('label' => 'Buscar Egresos', 'url' => array('admin'))); //Calcular proximo numero de compra $proxima = new Egresos(); $criteria = new CDbCriteria(); $criteria->select = 'max(id) AS id'; $row = $proxima->model()->find($criteria); $elid = $row['id'] + 1; ?> <h1>Crear Egreso #<?php echo $elid; ?> </h1> <?php $this->renderPartial('_form', array('model' => $model));
<?php //Detalles $numEgresos = $_GET['id']; $elEgresos = Egresos::model()->findByPk($numEgresos); ?> <style type="text/css"> #cuerpo{ font-size: 70%; } p{ margin: 2px 0px; } </style> <body> <div id="cuerpo"> <table> <tr> <td width="80"> <img src="images/logo_menbrete.jpg" alt="" height="90"> </td> <td width="250"> <p style="text-align: center;">CALLE 87 N° 47 - 47</p> <p style="text-align: center;">PBX 3177190</p> <p style="text-align: center;">BARRANQUILLA - COLOMBIA</p> </td> </tr> <tr>