debug
This commit is contained in:
parent
5af2b1a10e
commit
bb7d54afc8
@ -2,7 +2,6 @@
|
||||
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"];
|
||||
@ -25,19 +24,36 @@ function queryVotes($db, $idVotation)
|
||||
}
|
||||
|
||||
$idVotation = getpost("id");
|
||||
$method = getpost("method");
|
||||
$libelle = getpost("libelle");
|
||||
|
||||
|
||||
if (!empty($idVotation))
|
||||
{
|
||||
$_SESSION["idVotation"] = $idVotation;
|
||||
$votationName = queryVotationName($db, $idVotation);
|
||||
}elseif (array_key_exists("idVotation", $_SESSION))
|
||||
{
|
||||
if (!empty($_SESSION["idVotation"]))
|
||||
if (!empty($method) and !empty($libelle))
|
||||
{
|
||||
$idVotation = $_SESSION["idVotation"];
|
||||
$query = "INSERT INTO liste_votes VALUES (0, '" . $libelle . "', " . $method . "," . $idVotation . ")";
|
||||
$db->query($query);
|
||||
header("Location: " . $$base_url . "/" . $path , TRUE, 301);
|
||||
return;
|
||||
}else
|
||||
{
|
||||
$_SESSION["idVotation"] = $idVotation;
|
||||
$votationName = queryVotationName($db, $idVotation);
|
||||
}
|
||||
}else
|
||||
{
|
||||
if (array_key_exists("idVotation", $_SESSION))
|
||||
{
|
||||
if (!empty($_SESSION["idVotation"]))
|
||||
{
|
||||
$idVotation = $_SESSION["idVotation"];
|
||||
$votationName = queryVotationName($db, $idVotation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require_once 'entete.php';
|
||||
print('<br><br>
|
||||
<!-- lalis Grid Section -->
|
||||
<section id="content">
|
||||
@ -58,7 +74,7 @@ if (!empty($votes))
|
||||
echo EOLH . EOLH;
|
||||
}
|
||||
|
||||
print(' <h3>Nouveau vote pour la votation');
|
||||
print('<h3>Nouveau vote pour la votation');
|
||||
|
||||
if (empty($idVotation))
|
||||
{
|
||||
@ -66,20 +82,16 @@ if (empty($idVotation))
|
||||
}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 VALUES (0, '" . $libelle . "', " . $method . "," . $idVotation . ")";
|
||||
print($query);
|
||||
$db->query($query);
|
||||
|
||||
}
|
||||
}
|
||||
$db->close();
|
||||
|
||||
print(' </div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user