/**
  * 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 the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Scodobjventasdatos::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Beispiel #2
0
<h4>Vista #<?php 
echo $model->id_cod_obj_venta;
?>
</h4>

<div id="baseUrlActual" style="display: none;"><?php 
echo $baseUrlActual;
?>
</div>
<?php 
$this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'type' => 'striped bordered condensed', 'attributes' => array('id_cod_obj_venta', 'desc_cod_obj_venta', array('name' => 'id_clase_obj_venta', 'value' => $model->idClaseObjVenta->desc_clase_obj_venta), array('name' => 'doc_requeridos', 'value' => $model->doc_requeridos == 1 ? "Si" : "No"), 'placa_cod', 'interno_cod', array('name' => 'id_proyecto', 'value' => $model->idPersona->personaNombreCompleto), array('name' => 'id_persona', 'value' => $model->idProyecto->descripcion_proyecto), array('name' => 'activo_cod_obj_venta', 'value' => $model->activo_cod_obj_venta == 1 ? "Activo" : "Inactivo"))));
?>

<!-- Obtener informacion de los demas modelos Datos, Documentos y Caracteristicas -->
<?php 
$dataProviderDatos = Scodobjventasdatos::model()->search(array('id_cod_obj_venta' => $model->id_cod_obj_venta));
$dataProviderDocum = Scodobjventasdocs::model()->search(array('id_cod_obj_venta' => $model->id_cod_obj_venta));
$dataProviderCarac = Scodobjventascaract::model()->search(array('id_cod_obj_venta' => $model->id_cod_obj_venta));
?>


<h4>Datos Generales</h4>
<?php 
if ($dataProviderDatos->itemCount > 0) {
    ?>
	<?php 
    $this->widget('bootstrap.widgets.TbGridView', array('id' => 'scodobjventasdatos-grid', 'type' => 'striped bordered condensed', 'dataProvider' => $dataProviderDatos, 'enableSorting' => false, 'summaryText' => false, 'columns' => array('modelo', 'numero_chasis', 'marca', array('name' => 'Color', 'value' => '$data->color->color_descripcion'), 'numero_motor', array('class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{update} {delete}', 'deleteConfirmation' => 'Está seguro que desea eliminar este item?', 'buttons' => array('update' => array('label' => 'Actualizar', 'url' => 'Yii::app()->createUrl("scodobjventasdatos/update", array("id"=>$data->id))'), 'delete' => array('label' => 'Eliminar', 'url' => 'Yii::app()->createUrl("scodobjventasdatos/delete", array("id"=>$data->id))'))))));
    ?>

<?php 
} else {