Пример #1
0
 public static function OutputSocialeventPrices()
 {
     $stdout = "";
     // -- Obtain data
     //    $visit = functions::callMethod('fromdb_vm','fromdb/vm','getArrivingVisitors');
     if (!isset($dbVm) || !is_object($dbVm)) {
         require_once PATH_CLASSES . "/fromdb/vm.php";
         $dbVm = new fromdb_vm();
     }
     $data = $dbVm->getSocialeventPrices();
     // -- Output
     $stdout .= "                  <p>Note that these are only <strong>estimated prices</strong>!</p>\r\n" . "                  <table class='b_zebra' style='width:auto'>\r\n" . "                    <tr>\r\n" . "                      <th>&nbsp;</th>\r\n" . "                      <th>Event</th>\r\n" . "                      <th>Price per<br>person (SEK)</th>\r\n" . "                      <th>Startup price<br>(SEK)</th>\r\n" . "                    </tr>\r\n";
     $row = 1;
     foreach ($data as $event) {
         if (!empty($event["name"]) && !empty($event["price"])) {
             $event["name"] = str_replace("\\\"", "&quot;", $event["name"]);
             $stdout .= "                    <tr>\r\n" . "                      <td>" . $row . " - </td>\r\n" . "                      <td class='b_zebra" . ($row % 2 + 1) . "'>" . $event["name"] . "</td>\r\n" . "                      <td class='b_zebra" . ($row % 2 + 1) . "'>" . $event["price"] . "</td>\r\n" . "                      <td class='b_zebra" . ($row % 2 + 1) . "'>" . (isset($event["startup"]) && !empty($event["startup"]) ? $event["startup"] : "") . "</td>\r\n" . "                    </tr>\r\n";
             $row++;
         }
     }
     // end foreach
     $stdout .= "                  </table>\r\n" . "\r\n";
     return $stdout;
 }
Пример #2
0
 public static function getDefaultEvents($stattype)
 {
     if (isset($_REQUEST["reset"])) {
         if (isset($_REQUEST["eventindex"])) {
             unset($_REQUEST["eventindex"]);
         }
         if (isset($_REQUEST["beenthere"])) {
             unset($_REQUEST["beenthere"]);
         }
         return array();
     }
     if (isset($_REQUEST["beenthere"])) {
         return array();
     }
     $default[0] = 1;
     // ------------------------
     // For statistics type "applicants"
     // ------------------------
     if (in_array($stattype, array("applicants"))) {
         if (!class_exists("fromdb_jam", FALSE) || !isset($dbJam) || !is_object($dbJam)) {
             require_once PATH_CLASSES . "/fromdb/jam.php";
             $dbJam = new fromdb_jam();
         }
         $campaigns = $dbJam->getCampaigns();
         if (empty($campaigns)) {
             return "<p class='red bold'>Found no campaigns</p>";
         }
         $_REQUEST["beenthere"] = true;
         foreach ($campaigns as $idx => $label) {
             if (isset($_REQUEST["all"])) {
                 $default[$idx] = "on";
                 // -----------------------------
                 // -- This defines default events:
             } elseif (stripos($label, "nordita fellowship") !== false) {
                 $default[$idx] = "on";
                 // -----------------------------
             }
         }
         $_REQUEST["eventindex"] = $default;
     }
     // end if
     // ------------------------
     // For statistics type "events" and "allguests"
     // ------------------------
     if (in_array($stattype, array("events", "allguests"))) {
         if (!class_exists("fromdb_vm", FALSE) || !isset($dbVm) || !is_object($dbVm)) {
             require_once PATH_CLASSES . "/fromdb/vm.php";
             $dbVm = new fromdb_vm();
         }
         $events = array("0" => "All " . (isset($_REQUEST["beenthere"]) ? "Selected " : "") . "Events") + $dbVm->getAllEventsTitles(mktime(0, 0, 0, 1, 1, 2009), time());
         foreach (self::$emptyEvents as $idx) {
             if (isset($events[$idx])) {
                 unset($events[$idx]);
             }
         }
         if (empty($events)) {
             return "<p class='red bold'>Found no events</p>";
         }
         $_REQUEST["beenthere"] = true;
         foreach ($events as $idx => $label) {
             if (isset($_REQUEST["all"])) {
                 $default[$idx] = "on";
             } else {
                 if ($idx > 0) {
                     // -----------------------------
                     // -- This defines default events:
                     $thisEventType = functions::callMethod('event', 'lib/event', 'getEventByAgendaid', $idx, "etype");
                     if (in_array($thisEventType, array("program"))) {
                         $default[$idx] = "on";
                     }
                     // -----------------------------
                 }
             }
             // end if
         }
         // end foreach
         $_REQUEST["eventindex"] = $default;
     }
     // end if
     return $default;
 }