From 1653b0d4d0b106c8e63dbdc66a34160422b61f5b Mon Sep 17 00:00:00 2001 From: Baptiste Date: Sun, 12 Jun 2022 13:49:12 +0200 Subject: [PATCH] enigme plaquette finito --- assets/css/page/enigma.css | 15 ++++++++ assets/css/page/team.css | 11 ++++++ enigma.php | 77 ++++++++++++++++++++++++++++++++++++++ structure/menu.php | 8 ++-- 4 files changed, 107 insertions(+), 4 deletions(-) diff --git a/assets/css/page/enigma.css b/assets/css/page/enigma.css index e69de29..937670e 100644 --- a/assets/css/page/enigma.css +++ b/assets/css/page/enigma.css @@ -0,0 +1,15 @@ +* { + text-align: center; +} + +section { + display: block; + background-color: rgba(255,255,255,0.3); + width: 80%; + max-width: 800px; + margin-left: auto; + margin-right: auto; + padding: 50px; + font-size: 1.2rem; + margin-top: 40px; +} \ No newline at end of file diff --git a/assets/css/page/team.css b/assets/css/page/team.css index e69de29..cb1f873 100644 --- a/assets/css/page/team.css +++ b/assets/css/page/team.css @@ -0,0 +1,11 @@ +section { + display: block; + background-color: rgba(255,255,255,0.3); + width: 80%; + max-width: 800px; + margin-left: auto; + margin-right: auto; + padding: 50px; + font-size: 1.2rem; + margin-top: 40px; +} \ No newline at end of file diff --git a/enigma.php b/enigma.php index f84b94d..6f6862e 100644 --- a/enigma.php +++ b/enigma.php @@ -1,6 +1,83 @@ query('SELECT answer, point, team FROM enigma WHERE id = 1'); //id = 1 est la ligne correspondant à l'énigme de la plaquette + $reponse = $req -> fetchAll(PDO::FETCH_ASSOC); + + if($reponse[0]['team'] == NULL) { + //le "if" ici c'est parce que le 0 => $team = NULL du coup on doit genre faire une conversion relou + if($team == "pkpeach") { + $team = 0; + } elseif($team == "boomario") { + $team = 1; + } else { + header('Refresh: 0'); + } + + + if($ans == $reponse[0]['answer']) { + $req = $db->prepare("INSERT INTO scores(texte, points, team) VALUES(?, ?, ?)"); + $req->execute(array("enigme de la plaquette", $reponse[0]['point'], $team)); + + $req = $db->prepare("UPDATE enigma SET team = ? WHERE id = 1"); + $req->execute(array($team)); + ?> +
+ + + +
Enigme de la plaquette
+ + + +
+ +
+ query('SELECT team FROM enigma WHERE id = 1'); //id = 1 est la ligne correspondant à l'énigme de la plaquette + $reponse = $req -> fetchAll(PDO::FETCH_ASSOC); + + //var_dump($reponse); + if($reponse[0]['team'] == NULL) { + ?> +
+ + + +
+ +
'; } $co_y_1 = [-23.5, 25.35,74.2, 123.05, 171.9, 220.75, 269.6, 318.45, 367.3, 416.15, 465]; - $texte_y_1 = ["", "Photos","Lydia/Izly", "Les clubs", "Prévention", "Com'ville", "", "", "Download", "Les com's", "Infos"]; - $lien_y_1 = ["", "photos.php","lydia.php", "clubs.php", "prevs.php", "map_com_ville.php", "", "", "downloads.php", "coms.php", "info.php"]; + $texte_y_1 = ["", "Photos","Lydia/Izly", "Les clubs", "Prévention", "Com'ville", "Enigme", "", "Download", "Les com's", "Infos"]; + $lien_y_1 = ["", "photos.php","lydia.php", "clubs.php", "prevs.php", "map_com_ville.php", "enigma.php", "", "downloads.php", "coms.php", "info.php"]; for($i = 0; $i <= 10; $i++) { echo ' @@ -189,8 +189,8 @@ if(!isset($relativepath)) { } $co_y_1 = [-23.5, 25.35,74.2, 123.05, 171.9, 220.75, 269.6, 318.45, 367.3, 416.15, 465]; - $texte_y_1 = ["Lydia/Izly", "Les clubs", "Prévention", "Com'ville", "", "", "", "", "Download", "Les com's", "Infos"]; - $lien_y_1 = ["lydia.php", "clubs.php", "prevs.php", "map_com_ville.php", "", "", "", "", "downloads.php", "coms.php", "info.php"]; + $texte_y_1 = ["Lydia/Izly", "Les clubs", "Prévention", "Com'ville", "Enigme", "", "", "", "Download", "Les com's", "Infos"]; + $lien_y_1 = ["lydia.php", "clubs.php", "prevs.php", "map_com_ville.php", "enigma.php", "", "", "", "downloads.php", "coms.php", "info.php"]; for($i = 0; $i <= 10; $i++) { echo '