<?php require "includes/security.php" ?>
<!DOCTYPE HTML>
<html lang="it">

<head>
    <title>Login</title>
    <?php require "includes/head.php" ?>
</head>

<body>

<div class="container">
    <h1>Login</h1>
    <h3><a href="statistics.php">Statistiche</a></h3>
    <?php
    if (isset($_SESSION["error"])) {
        ?>
        <div class="alert alert-danger" role="alert">
            Errore! Riprova
        </div>
    <?php }
    session_destroy();
    ?>
    <form action="index.php" method="post">
        <div class="mb-3">
            <label for="nome" class="form-label">Nome Utente</label>
            <input type="text" class="form-control" id="nome" name="nome">
        </div>
        <div class="mb-3">
            <label for="nome" class="form-label">Codice di accesso</label>
            <input type="password" class="form-control" id="code" name="code">
        </div>
        <div class="mb-3">
            <figure class="figure">
                <img src="includes/imgs/avengers.jpg" class="figure-img img-fluid rounded" alt="...">
                <figcaption class="figure-caption">A caption for the above image.</figcaption>
            </figure>
            <figure class="figure">
                <img src="includes/imgs/walle.jpg" class="figure-img img-fluid rounded" alt="...">
                <figcaption class="figure-caption">A caption for the above image.</figcaption>
            </figure>
            <figure class="figure">
                <img src="includes/imgs/napoleon.jpg" class="figure-img img-fluid rounded" alt="...">
                <figcaption class="figure-caption">A caption for the above image.</figcaption>
            </figure>
        </div>

        <label for="film">Seleziona il fim da votare:</label>
        <select name="film" id="film">
            <option value="avengers">avengers</option>
            <option value="walle">walle</option>
            <option value="napoleon">napoelon</option>
        </select>

        <input type="number" id="voto" name="voto" min="1" max="5"/>

        <button type="submit" class="btn btn-primary">Invia voto</button>
    </form>
</div>

<?php require "includes/footer.php" ?>

</body>
</html>