modifying index.php
This commit is contained in:
@ -113,12 +113,16 @@ class dbcore
|
||||
}
|
||||
}
|
||||
|
||||
function queryVoteName($idVote)
|
||||
function queryVotationList()
|
||||
{
|
||||
$query = "SELECT libelle FROM liste_votes where id='" . $idVote . "'";
|
||||
$query = "SELECT * FROM liste_votations";
|
||||
$this->query($query);
|
||||
$voteLine = $this->result->fetch_assoc();
|
||||
return $voteLine["libelle"];
|
||||
$votationLine = $this->result->fetch_all(MSQLI_ASSOC);
|
||||
foreach ($votationLine as $line)
|
||||
{
|
||||
$votationList[$line["id"]] = $line;
|
||||
}
|
||||
return $votationList;
|
||||
}
|
||||
|
||||
function queryVotationName($idVotation) :string
|
||||
@ -129,11 +133,31 @@ class dbcore
|
||||
return $votationLine["libelle"];
|
||||
}
|
||||
|
||||
function queryVoteList($idVotation)
|
||||
{
|
||||
$query = "SELECT * FROM liste_votes WHERE idVotation = " . idVotation;
|
||||
$this->query($query);
|
||||
$votes = $this->result->fetch_all(MSQLI_ASSOC);
|
||||
foreach ($votes as $line)
|
||||
{
|
||||
$votesList[$line["id"]] = $line;
|
||||
}
|
||||
return $votesList;
|
||||
}
|
||||
|
||||
function queryVoteName($idVote)
|
||||
{
|
||||
$query = "SELECT libelle FROM liste_votes WHERE id='" . $idVote . "'";
|
||||
$this->query($query);
|
||||
$voteLine = $this->result->fetch_assoc();
|
||||
return $voteLine["libelle"];
|
||||
}
|
||||
|
||||
function queryVotes($idVotation)
|
||||
{
|
||||
$query = "SELECT * FROM liste_votes LEFT JOIN methods ON liste_votes.methode=methods.id WHERE idVotation='" . $idVotation . "'";
|
||||
$query = "SELECT id, lv.libelle, ms.libelle as methode FROM liste_votes as lv LEFT JOIN methods as ms ON lv.methode=ms.id WHERE idVotation='" . $idVotation . "'";
|
||||
$this->query($query);
|
||||
$votes = $this->result->fetch_all();
|
||||
$votes = $this->result->fetch_all(MSQLI_ASSOC);
|
||||
return $votes;
|
||||
}
|
||||
|
||||
@ -142,7 +166,11 @@ class dbcore
|
||||
$query = "SELECT * FROM liste_candidats WHERE idVotation='" . $idVotation . "' AND idVote='" . $idVote . "'";
|
||||
$this->query($query);
|
||||
$candidats = $this->result->fetch_all(MYSQLI_ASSOC);
|
||||
return $candidats;
|
||||
foreach ($candidats as $line)
|
||||
{
|
||||
$candidatsList[$line["id"]] = $line;
|
||||
}
|
||||
return $candidatsList;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -264,4 +264,10 @@ function listeVotants($idVotation, $idVote, $listeAdherents)
|
||||
$db->close();
|
||||
}
|
||||
|
||||
function printLine($path, $request, $libelle, $modif=true, $delete=false)
|
||||
{
|
||||
print('<a href="' . $vote_url . $path . $request . '>' . $libelle . '</a>');
|
||||
if ($modif) print('<a href=""');
|
||||
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user