<?php
session_start();

if (!isset($_SESSION['usuario'])) {
    header('Location: ../index.html');
    session_destroy();
    exit();
}
?>

<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../font/bootstrap-icons.css">
    <link rel="stylesheet" href="../css/inicio.css">
    <link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/boxicons@latest/css/boxicons.min.css'>
    <title>Crear usuario</title>
</head>
<body>

<!-- SIDEBAR -->
<section id="sidebar">
    <a href="inicio.html" class="brand"><i class='bx bx-code-alt icon' ></i> LANIA</a>

    <ul class="side-menu">
        <li><a href="inicio.html"><i class='bx bxs-dashboard icon' ></i>Dashboard</a></li>
        <li><a href="formulario-candidato.html" target="_blank"><i class='bx bxs-dashboard icon' ></i>Formulario de registro</a></li>
        <li><a href="control-candidatos.php"><i class='bx bxs-dashboard icon' ></i>Control candidatos</a></li>
        <li><a href="control-usuarios.php" class="active"><i class='bx bxs-dashboard icon' ></i>Control usuario</a></li>
        <li><a href="../controllers/cerrarSesion.php"><i class="bi bi-box-arrow-left icon"></i>Cerrar sesión</a></li>
    </ul>


</section>
<!-- .SIDEBAR -->


<section id="content">
    <main>

        <h1 class="title" style="margin: 2% 1%">Crear usuario</h1>

        <!-- div de formulario ------------------------------------------------------------------------------------- -->
        <div class="bg-light-subtle border border-dark-subtle shadow-sm rounded-3" style="margin: 1%">
            <div style="margin:5%;">
                <form id="form">
                    <label class="form-label" for="usuario" style="margin: 8px 0px 8px 0px;"><i class="bi bi-person"></i> Nombre de usuario</label>
                    <input class="border rounded border-dark-subtle form-control" type="text" id="usuario" required="" minlength="1" maxlength="150" pattern="^[a-zA-Z0-9]+$" />

                    <label class="form-label" for="contrasena" style="margin: 8px 0px 8px 0px;"><i class="bi bi-key"></i> Contraseña</label>


                    <div class="input-group">
                        <input class="form-control" type="password" id="contrasena" required="" minlength="1"/>
                        <button class="btn btn-light" id="togglePassword" type="button" style="border: var(--bs-border-width) solid var(--bs-border-color);"><i class="bi bi-eye"></i></button>
                    </div>


                    <label class="form-label" for="contrasena" style="margin: 8px 0px 8px 0px;"><i class="bi bi-key"></i> Vuelva a escribir la contraseña</label>
                    <input class="form-control" type="password" id="contrasena_verificacion" required="" minlength="1"/>

                    <input class="btn text-light w-100" type="submit" id="submit" style="margin: 8px 0px 8px 0px;background-color: #35245b"/ value="Crear usuario">
                </form>
            </div>
        </div>
        <!-- /div de formulario ------------------------------------------------------------------------------------ -->
    </main>
</section>


<script src="assets/bootstrap/js/bootstrap.min.js"></script>

<script src="../js/sidebar-navbar.js"></script>
<script src="../js/crear-usuario.js"></script>

<script src="https://website-widgets.pages.dev/dist/sienna.min.js" defer></script>
</body>
</html>