From a497738b95ec955aa6d04ba0b8aaeb201563d485 Mon Sep 17 00:00:00 2001 From: peter Date: Sun, 14 Oct 2007 18:27:42 +0000 Subject: [PATCH] - added page event details git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@49 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- www/inc/event.php | 15 ++++++++++ www/inc/event_listing.php | 52 +++++++++++++++++++++++++++++++++++++ www/inc/listing.php | 18 ------------- www/index.php | 7 +++- www/template/de/eventdetails.html | 48 ++++++++++++++++++++++++++++++++++ 5 files changed, 120 insertions(+), 20 deletions(-) create mode 100644 www/inc/event_listing.php create mode 100644 www/template/de/eventdetails.html diff --git a/www/inc/event.php b/www/inc/event.php index e31a438..08cfc98 100644 --- a/www/inc/event.php +++ b/www/inc/event.php @@ -115,6 +115,21 @@ class Event 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*/ diff --git a/www/inc/event_listing.php b/www/inc/event_listing.php new file mode 100644 index 0000000..b420a1f --- /dev/null +++ b/www/inc/event_listing.php @@ -0,0 +1,52 @@ + +// +---------------------------------------------------------------------- +// | +// | 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")); +} + + +?> diff --git a/www/inc/listing.php b/www/inc/listing.php index 108e9e0..a6c85a8 100644 --- a/www/inc/listing.php +++ b/www/inc/listing.php @@ -1,23 +1,5 @@ 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() diff --git a/www/index.php b/www/index.php index e8b71e1..ab06ff9 100644 --- a/www/index.php +++ b/www/index.php @@ -3,7 +3,7 @@ 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 @@ -18,8 +18,11 @@ switch($mode){ case "reserve": createreservation(); break; + case "eventDetails": + createEventDetails(); + break; default: - createlist(); + createEventList(); break; } //spit out completed page diff --git a/www/template/de/eventdetails.html b/www/template/de/eventdetails.html new file mode 100644 index 0000000..a3f15d4 --- /dev/null +++ b/www/template/de/eventdetails.html @@ -0,0 +1,48 @@ +

Veranstaltungsdetails

+
+
+ +@EVENTDETAILS@ + +#set:EVENT: +
+
+ +@EVENTNAME@ +
+
+ +@PLACE@ +
+
+ +@ARTIST@ +
+
+ +@DATE@ +
+
+ +@TIME@ Uhr +
+
+ +@DESCRIPTION@ +
+
+ +@PRICE@ € +
+
+ + +
+
+#endset + +
+ +
+
+
\ No newline at end of file -- 1.7.2.5