public function actionAdmin() { $model = new AreasEmpresa('search'); $model->unsetAttributes(); if (isset($_GET['AreasEmpresa'])) { $model->setAttributes($_GET['AreasEmpresa']); } $this->render('admin', array('model' => $model)); }
echo $form->errorSummary($model); ?> <div class="row"> <?php echo $form->labelEx($model, 'nombre'); ?> <?php echo $form->textField($model, 'nombre', array('maxlength' => 40, 'size' => '50')); ?> <?php echo $form->error($model, 'nombre'); ?> </div><!-- row --> <div class="row"> <?php echo $form->labelEx($model, 'id_area_empresa'); ?> <?php echo $form->dropDownList($model, 'id_area_empresa', GxHtml::listDataEx(AreasEmpresa::model()->findAllAttributes(null, true))); ?> <?php echo $form->error($model, 'id_area_empresa'); ?> </div><!-- row --> <?php echo GxHtml::submitButton(Yii::t('app', 'Guardar'), array('class' => 'boton')); $this->endWidget(); ?> </div><!-- form -->
<?php $this->breadcrumbs = array($model->label(2) => array('index'), Yii::t('app', 'Administrar')); $this->menu = array(array('label' => Yii::t('app', 'Listar') . ' ' . $model->label(2), 'url' => array('index')), array('label' => Yii::t('app', 'Agregar') . ' ' . $model->label(), 'url' => array('create'))); 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\$.fn.yiiGridView.update('cargos-empresa-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n"); ?> <h1><?php echo Yii::t('app', 'Administrar') . ' ' . GxHtml::encode($model->label(2)); ?> </h1> <?php echo GxHtml::link(Yii::t('app', 'Busqueda 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' => 'cargos-empresa-grid', 'dataProvider' => $model->search(), 'emptyText' => 'No hay resultados', 'summaryText' => 'Mostrando del {start} al {end} de {count} resultado(s).', 'pager' => array('header' => '', 'prevPageLabel' => 'Anterior', 'nextPageLabel' => 'Siguiente'), 'filter' => $model, 'columns' => array('nombre', array('name' => 'id_area_empresa', 'value' => 'GxHtml::valueEx($data->idAreaEmpresa)', 'filter' => GxHtml::listDataEx(AreasEmpresa::model()->findAllAttributes(null, true))), array('class' => 'CButtonColumn', 'header' => 'Opciones', 'htmlOptions' => array('width' => 120), 'template' => '{view}{update}{delete}', 'buttons' => array('view' => array('label' => 'Ver', 'url' => 'Yii::app()->createUrl("cargosempresa/view", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/ver.png'), 'update' => array('label' => 'Editar', 'url' => 'Yii::app()->createUrl("cargosempresa/update", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/editar.png'), 'delete' => array('label' => 'Borrar', 'url' => 'Yii::app()->createUrl("cargosempresa/delete", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/delete.png'))))));
<?php $this->breadcrumbs = array(AreasEmpresa::label(2), Yii::t('app', 'Index')); $this->menu = array(array('label' => Yii::t('app', 'Agregar') . ' ' . AreasEmpresa::label(), 'url' => array('create')), array('label' => Yii::t('app', 'Administrar') . ' ' . AreasEmpresa::label(2), 'url' => array('admin'))); ?> <h1><?php echo GxHtml::encode(AreasEmpresa::label(2)); ?> </h1> <?php $this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'emptyText' => 'No hay resultados', 'summaryText' => 'Mostrando del {start} al {end} de {count} resultado(s).', 'pager' => array('header' => '', 'prevPageLabel' => 'Anterior', 'nextPageLabel' => 'Siguiente'), 'itemView' => '_view'));
<div class="row"> <?php echo $form->label($model, 'nombre'); ?> <?php echo $form->textField($model, 'nombre', array('maxlength' => 30)); ?> </div> <div class="row"> <?php echo $form->label($model, 'id_area_empresa'); ?> <?php echo $form->dropDownList($model, 'id_area_empresa', GxHtml::listDataEx(AreasEmpresa::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All'))); ?> </div> <div class="row buttons"> <?php echo GxHtml::submitButton(Yii::t('app', 'Buscar')); ?> </div> <?php $this->endWidget(); ?> </div><!-- search-form -->