public function getDescription(){return $this->description;}
/**returns the reason why the event is cancelled if isCancelled() returns true*/
public function getCancelReason(){return $this->cancelreason;}
+ /**returns the date of the event*/
+ public function getDate()
+ {
+ return date("d.m.Y", $this->getStartTime());
+ }
+ /**returns the time of the event*/
+ public function getTime()
+ {
+ return date("H:i", $this->getStartTime());
+ }
+ /**returns the data in an array*/
+ public function getDataArray()
+ {
+ return array("DATE"=>$this->getDate(), "TIME"=>$this->getTime(), "PLACE"=>$this->getRoomId(), "EVENTNAME"=>$this->getTitle(), "ARTIST"=>$this->getArtist(),"PRICE"=>$this->getDefaultPrice(), "ID"=>$this->getEventId(), "DESCRIPTION"=>$this->getDescription());
+ }
};
/**machine-function: get the requested events as XML data*/
--- /dev/null
+<?php
+// +----------------------------------------------------------------------
+// | PHP Source
+// +----------------------------------------------------------------------
+// | Copyright (C) 2007 by Peter Keller <peter@silmor.de>
+// +----------------------------------------------------------------------
+// |
+// | Copyright: See COPYING file that comes with this distribution
+// +----------------------------------------------------------------------
+//
+
+function createEventList()
+{
+ global $parser;
+ //pass 1: get layout of single event
+ $p=new Parser("index.html");
+ $p->setVar("ROLE","buyer");
+ $list="";
+ $temp=$p->getVar("EVENT");
+ //fake1
+ $p->setVars(array("DATE"=>"heute","PLACE"=>"nirgendwo","EVENTNAME"=>"Hurrah Jazz Club","ARTIST"=>"Broken Blech","PRICE"=>"567,00","ID"=>"1"));
+ $list.=$p->parse($temp);
+ //fake2
+ $p->setVars(array("DATE"=>"morgen","PLACE"=>"irgendwo","EVENTNAME"=>"Verschwindibus","ARTIST"=>"Merlin","PRICE"=>"77,99","ID"=>"2"));
+ $list.=$p->parse($temp);
+ //pass 2: create page
+ $p->setVar("LIST",$list);
+ $parser->setVar("PAGE",$p->parseFile("index.html"));
+}
+
+function createEventDetails()
+{
+ global $parser;
+ global $_GET;
+
+ if (isset($_GET["eventID"])) {
+ $eventID = $_GET["eventId"];
+ }
+
+ $p = new Parser("eventdetails.html");
+ $eventTmpl = $p->getVar("EVENT");
+
+ // set event details
+ $event = new Event($eventID);
+ $p->setVars($event->getDataArray());
+ $details = $p->parse($eventTmpl);
+ $p->setVar("EVENTDETAILS",$details);
+ $parser->setVAR("PAGE", $p->parseFile("eventdetails.html"));
+}
+
+
+?>
<?
//fake listing
-function createlist()
-{
- global $parser;
- //pass 1: get layout of single event
- $p=new Parser("index.html");
- $p->setVar("ROLE","buyer");
- $list="";
- $temp=$p->getVar("EVENT");
- //fake1
- $p->setVars(array("DATE"=>"heute","PLACE"=>"nirgendwo","EVENTNAME"=>"Hurrah Jazz Club","ARTIST"=>"Broken Blech","PRICE"=>"567,00","ID"=>"1"));
- $list.=$p->parse($temp);
- //fake2
- $p->setVars(array("DATE"=>"morgen","PLACE"=>"irgendwo","EVENTNAME"=>"Verschwindibus","ARTIST"=>"Merlin","PRICE"=>"77,99","ID"=>"2"));
- $list.=$p->parse($temp);
- //pass 2: create page
- $p->setVar("LIST",$list);
- $parser->setVar("PAGE",$p->parseFile("index.html"));
-}
//fake reservation
function createreservation()
include('loader.php');
include('loader_nonadmin.php');
//include display scripts
-include('inc/listing.php');
+include('inc/event_listing.php');
include('inc/parser.php');
//set common basics
case "reserve":
createreservation();
break;
+ case "eventDetails":
+ createEventDetails();
+ break;
default:
- createlist();
+ createEventList();
break;
}
//spit out completed page
--- /dev/null
+<h1>Veranstaltungsdetails</h1>
+<div id="ms_form">
+<form action="." method="POST">
+
+@EVENTDETAILS@
+
+#set:EVENT:
+<fieldset class="ms_Form">
+<div class="ms_FormRow">
+<label for="ms_text_event">Veranstaltung:</label>
+<span id="ms_text_event">@EVENTNAME@</span>
+</div>
+<div class="ms_FormRow">
+<label for="ms_text_place">Ort:</label>
+<span id="ms_text_place">@PLACE@</span>
+</div>
+<div class="ms_FormRow">
+<label for="ms_text_artist">Künstler:</label>
+<span id="ms_text_artist">@ARTIST@</span>
+</div>
+<div class="ms_FormRow">
+<label for="ms_text_date">Datum:</label>
+<span id="ms_text_date">@DATE@</span>
+</div>
+<div class="ms_FormRow">
+<label for="ms_text_time">Uhrzeit:</label>
+<span id="ms_text_time">@TIME@ Uhr</span>
+</div>
+<div class="ms_FormRow">
+<label for="ms_text_information">Information:</label>
+<span id="ms_text_information">@DESCRIPTION@</span>
+</div>
+<div class="ms_FormRow">
+<label for="ms_text_price">Kartenpreis:</label>
+<span id="ms_text_price">@PRICE@ €</span>
+</div>
+<div class="ms_FormRow">
+<label for="ms_textfield_amount">Kartenanzahl:</label>
+<input type="text" id="ms_textfield_amount" name="ms_amount" value="3" size="2" maxlength="2"/>
+</div>
+</fieldset>
+#endset
+
+<div class="ms_ButtonArea">
+<input type="button" id="ms_button_save" name="ms_save" value="In den Warenkorb" />
+</div>
+</form>
+</div>
\ No newline at end of file