diff --git a/gestionsite/saisieVotation.php b/gestionsite/saisieVotation.php
index 2d68fa3..6e412c7 100644
--- a/gestionsite/saisieVotation.php
+++ b/gestionsite/saisieVotation.php
@@ -17,12 +17,19 @@ print('
Nouvelle votation
');
-if (array_key_exists("titre", $_GET))
+$titre = getpost("titre");
+$libelle = getpost("libelle");
+$dateDebut = getpost("dateDebut");
+$dateFin = getpost("dateFin");
+
+if ($titre !== null and $libelle!== null and $dateDebut!== null and $dateFin !== null)
{
- var_dump($_get);
+ $db = new db();
+ $query = "INSERT INTO liste_votations ('titre', 'libelle', 'status', 'dateDebut', 'dateFin') VALUES('" . $titre . "', '" . $libelle . "', '0', '" . $dateDebut . "', '" . $dateFin . "')"; // clotûre
+ $db->query($query);
}else
{
- votationForm($path);
+ votationForm($path, $titre, $libelle, $dateDebut, $dateFin);
}
print('
diff --git a/gestionsite/saisieVotes.php b/gestionsite/saisieVotes.php
new file mode 100644
index 0000000..3a084d2
--- /dev/null
+++ b/gestionsite/saisieVotes.php
@@ -0,0 +1,40 @@
+
+
+
+
+ ');
+print('
+
+
Nouveau vote
+ ');
+if (empty($idVotation))
+{
+ if (array_key_exists("idVotation", $GLOBALS))
+ {
+ $idVotation == $GLOBALS["idVotation"];
+ }else
+ {
+ choixVotation($path);
+ }
+}
+
+votesForm($path);
+
+print('
+
+
+
+ ');
+require_once("footer.html");
+
+?>
diff --git a/include/fonctions.inc.php b/include/fonctions.inc.php
index 1e000a7..f467035 100644
--- a/include/fonctions.inc.php
+++ b/include/fonctions.inc.php
@@ -30,7 +30,7 @@ function getpost( $var )
return $_POST[$var];
}else
{
- return false;
+ return null;
}
}
@@ -44,9 +44,10 @@ function mb_ucfirst($str)
return $char . $str;
}
-function choixVotation($path, $methode=2) //2 = toutes les votations 1 = votations en cours 0 = votations cloturées
+function choixVotation($path, $methode = 2, $confirm = true) //2 = toutes les votations 1 = votations en cours 0 = votations cloturées
{
global $db, $base_url, $action;
+
$query = "SELECT * FROM liste_votations";
if ($methode != 2)
{
@@ -64,7 +65,7 @@ function choixVotation($path, $methode=2) //2 = toutes les votations 1 = votat
}
$redirect .= '">';
- echo $redirect;
+ //echo $redirect;
header( 'Location: ' . $base_url . '/gestionsite/modifVotation.php?id=' . $votations["0"]["id"]) . $redirect;
}
print ('