public function actionAdmin() { $model = new RegistroFactura('search'); $model->unsetAttributes(); if (isset($_GET['RegistroFactura'])) { $model->setAttributes($_GET['RegistroFactura']); } $this->render('admin', array('model' => $model)); }
public function actionACRf() { if (isset($_GET['term'])) { $searchTerm = $_GET['term']; $result = array(); $getrfs = RegistroFactura::model()->findAll('nro_factura LIKE :nro_factura', array(':nro_factura' => '%' . $searchTerm . '%')); foreach ($getrfs as $getrf) { $result[] = array('label' => $getrf->nro_factura, 'value' => $getrf->nro_factura, 'id' => $getrf->id); } echo CJSON::encode($result); } }
<?php $this->breadcrumbs = array(RegistroFactura::label(2), Yii::t('app', 'Index')); $this->menu = array(array('label' => Yii::t('app', 'Agregar') . ' ' . RegistroFactura::label(), 'url' => array('create')), array('label' => Yii::t('app', 'Administrar') . ' ' . RegistroFactura::label(2), 'url' => array('admin'))); ?> <h1><?php echo GxHtml::encode(RegistroFactura::label(2)); ?> </h1> <?php $this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view', 'summaryText' => 'Mostrando del {start} al {end} de {count} resultado(s).', 'pager' => array('header' => '', 'prevPageLabel' => 'Anterior', 'nextPageLabel' => 'Siguiente')));
<div class="row"> <?php echo $form->label($model, 'id_vehiculo'); ?> <?php echo $form->dropDownList($model, 'id_vehiculo', GxHtml::listDataEx(Vehiculos::model()->findAllAttributes(null, true, $criteria)), array('prompt' => Yii::t('app', 'All'))); ?> </div> <div class="row"> <?php echo $form->label($model, 'id_rf'); ?> <?php echo $form->dropDownList($model, 'id_rf', GxHtml::listDataEx(RegistroFactura::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All'))); ?> </div> <div class="row"> <?php echo $form->label($model, 'fecha'); ?> <?php $form->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'fecha', 'language' => 'es', 'value' => $model->fecha, 'options' => array('showButtonPanel' => true, 'changeYear' => true, 'dateFormat' => 'yy-mm-dd'))); ?> </div> <div class="row"> <?php echo $form->label($model, 'kilometraje');
<?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('orden-trabajo-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 $criteria = new CDbCriteria(); $criteria->order = 'patente ASC'; $this->widget('zii.widgets.grid.CGridView', array('id' => 'orden-trabajo-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('nro_guia', array('name' => 'id_vehiculo', 'value' => 'GxHtml::valueEx($data->idVehiculo)', 'filter' => GxHtml::listDataEx(Vehiculos::model()->findAllAttributes(null, true, $criteria))), array('name' => 'id_rf', 'value' => 'GxHtml::valueEx($data->idRf)', 'filter' => GxHtml::listDataEx(RegistroFactura::model()->findAllAttributes(null, true))), 'fecha', 'kilometraje', array('header' => 'Subtotal', 'value' => 'OrdenTrabajo::formatearPeso($data->sumita)', 'htmlOptions' => array('width' => '100')), array('class' => 'CButtonColumn', 'header' => 'Opciones', 'htmlOptions' => array('width' => 120), 'template' => '{view}{update}{delete}', 'buttons' => array('view' => array('label' => 'Ver', 'url' => 'Yii::app()->createUrl("ordentrabajo/view", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/ver.png'), 'update' => array('label' => 'Editar', 'url' => 'Yii::app()->createUrl("ordentrabajo/update", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/editar.png'), 'delete' => array('label' => 'Borrar', 'url' => 'Yii::app()->createUrl("ordentrabajo/delete", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/delete.png'))))));