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

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

'; bandeau_pied(); } else { // Step 4 : Data prepare before insert in DB if (Utils::issetAndNoEmpty('confirmation')) { $temp_results = array(); $choixdate = ''; if (Utils::issetAndNoEmpty('totalchoixjour', $_SESSION) === true) { for ($i = 0; $i < count($_SESSION["totalchoixjour"]); ++$i) { if(count($_SESSION['horaires'.$i])!=0) { for ($j=0; $j< min(count($_SESSION['horaires'.$i]),12); ++$j) { if ($_SESSION['horaires'.$i][$j] != '') { array_push($temp_results, $_SESSION["totalchoixjour"][$i].'@'.$_SESSION['horaires'.$i][$j]); } else { array_push($temp_results, $_SESSION["totalchoixjour"][$i]); } } } else { array_push($temp_results, $_SESSION['totalchoixjour'][$i]); } } } // Sort and remove doublons $temp_results = array_unique($temp_results); sort($temp_results); for ($i=0; $i < count($temp_results); ++$i) { if (isset($temp_results[$i])) { $choixdate .= ','. $temp_results[$i]; } } $_SESSION['toutchoix'] = substr($choixdate, 1); // Expiration date → 6 months after last day if not filled or in bad format // 86400 = 60*60*24 $_SESSION['champdatefin']=end($temp_results)+(86400 * $config['default_poll_duration']); 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() + 86400) { $_SESSION['champdatefin'] = $time; } } } ajouter_sondage(); } else { if (Utils::issetAndNoEmpty('days')) { if (!isset($_SESSION['totalchoixjour'])) { $_SESSION['totalchoixjour'] = array(); } $k = 0; for ($i = 0; $i < count($_POST['days']); ++$i) { if (isset($_POST['days'][$i]) && $_POST['days'][$i] !='') { $_SESSION['totalchoixjour'][$k] = mktime( 0, 0, 0, substr($_POST["days"][$i], 3, 2), substr($_POST['days'][$i], 0, 2), substr($_POST['days'][$i], 6, 4)); $l = 0; for($j = 0; $j < count($_POST['horaires'.$i]); ++$j) { if (isset($_POST['horaires'.$i][$j]) && $_POST['horaires'.$i][$j] != '') { $_SESSION['horaires'.$k][$l] = $_POST['horaires'.$i][$j]; $l++; } } $k++; } } } } //le format du sondage est DATE $_SESSION['formatsondage'] = 'D'. $_SESSION['studsplus']; // Step 3/3 : Confirm poll creation if (Utils::issetAndNoEmpty('choixheures') && Utils::issetAndNoEmpty('totalchoixjour', $_SESSION)) { Utils::print_header ( _('Removal date and confirmation (3 on 3)') ); bandeau_titre(_('Removal date and confirmation (3 on 3)')); $temp_array = array_unique($_SESSION['totalchoixjour']); sort($temp_array); $removal_date = utf8_encode( strftime($date_format['txt_full'], end($temp_array) + (86400 * $config['default_poll_duration'])) ); // Sumary $summary = ''; echo '

'. _("Confirm the creation of your poll") .'

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

'. $summary .'

' . _("Your poll will be automatically removed "). $config['default_poll_duration'] . ' ' . _("days") ._(" after the last date of your poll:") . ' '.$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."). '

'; if($config['use_smtp'] == true) { echo '

' . _('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.') .'

'; } echo '

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

'. _('Choose the dates of your poll') .'

'. _("To schedule an event you need to propose at least two choices (two hours for one day or two days).").'

'. _("You can add or remove additionnal days and hours with the buttons") .' '. _('Remove') .' '. _("Add") .'

'. _("For each selected day, you can choose, or not, meeting hours (e.g.: \"8h\", \"8:30\", \"8h-10h\", \"evening\", etc.)").'

'; // Fields days : 3 by default $nb_days = (isset($_SESSION["totalchoixjour"])) ? count($_SESSION["totalchoixjour"]) : 3; for ($i=0; $i < $nb_days; ++$i) { $day_value = isset($_SESSION['totalchoixjour'][$i]) ? strftime( "%d/%m/%Y", $_SESSION['totalchoixjour'][$i]) : ''; echo '
'. _("(dd/mm/yyyy)") .'
'."\n"; // Fields hours : 3 by default for ($j=0; $j < max(count(isset($_SESSION['horaires'.$i]) ? $_SESSION['horaires'.$i] : 0),3); ++$j) { $hour_value = isset($_SESSION['horaires'.$i][$j]) ? $_SESSION['horaires'.$i][$j] : ''; echo '
'."\n"; } echo '
'; } echo '
'."\n"; bandeau_pied(); } }