
<?php
/* @var $this UsuarioController */
/* @var $model Usuario */
?>


<div class="row ">
    <div class="col-12 col-sm-12 col-md-3 m-b-30 " > 
     <?php echo CHtml::link('<i class="fas fa-plus"></i> AGREGAR', Yii::app()->createUrl('usuario/create'), 
             array('class'=>'btn btn-secondary btn-block ','data-toggle' => "tooltip",
                            'data-original-title' => 'AGREGAR')); 
     ?>
    </div>
</div>

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

               array(    
                          'filter'=>  PerfilUsuario::lista(),
                          'header'=>'PERFIL',
                          'name'=>'id_perfil_usuario',
                          'value'=>'$data->idProfileUsuario->descripcion','type'=>'text',
                          'htmlOptions'=>array('class'=>'text-uppercase text-center'),
                ),
            
             array(    
                          'filter'=>  array('0'=>'ACTIVO','1'=>'INACTIVO'),
                          'header'=>'ESTATUS',
                          'name'=>'estatus',
                          'value'=>'$data->estatus==0?"ACTIVO":"INACTIVO"','type'=>'text',
                          'htmlOptions'=>array('class'=>'text-uppercase 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  text-primary',
                              'title' => 'VER',
                          ),
                          'visible' => 'true',
                      ),
                        'update' => array(
                          'label' => ' ',
                          'options' => array(
                              'class' => 'mdi mdi-18px mdi-pencil text-primary',
                              'title' => 'ACTUALIZAR',
                          ),
                          'visible' =>'true',
                    ),
                    'delete' => array(
                            'label' => ' ',
                            'options' => array(
                                'class' => 'mdi mdi-18px mdi-trash-can-outline text-primary',
                                'title' => 'ELIMINAR',
                          ),
                            'visible' =>'true',
                      ),
                      
                      
                      
                  )
              ),
            
            
            array(
                    'header'=>'PASSWORD',
                    'class' => 'CButtonColumn',
                    'updateButtonImageUrl'=>false,
                    'htmlOptions'=>array('class'=>'text-center'),
                    'template' => '{pass}',
                    'buttons'=>array(  
                    'pass' => array(
                            'label' => '',
                                'url' => 'Yii::app()->controller->createUrl("modificarpass",array("id"=>$data->id_usuario))',
                            'options' => array(
                                'data-toggle' => 'tooltip',
                                'class' => 'fas fa-key fa-lg text-danger m-r-10 p-2',
                                'data-original-title' => 'MODIFICAR PASSWORD',
                       
              
                            ),
                            'visible' =>'true',
                        ),  
             )),
            
            
              
            
	),
)); ?>
</div></div> 