<?php
require_once 'class/c_login.php';
$error = isset($_SESSION["error"]);
unset($_SESSION["error"]);
if ($error) $errorDesc = "El usuario y/o contraseña son incorrectos.";
// session_destroy();
?>
<!DOCTYPE html>
<html lang="es" prefix="og: http://ogp.me/ns#">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>.: Administrador de checador (Pruebas) :.</title>

    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="icon" type="image/png" href="imagenes/favicon.png" />
    <link rel="stylesheet" href="css/bootstrap-ulsa.min.css" type="text/css">
    <link rel="stylesheet" href="css/indivisa.css" type="text/css">
    <link rel="stylesheet" href="css/sgi.css?rand=<?= rand() ?>" type="text/css">
    <link rel="stylesheet" href="css/index.css" type="text/css">

<body>
    <!-- HEADER -->
    <?php include "import/html_header_index.php";
    html_header("Checador inicio de sesión"); ?>
    <main class="container-fluid content d-flex justify-content-center align-items-center">
        <div class="logSize p-5 bg-white defaultShadow">
            <div class="row mb-4">
                <div class="col-sm-12">
                    <h1 class="mb-1">Iniciar sesión</h1>
                </div>
            </div>
            <form method="post" action="action/action_login.php">
                <div class="row">
                    <div class="col">
                        <p class="text-center font-weight-bold text-info">Utiliza tu usuario y contraseña institucionales</p>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="input-group px-4">
                        <div class="input-group-prepend secondary">
                            <div class="input-group-text bg-primary text-white"><i class="ing-usuario ing-fw"></i></div>
                        </div>
                        <input class="form-control form-control-lg" type="text" autocomplete="username" placeholder="Usuario (ad)" id="username" name="username" value="" autofocus="true" maxlength="10" />
                    </div>
                </div>
                <div class="form-group row">
                    <div class="input-group mb-2 px-4">
                        <div class="input-group-prepend">
                            <div class="input-group-text bg-primary text-white"><i class="ing-pass ing-fw"></i></div>
                        </div>
                        <input class="form-control form-control-lg" type="password" autocomplete="current-password" placeholder="Contraseña" id="passwd" name="passwd" value="" maxlength="50" />
                    </div>
                </div>
                <?php if ($error) { ?>
                    <p class="text-danger text-center font-weight-bold">¡ERROR! <?= $errorDesc ?></p>
                <?php } ?>
                <p class="text-center">
                    <button type="submit" class="btn btn-lg btn-outline-primary btn-ing arrow">Ingresar</button>
                </p>
            </form>
        </div>
    </main>
    <!--- FOOTER--->
    <?php require_once("import/html_footer.php"); ?>

    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap/bootstrap.min.js"></script>
    <script src="js/bootstrap/popper.min.js"></script>
    <script src="js/sidebarmenu.js"></script>
</body>

</html>