<?php
if (isset($_GET["sorgente"])) {
    highlight_file("process_eventi.php");
    exit;
}
?>

<!DOCTYPE html>
<html lang="it">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Ricerca > SecureTickets</title>

    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap" rel="stylesheet">

    <link rel="stylesheet" href="eventi.css">
    <link rel="icon" type="image/png" href="favicon.png" sizes="96x96" />
    <script src="https://kit.fontawesome.com/c2497a668c.js" crossorigin="anonymous" type="text/javascript"></script>
</head>

<body>

    <header>
        <div class="container">
            <div class="logo">
                <img src="logo.png" alt="SecureTickets">
                <h3>SecureTickets</h3>
            </div>
            <div class="count">
                Biglietti: 0
            </div>
        </div>
    </header>

    <div class="hero">
        <div class="overlay">
            <div class="container">
                <h1>Piattaforma n. 1 per cercare eventi</h1>
            </div>
        </div>
    </div>

    <div class="page">
        <section class="container">
            <?php
            if (!isset($_GET["nome-evento"]) || !isset($_GET["citta"])) {
                // Dati non completi
                ?>
                <h2>Richiesta non completa, riprova</h2>
                <?php
            } else {
                // Sanitizzazione input necessaria per query DB ricerca
                $nome = htmlspecialchars($_GET["nome-evento"]);
                $citta = htmlspecialchars($_GET["citta"]);

                echo "<h3>Hai cercato</h3>";
                echo "<h2>" . $nome . " in " . $citta . "</h2>";
                echo "<p>Nessun evento trovato, per ora, ma l'invio dei dati con l'array <code>&dollar;_GET</code> funziona!</p>";
            }
            ?>
        </section>

        <section class="container">
            <div class="buttons">
                <a class="button" onclick="history.back();">Torna indietro</a>
                <a class="button" href="process_eventi.php?sorgente">Leggi sorgente</a>
                <a class="button" href="../esercizio2">Es. successivo</a>
            </div>
        </section>
    </div>

    <footer>
        <div class="container">
            Realizzato da Francesco Giuseppe Mancuso - classe 5E - www.francescomancuso.it
        </div>
    </footer>

</body>

</html>