Esempio n. 1
0
<?php

/* Requirements */
require_once "classes/Configurations.php";
require_once "classes/Page.php";
require_once "classes/SignupGadgets.php";
require_once "classes/Debugger.php";
require_once "classes/SignupGadget.php";
require_once "classes/CommonTools.php";
require_once "classes/SignupGadgetEditFormatter.php";
/* Implementations of the most critical classes */
$configurations = new Configurations();
$page = new Page(2);
$debugger = new Debugger();
$database = new Database();
/* The code */
$signupId = $request->getSignupId();
$signupGadget = new SignupGadget($signupId);
$page->addHeader("<script type=\"text/javascript\" src=\"../question_script.js\"></script>");
$page->addContent(SignupGadgetEditFormater::getSignupGadgetEditInPrintableFormat($signupGadget, true));
$page->printPage();
 function getMinuteOptions($interval, $selected = -1)
 {
     // Check interval
     if ($interval <= 0 || $interval >= 60) {
         die('Bad interval');
     }
     $selected = SignupGadgetEditFormater::checkSelected($selected, 0, 60, $interval);
     if ($selected < 0) {
         $selected = 0;
     }
     $return = "";
     for ($i = 0; $i < 60; $i = $i + $interval) {
         $minute = $i;
         // Printable value
         if ($i < 10) {
             // Add missing zero
             $minute = "0" . $minute;
         }
         if ($i == $selected) {
             $return .= "<option selected=\"selected\" name=\"{$minute}\">{$minute}</option>\n";
         } else {
             $return .= "<option name=\"{$minute}\">{$minute}</option>\n";
         }
     }
     return $return;
 }