From 86b0ef046f22edc80b62f762794f98b6036a88d6 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Wed, 21 Sep 2022 21:12:49 +0200 Subject: [PATCH] adding list of votes --- gestion/.htaccess | 2 +- gestion/saisieVotes.php | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gestion/.htaccess b/gestion/.htaccess index 8b5a076..633be5f 100644 --- a/gestion/.htaccess +++ b/gestion/.htaccess @@ -2,6 +2,6 @@ Options -Indexes AuthName "back_office" AuthBasicProvider file AuthType Basic -AuthUserFile "/var/www/html/vote/gestionsite/.htpasswd" +AuthUserFile "/var/www/html/vote/gestion/.htpasswd" require valid-user diff --git a/gestion/saisieVotes.php b/gestion/saisieVotes.php index eb627ba..ad0b8ee 100644 --- a/gestion/saisieVotes.php +++ b/gestion/saisieVotes.php @@ -18,7 +18,7 @@ function queryVotationName($db, $idVotation) :string return $votationLine["libelle"]; } -function queryVotes($db, $idVotation) :array +function queryVotes($db, $idVotation) { $query = "SELECT * FROM liste_votes WHERE id='" . $idVotation . "'"; $db->query($query); @@ -47,11 +47,14 @@ print('

print('
'); $votes = queryVotes($db, $idVotation); -foreach ($votes as $value) +if (!empty($votes)) { - print ($value[0] . " " . $value[1] . EOLH); -} + foreach ($votes as $value) + { + print ($value[0] . " " . $value[1] . EOLH); + } echo EOLH . EOLH; +} print('

Nouveau vote pour la votation');