1
0

adding list of votes

This commit is contained in:
Daniel Tartavel 2022-09-21 21:12:49 +02:00
parent de10eb8046
commit 86b0ef046f
2 changed files with 8 additions and 5 deletions

View File

@ -2,6 +2,6 @@ Options -Indexes
AuthName "back_office" AuthName "back_office"
AuthBasicProvider file AuthBasicProvider file
AuthType Basic AuthType Basic
AuthUserFile "/var/www/html/vote/gestionsite/.htpasswd" AuthUserFile "/var/www/html/vote/gestion/.htpasswd"
require valid-user require valid-user

View File

@ -18,7 +18,7 @@ function queryVotationName($db, $idVotation) :string
return $votationLine["libelle"]; return $votationLine["libelle"];
} }
function queryVotes($db, $idVotation) :array function queryVotes($db, $idVotation)
{ {
$query = "SELECT * FROM liste_votes WHERE id='" . $idVotation . "'"; $query = "SELECT * FROM liste_votes WHERE id='" . $idVotation . "'";
$db->query($query); $db->query($query);
@ -47,11 +47,14 @@ print('<br><br>
print(' <div class="row"> print(' <div class="row">
<div class="col-lg-12 text-center">'); <div class="col-lg-12 text-center">');
$votes = queryVotes($db, $idVotation); $votes = queryVotes($db, $idVotation);
if (!empty($votes))
{
foreach ($votes as $value) foreach ($votes as $value)
{ {
print ($value[0] . " " . $value[1] . EOLH); print ($value[0] . " " . $value[1] . EOLH);
} }
echo EOLH . EOLH; echo EOLH . EOLH;
}
print(' <h3>Nouveau vote pour la votation'); print(' <h3>Nouveau vote pour la votation');