'."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''.NOMAPPLICATION.''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; logo(); bandeau_tete(); bandeau_titre(_("Error!")); echo '
'."\n"; print "

" . _("You haven't filled the first section of the poll creation.") . " !

"."\n"; print "" . _("Back to the homepage of ") . " ".NOMAPPLICATION."."."\n"; echo '


'."\n"; echo '
'."\n"; //bandeau de pied bandeau_pied(); echo ''."\n"; echo ''."\n"; } else { //partie creation du sondage dans la base SQL //On prépare les données pour les inserer dans la base $erreur = false; $testdate = true; $date_selected = ''; if (isset($_POST["confirmecreation"]) || isset($_POST["confirmecreation_x"])) { //recuperation des données de champs textes $toutchoix = ''; for ($i = 0; $i < $_SESSION["nbrecases"] + 1; $i++) { if (isset($_POST["choix"]) && issetAndNoEmpty($i, $_POST["choix"])) { $toutchoix.=','; $toutchoix.=str_replace(",", " ", htmlentities(html_entity_decode($_POST["choix"][$i], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8')); } } $toutchoix=substr("$toutchoix",1); $_SESSION["toutchoix"]=$toutchoix; if (issetAndNoEmpty('champdatefin')) { $registredate=explode("/",$_POST["champdatefin"]); if (is_array($registredate) === false || count($registredate) !== 3) { $testdate = false; $date_selected = $_POST["champdatefin"]; } else { $time = mktime(0,0,0,$registredate[1],$registredate[0],$registredate[2]); if ($time === false || date('d/m/Y', $time) !== $_POST["champdatefin"]) { $testdate = false; $date_selected = $_POST["champdatefin"]; } else { if (mktime(0,0,0,$registredate[1],$registredate[0],$registredate[2]) > time() + 250000) { $_SESSION["champdatefin"]=mktime(0,0,0,$registredate[1],$registredate[0],$registredate[2]); } } } } else { $_SESSION["champdatefin"]=time()+15552000; } if ($testdate === true) { //format du sondage AUTRE $_SESSION["formatsondage"]="A".$_SESSION["studsplus"]; ajouter_sondage(); } else { $_POST["fin_sondage_autre"] = 'ok'; } } // recuperation des sujets pour sondage AUTRE $erreur_injection = false; if (isset($_SESSION["nbrecases"])) { for ($i = 0; $i < $_SESSION["nbrecases"]; $i++) { if (isset($_POST["choix"]) && isset($_POST["choix"][$i])) { $_SESSION["choix$i"]=htmlentities(html_entity_decode($_POST["choix"][$i], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8'); } } } else { //nombre de cases par défaut $_SESSION["nbrecases"]=10; } if (isset($_POST["ajoutcases"]) || isset($_POST["ajoutcases_x"])) { $_SESSION["nbrecases"]=$_SESSION["nbrecases"]+5; } print_header(); echo ''."\n"; echo '
'."\n"; logo(); bandeau_tete(); bandeau_titre(_("Poll subjects (2 on 2)")); sous_bandeau_choix(); echo '
'."\n"; echo '
'. _("Your poll aim is to make a choice between different subjects.
Enter the subjects to vote for:") .'

'."\n"; echo ''."\n"; //affichage des cases texte de formulaire for ($i = 0; $i < $_SESSION["nbrecases"]; $i++) { $j = $i + 1; if (isset($_SESSION["choix$i"]) === false) { $_SESSION["choix$i"] = ''; } echo ''."\n"; } echo '
'. _("Choice") .' '.$j.' :
'."\n"; //focus javascript sur premiere case echo ''."\n"; //ajout de cases supplementaires echo ''."\n"; echo ''."\n"; echo '
'. _("5 choices more") .'
'."\n"; echo'
'."\n"; echo ''."\n"; echo ''."\n"; echo '
'. _("Next") .'
'."\n"; //test de remplissage des cases $testremplissage = ''; for ($i=0;$i<$_SESSION["nbrecases"];$i++) { if (isset($_POST["choix"]) && issetAndNoEmpty($i, $_POST["choix"])) { $testremplissage="ok"; } } //message d'erreur si aucun champ renseigné if ($testremplissage != "ok" && (isset($_POST["fin_sondage_autre"]) || isset($_POST["fin_sondage_autre_x"]))) { print "
" . _("Enter at least one choice") . "

"."\n"; $erreur = true; } //message d'erreur si mauvaise date if ($testdate === false) { print "
" . _("Date must be have the format DD/MM/YYYY") . "

"."\n"; } if ($erreur_injection) { print "" . _("Characters \" < and > are not permitted") . "

\n"; } if ((isset($_POST["fin_sondage_autre"]) || isset($_POST["fin_sondage_autre_x"])) && !$erreur && !$erreur_injection) { //demande de la date de fin du sondage echo '
'."\n"; echo '
'."\n"; echo '
'. _("Your poll will be automatically removed after 6 months.
You can fix another removal date for it.") .'

'."\n"; echo _("Removal date (optional)") .' : '. _("(DD/MM/YYYY)") ."\n"; echo '
'."\n"; echo '
'."\n"; echo ''. _("Once you have confirmed the creation of your poll, you will be automatically redirected on the page of your poll.

Then, you will receive quickly an email contening the link to your poll for sending it to the voters.") .'
'."\n"; echo '
'."\n"; echo '
'."\n"; echo ''."\n"; echo ''."\n"; echo '
'. _("Create the poll") .'
'."\n"; } //fin du formulaire et bandeau de pied echo ''."\n"; echo ''."\n"; echo '


'."\n"; echo '
'."\n"; //bandeau de pied bandeau_pied_mobile(); echo ''."\n"; echo ''."\n"; }