Esempio n. 1
0
             echo '
             <p>' . __('Step 3', '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.') . '</p>';
         }
         echo '
         </div>
         <p class="text-right">
             <button class="btn btn-default" onclick="javascript:window.history.back();" title="' . __('Step 3', 'Back to step 2') . '">' . __('Generic', 'Back') . '</button>
             <button name="confirmecreation" value="confirmecreation" type="submit" class="btn btn-success">' . __('Step 3', 'Create the poll') . '</button>
         </p>
     </div>
 </div>
 </form>' . "\n";
         bandeau_pied();
         // Step 2/4 : Select choices of the poll
     } else {
         Utils::print_header(__('Step 2 classic', 'Poll subjects (2 on 3)'));
         bandeau_titre(__('Step 2 classic', 'Poll subjects (2 on 3)'));
         echo '
 <form name="formulaire" action="' . Utils::get_server_name() . 'create_classic_poll.php" method="POST" class="form-horizontal" role="form">
 <div class="row">
     <div class="col-md-8 col-md-offset-2">';
         echo '
         <div class="alert alert-info">
             <p>' . __('Step 2 classic', 'To make a generic poll you need to propose at least two choices between differents subjects.') . '</p>
             <p>' . __('Step 2 classic', 'You can add or remove additional choices with the buttons') . ' <span class="glyphicon glyphicon-minus text-info"></span><span class="sr-only">' . __('Generic', 'Remove') . '</span> <span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">' . __('Generic', 'Add') . '</span></p>';
         if ($config['user_can_add_img_or_link']) {
             echo '    <p>' . __('Step 2 classic', 'It\'s possible to propose links or images by using') . ' <a href="http://' . $locale . '.wikipedia.org/wiki/Markdown">' . __('Step 2 classic', 'the Markdown syntax') . '</a>.</p>';
         }
         echo '    </div>' . "\n";
         // Fields choices : 5 by default
         $choices = $_SESSION['form']->getChoices();
Esempio n. 2
0
                 $time = mktime(0, 0, 0, substr($_POST["days"][$i], 3, 2), substr($_POST["days"][$i], 0, 2), substr($_POST["days"][$i], 6, 4));
                 $choice = new Choice($time);
                 $_SESSION['form']->addChoice($choice);
                 $schedules = $inputService->filterArray($_POST['horaires' . $i], FILTER_DEFAULT);
                 for ($j = 0; $j < count($schedules); $j++) {
                     if (!empty($schedules[$j])) {
                         $choice->addSlot(strip_tags($schedules[$j]));
                     }
                 }
             }
         }
     }
 }
 // Step 3/4 : Confirm poll creation
 if (!empty($_POST['choixheures']) && !isset($_SESSION['form']->totalchoixjour)) {
     Utils::print_header(__('Step 3', 'Removal date and confirmation (3 on 3)'));
     bandeau_titre(__('Step 3', 'Removal date and confirmation (3 on 3)'));
     $end_date_str = utf8_encode(strftime('%d/%m/%Y', $max_expiry_time));
     // textual date
     // Summary
     $summary = '<ul>';
     $choices = $_SESSION['form']->getChoices();
     foreach ($choices as $choice) {
         $summary .= '<li>' . strftime($date_format['txt_full'], $choice->getName());
         $first = true;
         foreach ($choice->getSlots() as $slots) {
             $summary .= $first ? ': ' : ', ';
             $summary .= $slots;
             $first = false;
         }
         $summary .= '</li>';