/** * 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 EstadosRegistro the loaded model * @throws CHttpException */ public function loadModel($id) { $model = EstadosRegistro::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
/* @var $dataProvider CActiveDataProvider */ $this->breadcrumbs = array('Conductores' => array('index'), $model->IdConductor); //$this->menu=$this->verPermisosMenuOperaciones(); ?> <?php /* echo TbHtml::linkButton('Crear Registro', array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'method' => 'post', 'submit' => array ('conductor/create'), ));*/ ?> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">Conductores</h3> </div> <div class=" panel-body"> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'usuarios-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'IdConductor', 'htmlOptions' => array('width' => '50')), array('name' => 'NumeroDocumento', 'htmlOptions' => array('width' => '50', 'align' => 'right'), 'value' => function ($model) { return Yii::app()->format->formatNumber($model->NumeroDocumento); }), array('name' => 'PrimerNombre', 'htmlOptions' => array('width' => '50')), array('name' => 'SegundoNombre', 'htmlOptions' => array('width' => '50')), array('name' => 'PrimerApellido', 'htmlOptions' => array('width' => '50')), array('name' => 'SegundoApellido', 'htmlOptions' => array('width' => '100')), array('name' => 'EmailConductor', 'htmlOptions' => array('width' => '100')), array('name' => 'Telefono1', 'htmlOptions' => array('width' => '100')), array('name' => 'Telefono2', 'htmlOptions' => array('width' => '100')), 'IdEstadoRegistro' => array('name' => 'IdEstadoRegistro', 'htmlOptions' => array('width' => '80'), 'value' => function ($model) { return EstadosRegistro::getNombreEstado($model->IdEstadoRegistro); }, 'filter' => CHtml::listData(EstadosRegistro::model()->findAll(array('order' => 'NombreEstadoRegistro')), 'IdEstadoRegistro', 'NombreEstadoRegistro'))))); ?> </div> </div>
<?php /* @var $this MuellesController */ /* @var $dataProvider CActiveDataProvider */ $this->breadcrumbs = array('Muelles'); //$this->menu=$this->verPermisosMenuOperaciones(); ?> <?php $this->widget('zii.widgets.CBreadcrumbs', array('links' => $this->breadcrumbs, 'htmlOptions' => array('class' => 'breadcrumb'))); ?> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">Muelles</h3> </div> <div class=" panel-body"> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'muelles-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'IdMuelle', 'htmlOptions' => array('width' => '50')), array('name' => 'IdCedi', 'htmlOptions' => array('width' => '150'), 'value' => '$data->cedi->NombreCEDI'), array('name' => 'NombreMuelle', 'htmlOptions' => array('width' => '200')), array('name' => 'IdTipoMuelle', 'htmlOptions' => array('width' => '100'), 'value' => function ($model) { return TiposMuelle::getNombreTipoMuelle($model->IdTipoMuelle); }), array('name' => 'IdTipoFabricante', 'htmlOptions' => array('width' => '150'), 'value' => function ($model) { return TiposFabricante::getNombreTipoFabricante($model->IdTipoFabricante); }), array('name' => 'IdEstadoRegistro', 'htmlOptions' => array('width' => '100'), 'value' => function ($model) { return EstadosRegistro::getNombreEstado($model->IdEstadoRegistro); }), array('name' => 'MinimoPiezas', 'htmlOptions' => array('width' => '50')), array('name' => 'MaximoPiezas', 'htmlOptions' => array('width' => '50')), array('class' => 'CButtonColumn', 'htmlOptions' => array('width' => '80'))))); ?> </div> </div>
echo $form->dropDownList($model, 'IdCedi', $listaCedis, array('class' => 'form-control', 'prompt' => 'Seleccionar Cedi ... ')); ?> <?php echo $form->error($model, 'IdCedi'); ?> </div> </div> <br /> <div class="row"> <?php $listaEstadosRegistro = EstadosRegistro::getListaEstadosRegistro(); ?> <div class="col-md-3"> <?php echo $form->labelEx($model, 'IdEstadoRegistro'); ?> <?php echo $form->dropDownList($model, 'IdEstadoRegistro', $listaEstadosRegistro, array('class' => 'form-control', 'prompt' => 'Seleccionar Estado ... ')); ?> <?php echo $form->error($model, 'IdEstadoRegistro'); ?> </div>
?> <title><?php echo Yii::app()->controller->module->getName() . " >> " . $this->pageTitle; ?> </title> <?php $this->widget('zii.widgets.CBreadcrumbs', array('links' => $this->breadcrumbs, 'htmlOptions' => array('class' => 'breadcrumb'))); ?> <div class="page-header"> <h1>Catálogo Usuarios </h1> </div> <?php echo TbHtml::linkButton('Crear Registro', array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'method' => 'post', 'submit' => array('usuarios/create'))); ?> <br /><br /> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'usuarios-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'summaryText' => "Mostrando {start} – {end} de {count} resultados", 'pager' => array('header' => 'Ir a la pagina:', 'firstPageLabel' => '< <', 'prevPageLabel' => 'Anterior', 'nextPageLabel' => 'Siguiente', 'lastPageLabel' => '>>'), 'htmlOptions' => array('style' => 'word-wrap:break-word; width:1250px; font-family:"Times New Roman"'), 'columns' => array(array('name' => 'IdUsuario', 'htmlOptions' => array('width' => '50')), array('name' => 'username', 'htmlOptions' => array('width' => '50')), array('name' => 'NumeroDocumento', 'htmlOptions' => array('width' => '50', 'align' => 'right'), 'value' => function ($model) { return Yii::app()->format->formatNumber($model->NumeroDocumento); }), array('name' => 'PrimerNombre', 'htmlOptions' => array('width' => '50')), array('name' => 'SegundoNombre', 'htmlOptions' => array('width' => '50')), array('name' => 'PrimerApellido', 'htmlOptions' => array('width' => '50')), array('name' => 'SegundoApellido', 'htmlOptions' => array('width' => '100')), array('name' => 'EmailUsuario', 'htmlOptions' => array('width' => '100')), 'IdRol' => array('name' => 'IdRol', 'htmlOptions' => array('width' => '100'), 'value' => function ($model) { return Roles::getNombreRol($model->IdRol); }, 'filter' => CHtml::listData(Roles::model()->findAll(array('order' => 'NombreRol')), 'IdRol', 'NombreRol')), 'IdEstadoRegistro' => array('name' => 'IdEstadoRegistro', 'htmlOptions' => array('width' => '80'), 'value' => function ($model) { return EstadosRegistro::getNombreEstado($model->IdEstadoRegistro); }, 'filter' => CHtml::listData(EstadosRegistro::model()->findAll(array('order' => 'NombreEstadoRegistro')), 'IdEstadoRegistro', 'NombreEstadoRegistro')), array('class' => 'CButtonColumn', 'htmlOptions' => array('width' => '120')))));
public static function getNombreEstado($_Id) { $elNombreEstadoRegistro = ''; $criteria = new CDbCriteria(); $criteria->select = 'NombreEstadoRegistro'; // seleccionar solo la columna 'title' $criteria->condition = 'IdEstadoRegistro=:Id'; $criteria->params = array(':Id' => $_Id); $elEstadoRegistro = EstadosRegistro::model()->find($criteria); // $params no es necesario if ($elEstadoRegistro != null) { $elNombreEstadoRegistro = $elEstadoRegistro->NombreEstadoRegistro; } return $elNombreEstadoRegistro; }
<div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">Ver Muelle</h3> </div> <div class=" panel-body"> <div class="muelles-view"> <p> <?php echo TbHtml::linkButton('Actualizar', array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'method' => 'post', 'submit' => array('Muelles/update', 'id' => $model->IdMuelle))); ?> <?php echo TbHtml::linkButton('Eliminar', array('color' => TbHtml::BUTTON_COLOR_DANGER, 'method' => 'post', 'submit' => array('Muelles/delete', 'id' => $model->IdMuelle), 'confirm' => 'Esta seguro de eliminar este registro?')); ?> </p> <?php $this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'htmlOptions' => array('style' => 'word-wrap:break-word;"'), 'attributes' => array('IdMuelle', 'NombreMuelle', array('name' => 'IdCedi', 'value' => $model->IdCedi . ' - ' . Cedi::getNombreCedi($model->IdCedi)), array('name' => 'IdTipoMuelle', 'value' => $model->IdTipoMuelle . ' - ' . TiposMuelle::getNombreTipoMuelle($model->IdTipoMuelle)), array('name' => 'IdTipoFabricante', 'value' => $model->IdTipoFabricante . ' - ' . TiposFabricante::getNombreTipoFabricante($model->IdTipoFabricante)), array('name' => 'IdEstadoRegistro', 'value' => $model->IdEstadoRegistro . ' - ' . EstadosRegistro::getNombreEstado($model->IdEstadoRegistro)), 'HoraAlmuerzo', 'HoraRefrigerioAM', 'HoraRefrigerioPM', array('label' => 'Horario Semana', 'value' => $model->HorarioNormalAperturaSemana . ' - ' . $model->HorarioNormalCierreSemana), array('label' => 'Horario Extendido Semana', 'value' => $model->HorarioExtendidoAperturaSemana . ' - ' . $model->HorarioExtendidoCierreSemana), array('label' => 'Horario Semana', 'value' => $model->HorarioNormalAperturaSabado . ' - ' . $model->HorarioNormalCierreSabado), array('label' => 'Horario Extendido Semana', 'value' => $model->HorarioExtendidoAperturaSabado . ' - ' . $model->HorarioExtendidoCierreSabado), 'IdUsuarioGraba', 'FechaGraba', 'IdUsuarioModifica', 'FechaModifica'))); ?> </div>