1
0
This commit is contained in:
Daniel Tartavel 2022-09-19 15:59:24 +02:00
parent 70f82f66ba
commit 6bd179968a

View File

@ -5,13 +5,27 @@ require_once 'db.class.php';
require_once 'entete.php';
require_once 'fonctions.inc.php';
$path = $_SERVER["PHP_SELF"];
$db = new db();
$idVotation = getpost("id");
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"];
}
$query = "SELECT libelle FROM liste_votations WHERE id='" . $idVotation . "'";
$db->query($query);
$votationName = $db->result->fetch_assoc();
$idVotation = getpost("id");
if (!empty($idVotation))
{
$GLOBALS["idVotation"] = $idVotation;
$votationName = queryVotationName($db, $idVotation);
}elseif (array_key_exists("idVotation", $GLOBALS))
{
$idVotation = $GLOBALS["idVotation"];
$votationName = queryVotationName($db, $idVotation);
}
print('<br><br>
<!-- lalis Grid Section -->
@ -19,22 +33,14 @@ print('<br><br>
<div class="container">') . EOL;
print(' <div class="row">
<div class="col-lg-12 text-center">
<h3>Nouveau vote pour la votation : ' . $votationName["libelle"]. '</h3>');
$path = $_SERVER["PHP_SELF"];
print
if (array_key_exists("idVotation", $GLOBALS) and empty($idVotation))
{
$idVotation = $GLOBALS["idVotation"];
}
<h3>Nouveau vote pour la votation');
if (empty($idVotation))
{
choixVotation($path, 0, false);
}else
{
print(": " . $votationName . '</h3>' . EOL);
$method = getpost("method");
$libelle = getpost("libelle");
if (empty($method) or empty($libelle))