diff --git a/gestion/saisieVotes.php b/gestion/saisieVotes.php
index 0f4e36b..b2282c4 100644
--- a/gestion/saisieVotes.php
+++ b/gestion/saisieVotes.php
@@ -7,21 +7,7 @@ require_once 'fonctions.inc.php';
$path = $_SERVER["PHP_SELF"];
$db = new db();
-function queryVotationName($db, $idVotation) :string
-{
- $query = "SELECT libelle FROM liste_votations WHERE id='" . $idVotation . "'";
- $db->query($query);
- $votationLine = $db->result->fetch_assoc();
- return $votationLine["libelle"];
-}
-function queryVotes($db, $idVotation)
-{
- $query = "SELECT * FROM liste_votes LEFT JOIN methods ON liste_votes.methode=methods.id WHERE idVotation='" . $idVotation . "'";
- $db->query($query);
- $votes = $db->result->fetch_all();
- return $votes;
-}
$idVotation = getpost("id");
$method = getpost("method");
@@ -39,7 +25,7 @@ if (!empty($idVotation))
}else
{
$_SESSION["idVotation"] = $idVotation;
- $votationName = queryVotationName($db, $idVotation);
+ $votationName = $db->queryVotationName($db, $idVotation);
}
}else
{
@@ -48,7 +34,7 @@ if (!empty($idVotation))
if (!empty($_SESSION["idVotation"]))
{
$idVotation = $_SESSION["idVotation"];
- $votationName = queryVotationName($db, $idVotation);
+ $votationName = $db->queryVotationName($db, $idVotation);
}
}
}
@@ -61,11 +47,11 @@ print('
print('
"); - print("vote | méthode | méthode | "); foreach ($votes as $value) { print ("
" . $value[1] . " | " . $value[5] . " |