From ccb1d7e8f17d24ff12900d41f1ec9e6a3cb16dda Mon Sep 17 00:00:00 2001 From: antux18 Date: Fri, 1 Sep 2023 19:44:54 -0400 Subject: [PATCH] =?UTF-8?q?Ajout=20d'une=20page=20de=20confirmation=20pour?= =?UTF-8?q?=20le=20choix=20de=20l'=C3=A9quipe.=20Modification=20du=20style?= =?UTF-8?q?.=20Corrections=20mineures.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/teams.db | Bin 45056 -> 45056 bytes index.php | 2 +- puzzles.php | 24 +++++++------- require/locales/en.php | 7 ++++ require/locales/fr.php | 7 ++++ style.css | 3 +- team_confirm.php | 73 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 101 insertions(+), 15 deletions(-) create mode 100644 team_confirm.php diff --git a/data/teams.db b/data/teams.db index 82b9f181c0e6401eda49c800c67b2070289ea4ce..27d92d3153fce3188cfb391d4913638c9c85c012 100644 GIT binary patch delta 718 zcmZp8z|`=7X@WGbF9QPuHxRP}G3!JPb4K5d3G?miBYA;*CjM^>{J;6X@j25Q+E8NQ zW literal 45056 zcmeI4dyFK-eaB~}=h0RD+P&SqWx3bv9(T9PvG<01T3Ljhr}=g-m2Sv4WM5IFSem!IGVa z^R3={gbM*Fa{j=oJhb&i>Qhy}s_NEld|Pn*{9^Uk>9Z#fpRaDu4dn9q+<|H} zm&Io-y-{`nFSM%U90b&fy(HL6?wVg z{NW=f7EdmoJhFK9+@&v47n~)$ny^~Hs}q-UC#sW_Oq@D=a&dwr{9sZIBYe^zxCzE}s?)a&r ziw~W<{{*hIhYnvje>#&7WxYAHHTx>h8s*WA8}q#kz@@6^7Vp2Xc65fFIyRPSo-~Y>( z3+r;;tKN6L7rn1}U-mxdead^<`>^+jch)=Z9r9wY>Fx2Ry>V~EqwasYuemR~FS>u? z{*L>b?$hpv-ACLr?h!Y28}4rRMz`uNbBoUF&MVGeI4?L~c7DtGl=HOn3yyToI7ghs zX*qkGP0qM8;@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ZA?h3 zZVKvV1?{FU)|n3Q!S2GQijB#|($=PmbtysB9)zHa-FfE#LI0TualDxh8A8BHV!|D! zmKu@UbRe(H z)G&_(Yb)JU{r&&7?)5qEpS+iG|NkTJ3*M)_U-h2!9`nw4i(cya-mTsyZ?)%m1@{g2 z@7?dZfA0Q)`+4_S_bK=1-3Q(K+&kUd+ym}5cRkeTA5B0L&;&FAO+XXS1T+CnKoige zG=X;=0n(qs^>P81+NeePlSud2T)ME<>TkehcRs+=gidt5+h32n_`Hv2!?f=HnF{T%RC=<~G1^~oMZnv~>#qnQ?T=j%dS?GR+|lQv zR#0~Pqp&u|7OGA4gfHFi^q1r50bV*Jc 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