function getCMSHTML() { if (!isset($_SERVER['PHP_AUTH_USER']) or $_SERVER['PHP_AUTH_USER'] == "") { header('WWW-Authenticate: Basic realm="Ticket POS"'); header('HTTP/1.0 401 Unauthorized'); die("Authentifikation fehlgeschlagen"); } $EC = new ExtConn(Util::getRootPath()); if (!$EC->login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) { header('WWW-Authenticate: Basic realm="Ticket POS"'); header('HTTP/1.0 401 Unauthorized'); die("Authentifikation fehlgeschlagen"); } $html = "<div style=\"width:200px;float:right;\">Angemeldet als<br /><b>" . Session::currentUser()->A("name") . "</b></div>"; $html .= "<h1>Ticket POS</h1>"; $AC = anyC::get("Seminar"); $AC->addAssocV3("SeminarVon", ">=", time() - 3600 * 48); $Events = array(); while ($S = $AC->getNextEntry()) { $Events[$S->getID()] = $S->A("SeminarName") . ", " . Util::CLFormatDate($S->A("SeminarVon"), true); } $I = new HTMLInput("currentEvent", "select", null, $Events); $I->style("font-size:20px;width:45%;"); $html .= "<div style=\"margin-bottom:45px;\">{$I}</div>"; $TS = new CCTicketShop(); /*$count = array(); for($i = 0; $i < 21; $i++) $count[$i] = $i; $I = new HTMLInput("ticketCount", "select", null, $count); $I->style("width:100%;font-size:20px;"); $IC = new Button("Weiter", ""); $IC->onclick("CustomerPage.rme('handleTicketSale', [$('select[name=currentEvent]').val(), $('select[name=ticketCount]').val()], function(){ })"); $IC->className("submitFormButton");*/ $html .= "\n\t\t<div style=\"float:right;width:45%;\">\n\t\t\t<h2 style=\"margin-bottom:10px;\">Ticketverkauf</h2>\n\t\t\t" . $TS->getCMSHTML(false) . "\n\t\t\t<!--<div style=\"border:1px dashed grey;padding:10px;margin-top:10px;\">\n\t\t\t\tAnzahl der Tickets:\n\t\t\t\t{$I}{$IC}\n\t\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t</div>-->\n\t\t</div>"; $I = new HTMLInput("ticketCheck"); $I->style("width:98%;font-size:20px;"); $I->onEnter("CustomerPage.rme('handleTicketCheck', [\$('select[name=currentEvent]').val(), \$(this).val()], function(transport){ \$('#ticketValidInfo').html(transport); })"); $html .= "\n\t\t<div style=\"width:45%;\">\n\t\t\t<h2 style=\"margin-bottom:10px;\">Einlass</h2>\n\t\t\t<div style=\"border:1px dashed #BBBBBB;padding:10px;\">\n\t\t\t\tTicket-Nummer:\n\t\t\t\t{$I}\n\t\t\t\t<div id=\"ticketValidInfo\" style=\"font-size:20px;margin-top:20px;\">\n\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>"; return $html; }
die("incorrect date format"); } if (!preg_match("/^[0-9]*\$/i", $cutoffDateFuture)) { die("incorrect date format"); } if (empty($cutoffDatePast)) { $cutoffDatePast = time() - 14 * 24 * 3600; } if (empty($cutoffDateFuture)) { $cutoffDateFuture = time() + 84 * 24 * 3600; } if (isset($_GET["auth_token"])) { if (file_exists($absolutePathToPhynx . "/ubiquitous/Sync/mSync.class.php")) { require_once $absolutePathToPhynx . "/ubiquitous/Sync/mSync.class.php"; } $userToken = $_GET["auth_token"]; if (!preg_match("/^[a-z0-9]+\$/i", $userToken)) { die("incorrect login information"); } $user = mSync::getUserByToken($userToken); $E->login($user->A("username"), $user->A("SHApassword")); } else { $E->login($_GET["username"], $_GET["password"]); } $calendar = mTodoGUI::getCalendarData($cutoffDatePast, $cutoffDateFuture); $events = array(); foreach ($calendar->getEventsList() as $calendarEvent) { $events[] = $calendarEvent->toXCal(); } echo xCalUtil::getXCal($events); $E->cleanUp();