<html>
  <!--======== Modal Registrar ========-->
  <div class="modal fade" id="Registrar_Usuarios" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true" 
  data-bs-backdrop="static" data-bs-keyboard="false">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h1 class="modal-title fs-5" id="exampleModalLabel">Registrar Usuario</h1>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body">

  <style>
    .Mayusc{
      text-transform: capitalize;
    }
  </style>

          <!--======== Formulario de Agregar registro ========-->
          <form method="POST" action="../register-login/register.php">

            <div class="form-group">
              <label for="recipient-name" class="col-form-label">Usuario</label>
              <input type="text" name="reg_username" class="form-control Mayusc" maxlength="20">
            </div>

            <div class="form-group">
              <label for="recipient-name" class="col-form-label">Correo</label>
              <input type="email" name="email" class="form-control" maxlength="20">
            </div>

            <div class="form-group">
              <label for="recipient-name" class="col-form-label">Perfil_Usuario</label>
              <select class="form-select" aria-label="Default select example" name="perfil" id="perfil">
                <option></option>
                <option value="1">Administrador</option>
                <option value="2">Vendedor</option>
                <option value="3">Cliente</option>
              </select>
            </div>

            <div class="form-group">
              <label for="recipient-name" class="col-form-label">Clave</label>
              <div class="input-group">
                <input type="password" id="pass" name="reg_password" class="form-control" maxlength="16" title="clave MAX 16 caracteres">
              </div>
            </div>

            <div class="modal-footer">
              <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cerrar</button>
              <button type="submit" class="btn btn-primary" name="btn_register_ADMIN" title="Registrar Usuario">Guardar</button>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>

  <!--======== Modal para Editar ========-->
  <div class="modal fade" id="editar<?php echo $usuario['ID']; ?>" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"
    data-bs-backdrop="static" data-bs-keyboard="false">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h1 class="modal-title fs-5" id="exampleModalLabel">Editar Usuario</h1>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body">

        <!--======== Formulario de Editar registro ========-->
         <form method="POST" action="controladores/Usuarios/edit_usuario.php">

           <div class="form-group">
            <label for="recipient-name" class="col-form-label">ID Usuario</label>
            <input type="" name="id" class="form-control" value="<?php echo $usuario['ID'] ?>" readonly onmousedown="return false;">
          </div>

          <div class="form-group">
            <label for="recipient-name" class="col-form-label">Usuario</label>
            <input type="text" name="Usuario" class="form-control" value="<?php echo $usuario['Username']; ?>" required="true" maxlength="20">
          </div>

          <div class="form-group">
            <label for="recipient-name" class="col-form-label">Correo</label>
            <input type="email" name="email" class="form-control" value="<?php echo $usuario['Correo']; ?>" required="true" maxlength="20">
          </div>
          <div class="form-group">
           <label for="recipient-name" class="col-form-label">Perfil_Usuario</label>
           <select class="form-select" aria-label="Default select example" name="perfil" id="perfil" required>
            <?php
            include '../../Clases/db.php';
            $conn= new conn();
            $conex= $conn->crearconn();
            $consulta = "SELECT * FROM perfil_usuario";
            $ejecutar=mysqli_query($conex,$consulta) or die (mysqli_error($conex)); 
            ?>

            <option></option>
            <?php  foreach($ejecutar as $opciones){  ?>

             <option value="<?php echo $opciones['ID'] ?>" ><?php echo $opciones['descripcion'] ?></option>
           <?php } ?>
         </select>
       </div>
       <div class="form-group">
        <label for="recipient-name" class="col-form-label">Cambiar Clave</label>
        <input type="text" id="pass" name="clave" class="form-control" maxlength="16" title="clave MAX 16 caracteres">
      </div>

      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cerrar</button>
        <button type="submit" class="btn btn-primary btneditar" >Guardar Cambios</button>
      </div>
    </form>
  </div>
</div>
</div>
</div>

<!--======== Modal para Eliminar ========-->
<div class="modal fade" id="eliminar<?php echo$usuario['ID']; ?>" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"
  data-bs-backdrop="static" data-bs-keyboard="false">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title">
          ¿Realmente deseas eliminar este usuario?
        </h4>
      </div>
      <div class="modal-body">

       <form method="POST" action="controladores/Usuarios/delet_usuario.php">

        <input type="hidden" name="ide" value="<?php echo $usuario['ID']; ?>">
        <strong style="text-align: center !important"> 
          <?php echo $usuario['Username']; ?>
        </strong>

        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cerrar</button>
          <button type="submit" class="btn btn-danger btneliminar" title="eliminar">Eliminar</button>
        </div>
      </form>
    </div>
  </div>
</div>
</div>

<script src="../../ArchivosJS/jquery-3.6.0.min.js"></script> 
</html>