From ae357e7e954f76ef822a241a864a5264a307857e Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Mon, 26 Sep 2022 11:39:41 +0200 Subject: [PATCH] added comment for candidats --- gestion/saisieCandidats.php | 18 +++++++++++++----- include/fonctions.inc.php | 2 ++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/gestion/saisieCandidats.php b/gestion/saisieCandidats.php index 06ff106..0dda1f3 100644 --- a/gestion/saisieCandidats.php +++ b/gestion/saisieCandidats.php @@ -10,10 +10,11 @@ $db = new db(); $idVotation = getpost("idVotation"); $idVote = getpost("idVote"); $candidat = getpost("candidat"); +$libelle = getpost("libelle"); if (!empty($idCandidat)) { - $query = "INSERT INTO liste_candidats VALUES (0, " . $idVotation . ", " . $idVote . ",'" . $candidat . "')"; + $query = "INSERT INTO liste_candidats VALUES (0, " . $idVotation . ", " . $idVote . ",'" . $libelle . "', '". $candidat . "')"; $db->query($query); header("Location: " . $$base_url . "/" . $path , TRUE, 301); return; @@ -38,11 +39,18 @@ if (!empty($idCandidat)) $votationName = $db->queryVotationName($idVotation); $voteName = $db->queryVoteName($idVote); $candidatsList = $db->queryCandidatsList($idVotation, $idVote); - print('

Nouveau candidat pour le vote ' . $voteName . ' de la votation ' . $votationName . '

'); - print('Liste des candidats'); - foreach($candidatsList as $line) + + print('

Nouveau candidat pour le vote "' . $voteName . '" de la votation "' . $votationName . '"

'); + if (empty($candidatsList)) { - print($line["libelle"] . EOLH); + print("Aucun candidats saisi pour l'instant" . EOLH); + }else + { + print('Liste des candidats'); + foreach($candidatsList as $line) + { + print($line["libelle"] . EOLH); + } } candidatsForm($path, $idVotation, $idVote); } diff --git a/include/fonctions.inc.php b/include/fonctions.inc.php index 7f13005..5ad77e6 100644 --- a/include/fonctions.inc.php +++ b/include/fonctions.inc.php @@ -161,6 +161,8 @@ function candidatsForm($path, $idVotation, $idVote) print(''); print(''); print('
') . EOLH; + print('
') . EOLH; + print('') . EOLH; print('') . EOLH; }