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



<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'usuarios-form',
	'enableAjaxValidation'=>TRUE,
         'htmlOptions' => array(
                'class' => 'form-horizontal'
            )
)); ?>
    <div class="row justify-content-center">
        <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 col-lg-4 col-xl-4">
             <div class="form-group">
                 <?php echo $form->labelEx($model, 'dni', array('class' => 'col-12')); ?>
                 <div class="col-12">
                     <?php echo $form->textField($model, 'dni', array('maxlength' => 10,'autocomplete' => 'off', 
                         'class' => 'form-control form-control-line ', "disabled"=>$model->isNewRecord?'':'disabled',
                         'placeholder'=>"",)); ?>
                     <?php echo $form->error($model, 'dni'); ?>
                 </div>
             </div>
         </div>   
        
             <div class="col-10 col-sm-10 col-md-4 col-lg-4 col-md-4">
                 <div class="form-group">
                     <?php echo $form->labelEx($model, 'nombres', array('class' => 'col-12 mdi mdi-account-outline mdi-18px')); ?>
                     <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-10 col-sm-10 col-md-4 col-lg-4 col-md-4">
                 <div class="form-group">
                     <?php echo $form->labelEx($model, 'apellidos', array('class' => 'col-12 mdi mdi-account-outline mdi-18px')); ?>
                     <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 class="col-12 col-sm-12 col-md-4 col-lg-4 col-xl-4">
             <div class="form-group">
		<?php echo $form->labelEx($model,'estatus', array('class' => 'col-12')); ?>
            <div class="col-12">
                    <?php echo $form->dropdownList($model,'estatus',array(1=>'ACTIVO',0=>'INACTIVO'),  array('class'=>'form-control form-control-line')); ?> 
		<?php echo $form->error($model,'estatus'); ?>  
            </div>
        </div>
        </div>  
        
        
        
        <div class="col-12 col-sm-12 col-md-4 col-lg-4 col-xl-4 ">
             <div class="form-group">
		<?php echo $form->labelEx($model,'id_perfil_usuario', array('class' => 'col-12')); ?>
            <div class="col-12">
                    <?php echo $form->dropdownList($model,'id_perfil_usuario',  PerfilUsuario::lista(), 
                            array('class'=>'form-control form-control-line')); ?> 
		<?php echo $form->error($model,'id_perfil_usuario'); ?>  
            </div>
        </div>
        </div> 
        
        <div class="col-12 col-sm-12 col-md-4">
                            <div class="form-group">
                                 <?php echo $form->labelEx($model,'id_gestor', array('class' => 'col-12  text-uppercase')); ?>
                                 <div class="col-12">
                                         <?php echo $form->dropdownList($model,'id_gestor', Gestor::lista(),array('class'=>'form-control form-control-line text-uppercase',
                                        'prompt' => 'SELECCIONE',
                                        )); ?> 
                                         <?php echo $form->error($model, 'id_gestor'); ?>
                                 </div>
                            </div>
                        </div>
        
        
        
         </div>
    
    <?php echo $form->errorSummary($model); ?>
    
<div class="row justify-content-center mt-5 mb-5">
              <div class="col-12 col-sm-12 col-md-5 col-lg-5 col-xl-5 ">
                  <button type="submit"   class="btn btn-block <?php echo $model->isNewRecord ? 'btn-success mr-2 mdi mdi-content-save' : 'btn-danger mdi mdi-content-save-edit'; ?>"  > <?php echo $model->isNewRecord ? 'GUARDAR' : 'MODIFICAR'; ?></button>
              </div>
          </div>

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

</div><!-- form -->


<script type="text/javascript">  
$(document).ready(function() {

         $('#Usuarios_dni').mask('99999999999999', {translation: { 'A':{pattern: /[1-9]/}}, clearIfNotMatch: true});
    

}); 
</script>