
<?php
/* @var $this EmpleadoController */
/* @var $model Empleado */
?>







<div class="row">
    <div class="col-12 col-sm-12 col-md-3 ">
        <?php
        $pageSize = Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']);
        echo
        'Ver ' .
         CHtml::dropDownList('pageSize', $pageSize, Utility::listaPageSize(), array(
            'onchange' => "$.fn.yiiGridView.update('empleado-grid',{ data:{pageSize: $(this).val() }})",
        ))
         . ' Registros';
        ?>
    </div> 
    
    <div class="col-12 col-sm-12 col-md-3 ">
        <?php
                     $this->widget('booster.widgets.TbButton', array(
                        'context'=>'primary',
                         'label'=>'AGREGAR',
                         'buttonType' => 'link',
                         'icon' => 'fa fa-plus fa-lg',
                         'url'=>Yii::app()->createUrl('empleado/create'),
                          'htmlOptions' => array(
                                                'data-toggle' => "tooltip",
                                                'data-original-title' => 'AGREGAR',
                                                'class'=>'btn btn-block btn-primary'
                                            ),  
                     ));
                     ?>  
        </div>
        
        <div class="col-12 col-sm-12 col-md-3 ">
                       <?php
                        $this->widget('booster.widgets.TbButton', array(
                        'context'=>'success',
                         'buttonType' => 'link',
                         'label'=>'EXCEL',
                         'icon' => 'fa fa-file-excel fa-lg',
                         'url' => Yii::app()->createUrl('empleado/excel'),
                          'htmlOptions' => array(
                                                'data-toggle' => "tooltip",
                                                'data-original-title' => 'EXPORTAR A EXCEL',
                                                'class'=>'btn btn-block btn-success',
                                              
                                                ),  
                         ));
                         ?>   
        </div>  
             
        <div class="col-12 col-sm-12 col-md-3 ">


                         <?php
                         $this->widget('booster.widgets.TbButton', array(
                        'context'=>'danger',
                         'buttonType' => 'link',
                             
                              'label' => ' REFRESCAR',
                                            'icon' => 'fas fa-redo-alt',
                                            'htmlOptions' => array(
                                                'class'=>'text-capitalize',
                                                'data-toggle' => "tooltip",
                                                'data-original-title' => 'REFRESCAR LISTA',
                                                'onClick' => 'window.location="' . Yii::app()->createUrl('empleado') . '"; ',
                                                'class'=>'btn btn-block btn-danger'
                                            ),
                                              'url' => '#',
                     ));
                     ?>        
            </div>
    </div>
    

<div class='table-responsive '>   
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'empleado-grid',
	'dataProvider'=>$model->search(),
        'pager' => array('cssFile' => Yii::app()->baseUrl.'/public/css/tablas.css'),
	'filter'=>$model,
	'columns'=>array(
            
                array(
                'header'=>'ID',  
                'value' => '$data->id_empleado',
                'type' => 'text',
                'name' => 'id_empleado',
                'htmlOptions' => array('class' => 'text-center'),
                ),
                array(
                'header'=>'DNI',  
                'value' => '$data->dni',
                'type' => 'text',
                'name' => 'dni',
                'htmlOptions' => array('class' => 'text-center'),
                ),
                array(
                'header'=>'NOMBRES',  
                'value' => '$data->nombre',
                'type' => 'text',
                'name' => 'nombre',
                'htmlOptions' => array('class' => 'text-center'),
                ),
                array(
                'header'=>'APELLIDOS',  
                'value' => '$data->apellido',
                'type' => 'text',
                'name' => 'apellido',
                'htmlOptions' => array('class' => 'text-center'),
                ),
            
		array(
                   'header' =>'FOTO',
                    'filter' =>false,
                    'value' => 'CHtml::link(CHtml::image(Yii::app()->request->baseUrl."/upload/".$data->foto,"", array("width" =>"25")),Yii::app()->request->baseUrl."/upload/".$data->foto, array("target"=>"_blank"))  ',
                    'type' => 'raw',
                    'name' => 'foto',
                    'htmlOptions' => array( 'class' => 'text-center'),
                ),
        
		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 text-primary',
                              'title' => 'VER',
                          ),
                          'visible' => 'true',
                      ),
                        'update' => array(
                          'label' => ' ',
                          'options' => array(
                              'class' => 'mdi mdi-18px mdi-pencil m-r-10 text-primary',
                              'title' => 'ACTUALIZAR',
                          ),
                          'visible' => 'true',
                      ),
                        'delete' => array(
                            'label' => ' ',
                            'options' => array(
                                'class' => 'mdi mdi-18px mdi-trash-can-outline m-r-10 text-primary',
                                'title' => 'ELIMINAR',
                          ),
                            'visible' => 'true',
                      ),
                  )
              ),
	),
)); ?>
</div> 