added saisie votes et candidats
This commit is contained in:
		| @@ -113,20 +113,44 @@ class dbcore | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	function queryVotationName($db, $idVotation) :string | ||||
| 	function queryVoteName($idVote) | ||||
| 	{ | ||||
| 		$query = "SELECT libelle FROM liste_votes where id='" . $idVote . "'"; | ||||
| 		$this->query($query); | ||||
| 		$voteLine = $this->result->fetch_assoc(); | ||||
| 		return $voteLine["libelle"]; | ||||
| 	} | ||||
|  | ||||
| 	function queryVotationName($idVotation) :string | ||||
| 	{ | ||||
| 		$query = "SELECT libelle FROM liste_votations WHERE id='" . $idVotation . "'"; | ||||
| 		$db->query($query); | ||||
| 		$votationLine = $db->result->fetch_assoc(); | ||||
| 		$this->query($query); | ||||
| 		$votationLine = $this->result->fetch_assoc(); | ||||
| 		return $votationLine["libelle"]; | ||||
| 	} | ||||
|  | ||||
| 	function queryVotes($db, $idVotation) | ||||
| 	function queryVotes($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(); | ||||
| 		$this->query($query); | ||||
| 		$votes = $this->result->fetch_all(); | ||||
| 		return $votes; | ||||
| 	} | ||||
|  | ||||
| 	function queryCandidatsList($idVotation, $idVote) | ||||
| 	{ | ||||
| 		$query = "SELECT * FROM liste_candidats WHERE idVotation='" . $idVotation . "' AND idVote='" . $idVote . "'"; | ||||
| 		$this->query($query); | ||||
| 		$candidats = $this->result->fetch_all(); | ||||
| 		return $candidats; | ||||
| 	} | ||||
| } | ||||
|  | ||||
| 	function queryCandidatName($idCandidat) | ||||
| 	{ | ||||
| 		$query = "SELECT libelle FROM liste_candidats where id='" . $idCandidat . "'"; | ||||
| 		$this->query($query); | ||||
| 		$line = $this->result->fetch_assoc(); | ||||
| 		return $line["candidat"]; | ||||
| 	} | ||||
| ?> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user