') . EOL;
print('
-
Nouveau vote
- ');
+ Nouveau vote
');
+
+$path = $_SERVER["PHP_SELF"];
+$idVotation = getpost("id");
+
if (empty($idVotation))
{
if (array_key_exists("idVotation", $GLOBALS))
@@ -25,8 +26,20 @@ if (empty($idVotation))
choixVotation($path);
}
}
-print("
");
-votesForm($path);
+
+$method = getpost("method");
+$libelle = getpost("libelle");
+if (empty($method) or empty($libelle))
+{
+ votesForm($path);
+}else
+{
+ $db = new db();
+ $query = "INSERT INTO liste_votes ('libelle', 'method', 'id_votation') VALUES ('" . $libelle . "', '" . $method . "', '" . $idVotation . "')";
+ print($query);
+ //$db->query($query);
+ $db->close;
+}
print('
diff --git a/include/fonctions.inc.php b/include/fonctions.inc.php
index 6fed846..de7ec8b 100644
--- a/include/fonctions.inc.php
+++ b/include/fonctions.inc.php
@@ -115,7 +115,7 @@ function votesForm($path, $libelle = "", $method = 0)