
<?php
/* @var $this TransferenciaController */
/* @var $model Transferencia */


Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});

$('.search-form form').submit(function(){
	$('#transferencia-grid').yiiGridView('update', {
		data: $(this).serialize()
	});

	return false;
});
");
?>

<div class="row">
  
    <div class="col-12  col-sm-12 col-md-3"  style="margin-left: 23px;">
        <?php
        $pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']);
        echo
        'Ver ' .
         CHtml::dropDownList('pageSize', $pageSize, Utility::listaPageSize(), array(
            'class'=>'p-2 border-primary text-primary',
            'onchange' => "$.fn.yiiGridView.update('pagos-grid',{ data:{pageSize: $(this).val() }})",
        ))
         . ' Registros';
        ?>
    </div> 
    
    
    <div class="col-12  col-sm-12 col-md-8 text-right"  style="margin-right: 25px;" >
         
    <?php
    echo CHtml::link('<i class="fa fa-plus fa-lg"></i>  AGREGAR RENDICION', 
             Yii::app()->createUrl('transferencia/create'), 
             array('class'=>'btn btn-primary',
                 'data-toggle' => "tooltip",
                 'data-original-title' => 'AGREGAR RENDICION',
                 )); 
     ?> 

    <?php 
    echo CHtml::link('<i class="fa fa-file-pdf fa-lg"></i> EXCEL', 
             Yii::app()->createUrl('transferencia/excel'), 
             array('class'=>'btn btn-success',
                 'data-toggle' => "tooltip",
                 'data-original-title' => 'EXPORTAR A EXCEL',
                 'style'=>'background-color:#066100;'
                 
                 )); 
    
     ?> 
   <?php echo CHtml::link('<i class="fa fa-search fa-lg"></i> BUSCAR', 
             '#', 
             array('class'=>'btn btn-info search-button',
                 'data-toggle' => "tooltip",
                 'data-original-title' => 'BUSCAR',
                 'style'=>'background-color:#6F9AF7 ;'

                 )); 
     ?> 
     <?php echo CHtml::link('<i class="fas fa-sync fa-lg"></i>', 
             '#', 
             array('class'=>'btn btn-danger',
                 'onClick' => 'window.location="' . Yii::app()->createUrl('transferencia') . '"; ',
                 'data-toggle' => "tooltip",
                 'data-original-title' => 'REFRESCAR LISTA'
                 )); 
     ?>   
    </div>
</div>

<div class="col-12 p-4">
        <div class="search-form" style="display:none">
        <?php 
        $this->renderPartial('_search',array('model'=>$model,)); 
        ?>
        </div>
</div>

<div class='table-responsive'>   
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'transferencia-grid',
	'dataProvider'=>$model->search(),
        'pager' => array('cssFile' => Yii::app()->baseUrl.'/public/css/tablas.css'),
	'filter'=>$model,
	'columns'=>array(
                array(
                    'filter'=>false,
                    'header'=>'ID',
                    'name' => 'id_transferencia',
                    'value' => '$data->id_transferencia',
                    'type' => 'text',
                    'htmlOptions' => array('class' => 'text-center'),
                ),
                array(
                    'name' => 'fecha',
                    'value' => 'Utility::fecha($data->fecha)',
                    'type' => 'text',
                    'htmlOptions' => array('class' => 'text-center'),
                ),
                array(
                    'name' => 'responsable',
                    'value' => '$data->responsable',
                    'type' => 'text',
                    'htmlOptions' => array('class' => 'text-center'),
                ),
		/*'fecha',
		'responsable',
		'transferencia',
		'cobranza',
		'total',
		'credito_nuevo',
		'renovacion',
		'desc_banco',
		'otro_gasto',
		'debe_depositar',
		'borrado',
		*/
		array(
                  'header' => 'ACCION',
                  'class' => 'CButtonColumn',
                  'deleteButtonImageUrl' => false,
                  'updateButtonImageUrl' => false,
                  'viewButtonImageUrl' => false,
                  'htmlOptions' => array('width' => '100', 'class' => 'text-center'),
                  'template' => '{view}{update}{delete}',
                  'buttons' => array(
                      'view' => array(
                          'label' => ' ',
                          'options' => array(
                              'class' => 'mdi mdi-18px mdi-eye m-r-10',
                              'title' => 'VER',
                          ),
                          'visible' => 'true',
                      ),
                        'update' => array(
                          'label' => ' ',
                          'options' => array(
                              'class' => 'mdi mdi-18px mdi-pencil m-r-10',
                              'title' => 'ACTUALIZAR',
                          ),
                          'visible' => 'true',
                      ),
                        'delete' => array(
                            'label' => ' ',
                            'options' => array(
                                'class' => 'mdi mdi-18px mdi-trash-can-outline m-r-10',
                                'title' => 'ELIMINAR',
                          ),
                            'visible' => 'true',
                      ),
                  )
              ),
	),
)); ?>
</div>  