forked from rebillar/site-accueil-insa
preparation du backend pour ajouter des epreuves
This commit is contained in:
parent
a081f946ec
commit
f9296798c1
1 changed files with 22 additions and 4 deletions
|
@ -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'])) {
|
|||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
/*
|
||||
TODO : FAIRE UN SCRIPT POUR AJOUTER DES EPREUVES ET EQUIPES DEPUIS LE PANEAU D'ADMIN
|
||||
*/
|
||||
|
||||
|
||||
|
||||
if(isset($_GET['session']) AND !empty($_GET['session']))
|
||||
{
|
||||
$session = (int) htmlspecialchars($_GET['session']);
|
||||
if($session == 1) {
|
||||
?>
|
||||
|
||||
<form me
|
||||
<a href="ville.php?session=1" class="href_session_selected">Session matin</a>
|
||||
<a href="ville.php?session=2" class="href_session">Session aprem</a>
|
||||
<br>
|
||||
|
|
Loading…
Reference in a new issue