
<?php

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

$('.search-form form').submit(function(){
	$('#monto-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<div class="row">
  
    <div class="col-12  col-sm-12 col-md-4"  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('monto-grid',{ data:{pageSize: $(this).val() }})",
        ))
         . ' Registros';
        ?>
    </div> 
    
    
    <div class="col-12  col-sm-12 col-md-7 text-right"  style="margin-right: 25px;" >
          <?php echo CHtml::link('<i class="fa fa-plus fa-lg"></i>  AGREGAR MONTO', 
             Yii::app()->createUrl('monto/create'), 
             array('class'=>'btn btn-secondary',
                 'data-toggle' => "tooltip",
                 'data-original-title' => 'AGREGAR MONTO',
                 )); 
     ?>     
 
     
     <?php echo CHtml::link('<i class="fas fa-sync fa-lg"></i>', 
             '#', 
             array('class'=>'btn btn-secondary',
                 'onClick' => 'window.location="' . Yii::app()->createUrl('monto') . '"; ',
                 'data-toggle' => "tooltip",
                 'data-original-title' => 'REFRESCAR LISTA'
                 )); 
     ?>   
    </div>
</div>


<div class='table-responsive'>   
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'monto-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_monto',
                    'value' => '$data->id_monto',
                    'type' => 'text',
                    'htmlOptions' => array('class' => 'text-center'),
                ),
                array(
                    'name' => 'descripcion',
                    'value' => '$data->descripcion',
                    'type' => 'text',
                    'htmlOptions' => array('class' => 'text-center'),
                ),

	
		array(
                  'header' => 'ACCION',
                  'class' => 'CButtonColumn',
                  'deleteButtonImageUrl' => false,
                  'updateButtonImageUrl' => false,
                  'viewButtonImageUrl' => 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',
                              '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> 