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)); + ?> +