From 0ad564e2f190f156a470d188c1a3412f16fbb14c Mon Sep 17 00:00:00 2001 From: Baptiste Date: Mon, 25 Jul 2022 21:00:56 +0200 Subject: [PATCH] affichage team --- assets/css/page/com_ville.css | 19 ++++++++ com_ville.php | 92 +++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) diff --git a/assets/css/page/com_ville.css b/assets/css/page/com_ville.css index da3e86d..c72c414 100644 --- a/assets/css/page/com_ville.css +++ b/assets/css/page/com_ville.css @@ -8,4 +8,23 @@ section { padding: 50px; font-size: 1.2rem; margin-top: 40px; +} + +a.team { + display: block; + color: black; + padding: 10px; + margin: auto; + margin-top: 10px; + background-color: white; + width: 50%; + text-decoration: none; + border: 2px solid white; +} + +a.team:hover { + text-decoration: underline; + text-decoration-color: red; + transition: 0.3s ease-out; + border: 2px solid red; } \ No newline at end of file diff --git a/com_ville.php b/com_ville.php index 984b39d..d84d505 100644 --- a/com_ville.php +++ b/com_ville.php @@ -1,6 +1,33 @@ prepare("SELECT id FROM ville_equipe WHERE id = ?"); + $req->execute(array($team)); + $rc = $req->rowcount(); + $r = $req -> fetchAll(PDO::FETCH_ASSOC); + if($rc == 1) { + if($r[0]['id'] < 17) { + $session = 1; + } else { + $session = 2; + } + $reqtest = $db->prepare("SELECT state FROM ville WHERE session = ?"); + $reqtest->execute(array($session)); + $rtest = $reqtest -> fetchAll(PDO::FETCH_ASSOC); + if($rtest[0]['state']<1 OR $rtest[0]['state']>2 ) { + header('Location: error.php'); + } + } else { + header('Location: error.php'); + } +} ?>
@@ -21,6 +48,71 @@ include "assets/fonts/color.php";
Insert “mouhahahaahaaa” diabolique mario + query("SELECT state FROM ville WHERE session = 1"); + $r = $req -> fetchAll(PDO::FETCH_ASSOC); + + if($r[0]['state'] == 0) { + ?> +
+

Session matin

+ La session n'a pas commencé +
+ +
+

Session matin

+ La session est en cours

+ query('SELECT id, nom FROM ville_equipe WHERE id < 17'); + while($equipe = $reqint->fetch()) { + echo "Equipe ".$equipe["nom"].""; + } + ?> +
+ +
+

Session matin

+ La session est terminé +
+ query("SELECT state FROM ville WHERE session = 2"); + $r = $req -> fetchAll(PDO::FETCH_ASSOC); + + if($r[0]['state'] == 0) { + ?> +
+

Session aprem

+ La session n'a pas commencé +
+ +
+

Session aprem

+ La session est en cours

+ query('SELECT id, nom FROM ville_equipe WHERE id > 16'); + while($equipe = $reqint->fetch()) { + echo "Equipe ".$equipe["nom"].""; + } + ?> +
+ +
+

Session aprem

+ La session est terminé +
+