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

' . _("Back to the homepage of ") . ' ' . NOMAPPLICATION . '

'."\n"; bandeau_pied(); } else { // Step 4 : Data prepare before insert in DB if (isset($_POST["confirmecreation"])) { //recuperation des données de champs textes $temp_results = ''; if (isset($_SESSION['choices'])) { for ($i = 0; $i < count($_SESSION['choices']); $i++) { if ($_SESSION['choices'][$i]!="") { $temp_results.=','.str_replace(",", " ", htmlentities(html_entity_decode($_SESSION['choices'][$i], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8')); } } } $temp_results=substr($temp_results,1); $_SESSION["toutchoix"]=$temp_results; // Expiration date → after 6 months if not filled or in bad format $_SESSION["champdatefin"]=time()+15552000; if (Utils::issetAndNoEmpty('champdatefin')) { $registredate = explode("/",$_POST["champdatefin"]); if (is_array($registredate) == true && count($registredate) == 3) { $time = mktime(0,0,0,$registredate[1],$registredate[0],$registredate[2]); if ($time > time() + (24*60*60)) { $_SESSION["champdatefin"]=$time; } } } //format du sondage AUTRE $_SESSION["formatsondage"]="A".$_SESSION["studsplus"]; ajouter_sondage(); } // recuperation des sujets pour sondage AUTRE if (isset($_POST['choices'])) { $k = 0; for ($i = 0; $i < count($_POST['choices']); $i++) { if (Utils::issetAndNoEmpty($i, $_POST['choices'])) { $_SESSION['choices'][$k]=htmlentities(html_entity_decode($_POST['choices'][$i], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8'); $k++; } } } // Step 3/3 : Confirm poll creation and choose a removal date if (isset($_POST["fin_sondage_autre"])) { Utils::print_header ( _("Removal date and confirmation (3 on 3)") ); bandeau_titre(_("Removal date and confirmation (3 on 3)")); $removal_date=strftime(_("%A, den %e. %B %Y"), time()+15552000); // Sumary $summary = '
    '; for ($i=0;$i'.$li_subject_text.''; } elseif (isset($md_img[2][0]) && $md_img[2][0]!='') { // ![alt](src) $li_subject_text = (isset($md_img[1][0]) && $md_img[1][0]!='') ? stripslashes($md_img[1][0]) : _("Choice") .' '.($i+1); $li_subject_html = ''.$li_subject_text.''; } elseif (isset($md_a[2][0]) && $md_a[2][0]!='') { // [text](href) $li_subject_text = (isset($md_a[1][0]) && $md_a[1][0]!='') ? stripslashes($md_a[1][0]) : _("Choice") .' '.($i+1); $li_subject_html = ''.$li_subject_text.''; } else { // text only $li_subject_text = stripslashes($_SESSION['choices'][$i]); $li_subject_html = $li_subject_text; } $summary .= '
  1. '.$li_subject_html.'
  2. '."\n"; } $summary .= '
'; echo '

'. _("List of your choices").'

'. $summary .'

' . _("Your poll will be automatically removed after 6 months:") . ' '.$removal_date.'.
' . _("You can fix another removal date for it.") .'

'. _("(dd/mm/yyyy)") .'

'. _("Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll."). '

' . _("Then, you will receive quickly two emails: one contening the link of your poll for sending it to the voters, the other contening the link to the administration page of your poll.") .'

'."\n"; bandeau_pied(); // Step 2/3 : Select choices of the poll } else { Utils::print_header( _("Poll subjects (2 on 3)")); bandeau_titre(_("Poll subjects (2 on 3)")); echo '
'; echo '

'. _("To make a generic poll you need to propose at least two choices between differents subjects.") .'

'. _("You can add or remove additional choices with the buttons") .' '. _("Remove") .' '. _("Add") .'

'. _("It's possible to propose links or images by using "). ''. _("the Markdown syntax") .'.

'."\n"; // Fields choices : 5 by default $nb_choices = (isset($_SESSION['choices'])) ? max(count($_SESSION['choices']), 5) : 5; for ($i = 0; $i < $nb_choices; $i++) { $choice_value = (isset($_SESSION['choices'][$i])) ? str_replace("\\","",$_SESSION['choices'][$i]) : ''; echo '
 
'."\n"; } echo '
'. _('Back') . '
'."\n"; bandeau_pied(); } }