コード例 #1
0
 public function actionAdmin()
 {
     $model = new CargosEmpresa('search');
     $model->unsetAttributes();
     if (isset($_GET['CargosEmpresa'])) {
         $model->setAttributes($_GET['CargosEmpresa']);
     }
     $this->render('admin', array('model' => $model));
 }
コード例 #2
0
ファイル: _form.php プロジェクト: dev-lav/htdocs
		<?php 
echo $form->labelEx($model, 'apellido_mat');
?>
		<?php 
echo $form->textField($model, 'apellido_mat', array('maxlength' => 50));
?>
		<?php 
echo $form->error($model, 'apellido_mat');
?>
		</div><!-- row -->
                <?php 
$criteria = new CDbCriteria();
$criteria->order = 'nombre ASC';
?>
		<div class="row">
		<?php 
echo $form->labelEx($model, 'id_cargo_empresa');
?>
		<?php 
echo $form->dropDownList($model, 'id_cargo_empresa', GxHtml::listDataEx(CargosEmpresa::model()->findAllAttributes(null, true, $criteria)));
?>
		<?php 
echo $form->error($model, 'id_cargo_empresa');
?>
		</div><!-- row -->

<?php 
echo GxHtml::submitButton(Yii::t('app', 'Guardar'), array('class' => 'boton'));
$this->endWidget();
?>
</div><!-- form -->
コード例 #3
0
ファイル: _search.php プロジェクト: dev-lav/htdocs
	<div class="row">
		<?php 
echo $form->label($model, 'apellido_mat');
?>
		<?php 
echo $form->textField($model, 'apellido_mat', array('maxlength' => 50));
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'id_cargo_empresa');
?>
		<?php 
echo $form->dropDownList($model, 'id_cargo_empresa', GxHtml::listDataEx(CargosEmpresa::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All')));
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'creado');
?>
		<?php 
echo $form->textField($model, 'creado');
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'modificado');
コード例 #4
0
ファイル: admin.php プロジェクト: dev-lav/htdocs
<?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('personal-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' => 'personal-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'emptyText' => 'No hay resultados', 'summaryText' => 'Mostrando del {start} al {end} de {count} resultado(s).', 'pager' => array('header' => '', 'prevPageLabel' => 'Anterior', 'nextPageLabel' => 'Siguiente'), 'columns' => array('rut', 'nombre', 'apellido_pat', 'apellido_mat', array('name' => 'id_cargo_empresa', 'value' => 'GxHtml::valueEx($data->idCargoEmpresa)', 'filter' => GxHtml::listDataEx(CargosEmpresa::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("personal/view", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/ver.png'), 'update' => array('label' => 'Editar', 'url' => 'Yii::app()->createUrl("personal/update", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/editar.png'), 'delete' => array('label' => 'Borrar', 'url' => 'Yii::app()->createUrl("personal/delete", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/delete.png'))))));
コード例 #5
0
ファイル: index.php プロジェクト: dev-lav/htdocs
<?php

$this->breadcrumbs = array(CargosEmpresa::label(2), Yii::t('app', 'Index'));
$this->menu = array(array('label' => Yii::t('app', 'Agregar') . ' ' . CargosEmpresa::label(), 'url' => array('create')), array('label' => Yii::t('app', 'Administrar') . ' ' . CargosEmpresa::label(2), 'url' => array('admin')));
?>

<h1><?php 
echo GxHtml::encode(CargosEmpresa::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'));