<div id="formcaptura" class="col-md-12">
    <div class="row" >
        <div class="col-sm">
            <h4><img src="../images/user.png" width="3%"  alt="" >Control de usuarios</h4>
        </div>
    </div>
    <br>
    <div class="card card-body">
        <form id="capturanuevauser">

                <div class="row">
                    <input type="hidden" id="idUsuario" name="idUsuario" value="<?php echo $_SESSION['idUsuario'] ?>">
                    <input type="hidden" id="userrol" name="userrol" value="<?php echo $_SESSION['userrol'] ?>">
                    <input type="hidden" id="accion" name="accion" value="<?php echo $tipo_accio ?>">
                    <div class="form-group col-lg-2 col-md-6 col-md-12">
                        <label class="mb-2 tag">Accion</label>
                        <select required class="form-control" name="tipo_accio" id="tipo_accio"  onchange="tipo_registro()">
                            <option value="1" <?php echo intval($tipo_accio) === intval('1') ? "selected" : "" ?>>Nuevo usuario</option>
                            <option value="2" <?php echo intval($tipo_accio) === intval('2') ? "selected" : "" ?>>Editar usuario</option>
                            
                        </select>
                    </div>
                    <div class="form-group col-lg-2 col-md-6 col-md-12">
                        <label class="mb-2 tag">tipo de usuario</label>
                        <select required class="form-control" name="tipo_user" id="tipo_user" onchange="activarcampos(<?php echo $tipo_accio ?>)">
                            <option value=""></option>
                            <option value="2" <?php echo intval($tipo_user) === intval('2') ? "selected" : "" ?>>Usuario sistema</option>
                            <option value="3" <?php echo intval($tipo_user) === intval('3') ? "selected" : "" ?>>Proveedor</option>
                            <option value="4" <?php echo intval($tipo_user) === intval('4') ? "selected" : "" ?>>Contratista</option>
                        </select>
                    </div>
                    <?php if($tipo_accio==2){  ?>
                    <div id="dos" class="form-group col-lg-3 col-md-6 col-md-12">
                        <label class="mb-2 tag" id="rfclist">Lista de RFC</label>
                        <label class="mb-2 tag" style=" display: none;" id="userlist">Lista de usuarios</label>
                            <select required class="form-control" name="rfc_pro" id="rfc_pro" onchange="edittraeproveedor()" disabled>
                                <option value=""></option>
                                    <?php foreach ($objJasonproveedores as $prorfc) { ?>
                                        <option value="<?php echo $prorfc->username ?>" prove="<?php echo htmlentities($prorfc->nombre) ?>" idpro="<?php echo $prorfc->id ?>" correo="<?php echo htmlentities($prorfc->correo) ?>" tel="<?php echo htmlentities($prorfc->celular) ?>" ><?php echo htmlentities($prorfc->username) ?></option>
                                    <?php } ?>
                            </select>
                    </div>
                    <div id="rfcedit" class="form-group col-lg-3 col-md-6 col-md-12">
                        <label class="mb-2 tag">RFC</label>
                         <input type="text" id="rfc_user_edit" name="rfc_user_edit" class="form-control" value="" disabled>
                    </div>
                    <?php }else{  ?>
                    <div id="rfcprov" class="form-group col-lg-3 col-md-6 col-md-12">
                        <label class="mb-2 tag" id="rfcnuevo">RFC</label>
                        <label class="mb-2 tag" id="nomnuevo" style=" display:none">Usuario</label>
                         <input type="text" id="rfc_user" name="rfc_user" class="form-control" value="" disabled>
                    </div>
                    <?php } ?>
                    <div class="form-group col-lg-4 col-md-6 col-md-12">
                        <label class="mb-2 tag">Nombre</label>
                        <input type="text" id="nom_user" name="nom_user" class="form-control" value="" disabled>
                                                
                    </div>
                    <div class="form-group col-lg-2 col-md-6 col-md-12">
                        <label class="mb-2 tag">Contraseña</label>
                        <input type="text" id="pass_user" name="pass_user" class="form-control" value="" disabled >
                                                
                    </div>
                                            
                    <div class="form-group col-lg-2 col-md-6 col-md-12">
                        <label class="mb-2 tag">Estatus</label>
                        <select required class="form-control" name="estatus" id="estatus">
                            <option value="A">Activo</option>
                            <option value="B">Baja</option>
                            
                        </select>
                    </div>

                    <div id="celulares" class="form-group col-lg-4 col-md-6 col-md-12">
                        <label class="mb-2 tag">Celular</label>
                        <input type="text" id="cel" name="cel" class="form-control" value="" disabled>
                                                
                    </div>
                    <div class="form-group col-lg-4 col-md-6 col-md-12">
                        <label class="mb-2 tag">Correo</label>
                        <input type="text" id="correo" name="correo" class="form-control" value="" disabled>
                                                
                    </div>
                                            
                                            
                </div>
        </form>
              <p>      <div class="row">
                        <div class="form-group col-lg-6 col-md-6 col-md-12">
                            <button id="sign_in" class="btn btn-success" onclick="guardar_usuarios()">Guardar </button>
                                        
                            <button  class="btn btn-danger" onclick="cerrar_user('nuevopro','<?php echo $_SESSION['idUsuario'] ?>','<?php echo $_SESSION['userrol'] ?>')">Cancelar </button>
                        </div>
                    </div>
               </p>                  
    </div>

</div>

