debug
This commit is contained in:
67
gestion/saisieVotes.php
Normal file
67
gestion/saisieVotes.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
require_once '../session_init.php';
|
||||
require_once 'config.inc.php';
|
||||
require_once 'db.class.php';
|
||||
require_once 'entete.php';
|
||||
require_once 'fonctions.inc.php';
|
||||
|
||||
$path = $_SERVER["PHP_SELF"];
|
||||
$db = new db();
|
||||
|
||||
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"];
|
||||
}
|
||||
|
||||
$idVotation = getpost("id");
|
||||
if (!empty($idVotation))
|
||||
{
|
||||
$_SESSION["idVotation"] = $idVotation;
|
||||
$votationName = queryVotationName($db, $idVotation);
|
||||
}elseif (array_key_exists("idVotation", $_SESSION))
|
||||
{
|
||||
if (!empty($_SESSION["idVotation"]))
|
||||
{
|
||||
$idVotation = $_SESSION["idVotation"];
|
||||
$votationName = queryVotationName($db, $idVotation);
|
||||
}
|
||||
}
|
||||
|
||||
print('<br><br>
|
||||
<!-- lalis Grid Section -->
|
||||
<section id="content">
|
||||
<div class="container">') . EOL;
|
||||
print(' <div class="row">
|
||||
<div class="col-lg-12 text-center">
|
||||
<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))
|
||||
{
|
||||
votesForm($path);
|
||||
}else
|
||||
{
|
||||
$query = "INSERT INTO liste_votes ('libelle', 'method', 'id_votation') VALUES ('" . $libelle . "', '" . $method . "', '" . $idVotation . "')";
|
||||
print($query);
|
||||
//$db->query($query);
|
||||
}
|
||||
}
|
||||
$db->close();
|
||||
|
||||
print(' </div>
|
||||
</div>
|
||||
</div>
|
||||
</section>');
|
||||
require_once("footer.html");
|
||||
|
||||
?>
|
Reference in New Issue
Block a user