
<?php
/* @var $this CargoController */
/* @var $model Cargo */
?>


<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('cargo-grid',{ data:{pageSize: $(this).val() }})",
        ))
         . ' Registros';
        ?>
    </div> 
    <div class="col-12 col-sm-12 col-md-3 "></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('cargo/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'=>'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('cargo') . '"; ',
                                                'class'=>'btn btn-block btn-danger'
                                            ),
                                              'url' => '#',
                     ));
                     ?>        
            </div>
    </div>

<div class='table-responsive'>   
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'cargo-grid',
	'dataProvider'=>$model->search(),
        'pager' => array('cssFile' => Yii::app()->baseUrl.'/public/css/tablas.css'),
	'filter'=>$model,
	'columns'=>array(
            
                array(
                'header'=>'ID',  
                'value' => '$data->id_cargo',
                'type' => 'text',
                'name' => 'id_cargo',
                'htmlOptions' => array('class' => 'text-center'),
                ),
                array(
                'header'=>'CARGO',  
                'value' => '$data->descripcion',
                'type' => 'text',
                'name' => 'descripcion',
                'htmlOptions' => array('class' => 'text-center'),
                ),
   
		
		array(
                  'header' => 'ACCION',
                  'class' => 'CButtonColumn',
                  'deleteButtonImageUrl' => false,
                  'updateButtonImageUrl' => false,
                  'htmlOptions' => array('width' => '100', 'class' => 'text-center'),
                  'template' => '{update}{delete}',
                  'buttons' => array(
                        '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> 