diff --git a/admin/admin.css b/admin/admin.css index 0cbe9ed..7e0e216 100644 --- a/admin/admin.css +++ b/admin/admin.css @@ -130,4 +130,42 @@ table.acces td { text-decoration: none; color: red; font-weight: bold; +} + +.href_session { + text-decoration: none; + width: 20vw; + display: inline-block; + margin: 1vw; + padding: 10px; + background-color: white; + text-align: center; + color: blue; + font-size: 1.5em; +} + +.href_session:hover { + transition: 0.3s ease; + transform: scale(1.05); +} + +.href_session_selected { + text-decoration: none; + width: 20vw; + display: inline-block; + margin: 1vw; + padding: 10px; + background-color: blue; + text-align: center; + color: white; + font-size: 1.5em; + transform: scale(1.1); +} + +.submit_ville { + +} + +.input_ville { + } \ No newline at end of file diff --git a/admin/script.php b/admin/script.php index 7baa8a1..3f88017 100644 --- a/admin/script.php +++ b/admin/script.php @@ -3,6 +3,8 @@ include "../script/db.php"; session_start(); +$_SESSION['id'] = 1; + if(isset($_SESSION['id'])) { $req_user = $db->prepare("SELECT pseudo, perm FROM admin WHERE id = ?"); $req_user->execute(array($_SESSION['id'])); diff --git a/admin/ville.php b/admin/ville.php index 566aa87..f86ace2 100644 --- a/admin/ville.php +++ b/admin/ville.php @@ -4,6 +4,42 @@ include "script.php"; if($user['perm'] < 1) { header('Location: deco.php'); } + +if(isset($_POST['start1'])) { + $req = $db->prepare("UPDATE ville SET state = ?, time_begin = ? WHERE session = 1"); + $req->execute(array(1, time())); + header('Refresh: 0'); +} +if(isset($_POST['start2'])) { + $req = $db->prepare("UPDATE ville SET state = ?, time_begin = ? WHERE session = 2"); + $req->execute(array(1, time())); + header('Refresh: 0'); +} + +if(isset($_POST['stop1'])) { + $req = $db->query("UPDATE ville SET state = 2 WHERE session = 1"); + header('Refresh: 0'); +} +if(isset($_POST['stop2'])) { + $req = $db->query("UPDATE ville SET state = 2 WHERE session = 2"); + header('Refresh: 0'); +} + +if(isset($_POST['reset1'])) { + if(htmlspecialchars($_POST['code']) == "anti-missclick") { + $req = $db->query("UPDATE ville SET state = 0, time_begin = 0 WHERE session = 1"); + $req = $db->query("UPDATE ville_equipe SET temps = NULL WHERE id < 17"); + header('Refresh: 0'); + } +} +if(isset($_POST['reset2'])) { + if(htmlspecialchars($_POST['code']) == "anti-missclick") { + $req = $db->query("UPDATE ville SET state = 0, time_begin = 0 WHERE session = 2"); + $req = $db->query("UPDATE ville_equipe SET temps = NULL WHERE id > 16"); + header('Refresh: 0'); + } +} + ?> @@ -14,49 +50,133 @@ if($user['perm'] < 1) {
- yo, ça arrive mais calmos les enfants, c'est en cours de dev no problem ce sera plus jolie que ça plus tard

+ + Session matin + Session aprem +
+ query("SELECT state FROM ville WHERE session = 1"); + $r = $req -> fetchAll(PDO::FETCH_ASSOC); - - - - query('SELECT id, nom, begin, avancement, temps FROM ville_equipe'); - while($equipe = $req->fetch()) { - ?> - - - - - - - - -
ID (db) - nom - première étape - avancement (nombre d'étape réussit) - temps -


+ if($r[0]['state'] == 0) { + ?> + Session non demarré, +
+
+ + + Session en cours, +
+
+ + + Session terminé, +
+ +
+ + - - - - query('SELECT id, indice, reponse, photo FROM ville_epreuve'); - while($epreuve = $req->fetch()) { - ?> + + query('SELECT id, nom FROM ville_equipe WHERE id < 17'); + while($equipe = $reqint->fetch()) { + ?> + + + + + Session matin + Session aprem +
+ query("SELECT state FROM ville WHERE session = 2"); + $r = $req -> fetchAll(PDO::FETCH_ASSOC); + + if($r[0]['state'] == 0) { + ?> + Session non demarré, + + + + + Session en cours, + + + + + Session terminé, + + + + + + + + + + + + + + + + + + + + + Session matin + + Session aprem + +
ID (db) - Indice - reponse - photos -
- - - - + - -
no photos"; }?>ID (db) + Indice + reponse + photos
+ query('SELECT id, indice, reponse, photo FROM ville_epreuve'); + while($epreuve = $req->fetch()) { + ?> + + + + + no photos"; }?> + + + + +
\ No newline at end of file