debug
This commit is contained in:
		| @@ -18,6 +18,14 @@ function queryVotationName($db, $idVotation) :string | ||||
| 	return $votationLine["libelle"]; | ||||
| } | ||||
|  | ||||
| function queryVotes($db, $idVotation) :array | ||||
| { | ||||
| 	$query = "SELECT * FROM liste_votes WHERE id='" . $idVotation . "'"; | ||||
| 	$db->query($query); | ||||
| 	$votes = $db->result->fetch_assoc(); | ||||
| 	return $votes; | ||||
| } | ||||
|  | ||||
| $idVotation = getpost("id"); | ||||
| if (!empty($idVotation)) | ||||
| { | ||||
| @@ -37,8 +45,15 @@ print('<br><br> | ||||
| 	<section id="content"> | ||||
| 		<div class="container">') . EOL; | ||||
| print('			  <div class="row"> | ||||
| 					<div class="col-lg-12 text-center"> | ||||
| 						<h3>Nouveau vote pour la votation'); | ||||
| 					<div class="col-lg-12 text-center">'); | ||||
| $votes = queryVotes($db, $idVotation); | ||||
| foreach ($votes as $value) | ||||
| { | ||||
| 	print ($value[0] . " " . $value[1] . EOLH); | ||||
| } | ||||
| echo EOLH . EOLH; | ||||
|  | ||||
| print('						<h3>Nouveau vote pour la votation'); | ||||
|  | ||||
| if (empty($idVotation)) | ||||
| { | ||||
| @@ -53,9 +68,9 @@ if (empty($idVotation)) | ||||
| 		votesForm($path); | ||||
| 	}else | ||||
| 	{ | ||||
| 			$query = "INSERT INTO liste_votes ('libelle', 'method', 'id_votation') VALUES ('" . $libelle . "', '" . $method . "', '" . $idVotation . "')"; | ||||
| 			print($query); | ||||
| 			//$db->query($query); | ||||
| 		$query = "INSERT INTO liste_votes ('libelle', 'method', 'id_votation') VALUES ('" . $libelle . "', '" . $method . "', '" . $idVotation . "')"; | ||||
| 		print($query); | ||||
| 		$db->query($query); | ||||
| 	} | ||||
| } | ||||
| $db->close(); | ||||
|   | ||||
| @@ -125,7 +125,7 @@ function votesForm($path, $libelle = "", $method = 0) | ||||
| 	foreach ($methods as $value) | ||||
| 	{ | ||||
| 		$id = $value["id"]; | ||||
| 		if ($id == $method)/saisieVotes.php | ||||
| 		if ($id == $method) | ||||
| 		{ | ||||
| 			print('<option value ="' . $id . '" selected>' . $value["libelle"] . '</option>' . EOL); | ||||
| 		}else | ||||
|   | ||||
		Reference in New Issue
	
	Block a user