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