/** * 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 CatEspecialidad the loaded model * @throws CHttpException */ public function loadModel($id) { $model = CatEspecialidad::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
echo $form->dropDownList($model, 'estatus', array('activo' => 'activo', 'inactivo' => 'inactivo')); ?> <?php //echo $form->textField($model,'estatus',array('size'=>10,'maxlength'=>10)); ?> <?php echo $form->error($model, 'estatus'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'idCategoria'); ?> <?php echo $form->dropDownList($model, 'idCategoria', CHtml::listData(CatEspecialidad::model()->findAll(), 'id', 'nombre')); ?> <?php //echo $form->textField($model,'idCategoria'); ?> <?php echo $form->error($model, 'idCategoria'); ?> </div> <!--<div class="row"> <?php echo $form->labelEx($model, 'creado_por'); ?> <?php echo $form->textField($model, 'creado_por');
<?php /* @var $this EspecialidadController */ /* @var $model Especialidad */ $this->breadcrumbs = array('Especialidades' => array('index'), 'Admin'); $this->menu = array(array('label' => 'Lista Especialidades', 'url' => array('index')), array('label' => 'Crear Especialidad', 'url' => array('create')), array('label' => 'Reporte', 'url' => array('reporte')), array('label' => 'Reporte pdf', 'url' => array('lista'))); Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$('#especialidad-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n"); ?> <h1 class="login">Admin especialidades</h1> <p> Puedes anteponer opcionalmente un operador de comparacion (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b> ó <b>=</b>) al comienzo del valor de búsqueda para especificar lo que deseas buscar. </p> <?php echo CHtml::link('Búsqueda avanzada', '#', array('class' => 'search-button')); ?> <div class="search-form" style="display:none"> <?php $this->renderPartial('_search', array('model' => $model)); ?> </div><!-- search-form --> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'especialidad-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('idEspecialidad', 'nombre', 'estatus', array('header' => 'Categoria', 'name' => 'idCategoria', 'value' => '$data->categoria->id', 'htmlOptions' => array('style' => 'text-align:center', 'width' => '180px'), 'filter' => CHtml::listData(CatEspecialidad::model()->findAll(), 'id', 'nombre')), array('class' => 'CButtonColumn'))));