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


    <div class="form p-4">
        <?php $form=$this->beginWidget('CActiveForm', array(
                'id'=>'usuario-form',
                'enableAjaxValidation' => true,
                'clientOptions' => array(
                    'validateOnSubmit'=>true,
                ),
                'htmlOptions' => array(
                    'class' => 'form-horizontal'
                )
        )); ?>
        
        <div class="row">
            <div class="col-12">
                <p class="note">Los campos con <span class="required">*</span> son obligatorios.</p>
            </div> 
        </div>
        
        
        <div class="row">
            <div class="col-12 col-sm-12 col-md-4">
                            <div class="form-group">
                                 <?php echo $form->labelEx($model,'estatus', array('class' => 'col-12  text-uppercase')); ?>
                                 <div class="col-12">
                                         <?php echo $form->dropdownList($model,'estatus',array('0'=>'ACTIVO','1'=>'INACTIVO'),array('class'=>'form-control form-control-line text-uppercase',
                                        'prompt' => 'SELECCIONE',
                                        )); ?> 
                                         <?php echo $form->error($model, 'estatus'); ?>
                                 </div>
                            </div>
              </div>
                <div class="col-12 col-sm-12 col-md-4">
                    <div class="form-group">
                         <?php echo $form->labelEx($model,'id_perfil_usuario', array('class' => 'col-12  text-uppercase')); ?>
                         <div class="col-12">
                                 <?php echo $form->dropdownList($model,'id_perfil_usuario', PerfilUsuario::lista(),array('class'=>'form-control form-control-line text-uppercase',
                                'prompt' => 'SELECCIONE',
                                )); ?> 
                                 <?php echo $form->error($model, 'id_perfil_usuario'); ?>
                         </div>
                    </div>
              </div>
      
                <div class="col-12 col-md-4">
                    <div class="form-group">
                        <?php echo $form->labelEx($model, 'login', array('class' => 'col-12  text-uppercase')); ?>
                        <div class="col-12">
                            <?php echo $form->textField($model, 'login', array('maxlength' => 200,'autocomplete' => 'off', 'class' => 'form-control form-control-line text-uppercase','placeholder'=>"")); ?>
                            <?php echo $form->error($model, 'login'); ?>
                        </div>
                    </div>
                </div>     
                    
              
        </div>
        <?php
        if(($model->id_perfil_usuario==1) and !empty($model->id_perfil_usuario)){
        ?>

        <div class="row">
               <div class="col-12 col-md-4">
                    <div class="form-group">
                        <?php echo $form->labelEx($model, 'dni', array('class' => 'col-12  text-uppercase')); ?>
                        <div class="col-12">
                            <?php echo $form->textField($model, 'dni', array('maxlength' => 200,'autocomplete' => 'off', 'class' => 'form-control form-control-line text-uppercase','placeholder'=>"")); ?>
                            <?php echo $form->error($model, 'dni'); ?>
                        </div>
                    </div>

                </div>
            
            <div class="col-12 col-md-4">
                    <div class="form-group">
                        <?php echo $form->labelEx($model, 'nombres', array('class' => 'col-12  text-uppercase')); ?>
                        <div class="col-12">
                            <?php echo $form->textField($model, 'nombres', array('maxlength' => 200,'autocomplete' => 'off', 'class' => 'form-control form-control-line text-uppercase','placeholder'=>"")); ?>
                            <?php echo $form->error($model, 'nombres'); ?>
                        </div>
                    </div>

                </div>
               <div class="col-12 col-md-4">
                    <div class="form-group">
                        <?php echo $form->labelEx($model, 'apellidos', array('class' => 'col-12  text-uppercase')); ?>
                        <div class="col-12">
                            <?php echo $form->textField($model, 'apellidos', array('maxlength' => 200,'autocomplete' => 'off', 'class' => 'form-control form-control-line text-uppercase','placeholder'=>"")); ?>
                            <?php echo $form->error($model, 'apellidos'); ?>
                        </div>
                    </div>

                </div>
        </div>
        
        <?php
        }
        ?>
            
        
        

               


                <div class="col-12 col-sm-12 col-md-10 col-lg-10  offset-1 m-t-20" id="f"> 
                      <?php echo $form->errorSummary($model); ?>  
                </div>
                
                <div class="col-12 m-b-30" id="f" >
                    <div class="row justify-content-center" >
                        <div class="col-12 col-sm-12 col-md-5 mb-2">
                            <button type="submit" class="btn btn-large btn-block btn-primary  ">
                                       <i class="fas fa-save fa-lg   "></i>    <?php echo $model->isNewRecord ? "GUARDAR" : "EDITAR"; ?></button>
                        </div> 
                    </div>
                </div>
                  

<?php $this->endWidget(); ?>
</div>















