diff --git a/data/teams.db b/data/teams.db index 82b9f18..27d92d3 100644 Binary files a/data/teams.db and b/data/teams.db differ diff --git a/index.php b/index.php index 6d78f9c..5e45407 100644 --- a/index.php +++ b/index.php @@ -39,7 +39,7 @@
diff --git a/puzzles.php b/puzzles.php index e572353..f9b2d50 100644 --- a/puzzles.php +++ b/puzzles.php @@ -14,24 +14,22 @@ $stmt->bindValue(":id", $team_id); $stmt->execute(); - if (empty($stmt->fetchAll())) { + if (empty($stmt->fetch())) { header("Location: index.php"); die(); } else { - // On crée un cookie pour enregistrer l'équipe sélectionnée si ce n'est pas fait : - if (!isset($_COOKIE["team"])) { - setcookie( - "team", - $team_id, - time() + (365 * 24 * 60 * 60), - "/", - "", - false, - false - ); - } + // On crée un cookie pour enregistrer l'équipe sélectionnée : + setcookie( + "team", + $team_id, + time() + (365 * 24 * 60 * 60), + "/", + "", + false, + false + ); // On vérifie si l'équipe a débloqué l'énigme bonus : $stmt = $database->pdo_teams->prepare("SELECT * FROM teams WHERE id = :id"); diff --git a/require/locales/en.php b/require/locales/en.php index 3b3fca3..894141d 100644 --- a/require/locales/en.php +++ b/require/locales/en.php @@ -2,11 +2,13 @@ $tr = [ "tab_title" => [ "home" => "Home - Lycée Pange Code Hunt", + "team_confirm" => "Team confirmation - Lycée Pange Code Hunt", "puzzles" => "Puzzles list - Lycée Pange Code Hunt", "article" => "Puzzle - Lycée Pange Code Hunt" ], "page_title" => [ "home" => "Code Hunt", + "team_confirm" => "Team confirmation", "puzzles" => "Puzzles list for team n°", "article" => "Puzzle n°" ], @@ -15,6 +17,11 @@ "message" => "Select your team to begin :", "team" => "Team n°" ], + "team_confirm" => [ + "subtitle" => "Please make sure you selected the right team.", + "message" => "Your name must appear on the following list : ", + "button" => "Yes, this is my team !" + ], "article" => [ "message" => "This puzzle describes a specific place. Head to that place, then scan the QR code you'll find there.", "success" => "Well done ! Your team solved this puzzle !", diff --git a/require/locales/fr.php b/require/locales/fr.php index 6872f0d..dd252de 100644 --- a/require/locales/fr.php +++ b/require/locales/fr.php @@ -2,11 +2,13 @@ $tr = [ "tab_title" => [ "home" => "Accueil - Chasse au code Lycée Pange", + "team_confirm" => "Confirmation du choix d'équipe - Chasse au code Lycée Pange", "puzzles" => "Liste des énigmes - Chasse au code Lycée Pange", "article" => "Énigme - Chasse au code Lycée Pange" ], "page_title" => [ "home" => "Chasse au code", + "team_confirm" => "Confirmation du choix d'équipe", "puzzles" => "Liste des puzzles pour l'équipe n°", "article" => "Énigme n°" ], @@ -15,6 +17,11 @@ "message" => "Pour commencer, veuillez choisir votre groupe :", "team" => "Équipe n°" ], + "team_confirm" => [ + "subtitle" => "Assurez-vous d'avoir sélectionné la bonne équipe.", + "message" => "Votre nom doit figurer dans la liste suivante : ", + "button" => "Oui, c'est bien mon équipe !" + ], "article" => [ "message" => "Cette énigme décrit un endroit précis. Dirigez-vous vers cet endroit, puis scannez le QR code que vous-y trouverez.", "success" => "Bien joué ! Votre équipe a résolu cette énigme !", diff --git a/style.css b/style.css index 8511a5f..fd062b9 100644 --- a/style.css +++ b/style.css @@ -4,6 +4,7 @@ --bg-light: #a4a4a4; --fg: #ffffff; --hl: #8080ff; + --hl-light: #aeaeff; } body { @@ -70,7 +71,7 @@ input[type="submit"], button { } input[type="submit"]:hover, button:hover { - background: var(--bg-light); + background: var(--hl-light); color: var(--fg); } diff --git a/team_confirm.php b/team_confirm.php new file mode 100644 index 0000000..5d76b32 --- /dev/null +++ b/team_confirm.php @@ -0,0 +1,73 @@ +pdo_teams->prepare("SELECT * FROM teams WHERE id == :id"); + $stmt->bindValue(":id", $team_id); + $stmt->execute(); + + if (empty($stmt->fetch())) { + header("Location: index.php"); + die(); + } + + else { + // Recherche des membres du groupe : + $stmt = $database->pdo_teams->prepare("SELECT * FROM members WHERE team_id == :id"); + $stmt->bindValue(":id", $team_id); + $stmt->execute(); + $members = $stmt->fetchAll(); + } + } + + else { + header("Location: index.php"); + die(); + } +?> + + + + + + <?= $tr["tab_title"]["team_confirm"] ?> + + +
+ +
+
+
+

+

+

+ + +   + +

+ + + +
+
+
+
+ + + \ No newline at end of file