- added page event details
authorpeter <peter@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sun, 14 Oct 2007 18:27:42 +0000 (18:27 +0000)
committerpeter <peter@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sun, 14 Oct 2007 18:27:42 +0000 (18:27 +0000)
git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@49 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

www/inc/event.php
www/inc/event_listing.php [new file with mode: 0644]
www/inc/listing.php
www/index.php
www/template/de/eventdetails.html [new file with mode: 0644]

index e31a438..08cfc98 100644 (file)
@@ -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 (file)
index 0000000..b420a1f
--- /dev/null
@@ -0,0 +1,52 @@
+<?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"));
+}
+
+
+?>
index 108e9e0..a6c85a8 100644 (file)
@@ -1,23 +1,5 @@
 <?
 //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()
index e8b71e1..ab06ff9 100644 (file)
@@ -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 (file)
index 0000000..a3f15d4
--- /dev/null
@@ -0,0 +1,48 @@
+<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&uuml;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@ &euro;</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