From f9296798c14ebf2c310a2a20ad8f6daa13240648 Mon Sep 17 00:00:00 2001 From: thaaoblues Date: Wed, 10 May 2023 20:54:11 +0200 Subject: [PATCH] preparation du backend pour ajouter des epreuves --- admin/ville.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/admin/ville.php b/admin/ville.php index 15289ff..d7917a3 100644 --- a/admin/ville.php +++ b/admin/ville.php @@ -18,6 +18,23 @@ if(isset($_POST['start2'])) { header('Refresh: 0'); } +/* + TODO : FAIRE UN SCRIPT POUR AJOUTER DES EPREUVES ET EQUIPES DEPUIS LE PANEAU D'ADMIN +*/ + +// ajout d'une epreuve +if(isset($_POST['add_epreuve'])){ + $req = $db->prepare("INSERT INTO ville_equipe(indice,reponse,photo) VALUES(?,?,?)"); + $req->execute($_POST['indice'],$_POST['reponse'],'assets/img/ville/'.htmlspecialchars($_POST['photo'])); +} + +//ajout d'une equipe +if(isset($_POST['add_equipe'])){ + $req = $db->prepare("INSERT INTO ville_equipe(nom,begin,temps) VALUES(?,?,?)"); + $req->execute($_POST['nom'],$_POST['begin'],$_POST['temps']); +} + + if(isset($_POST['stop1'])) { $req = $db->query("UPDATE ville SET state = 2 WHERE session = 1"); header('Refresh: 0'); @@ -56,16 +73,17 @@ if(isset($_POST['reset2'])) { - + +
Session matin Session aprem