From e0da2131d83376e4939c6fc32a384b07a7bc7692 Mon Sep 17 00:00:00 2001 From: konrad Date: Sun, 16 Mar 2008 15:04:33 +0000 Subject: [PATCH] show when tickets go low for an event git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@126 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- www/inc/classes/event.php | 5 ++--- www/template/de/index.html | 9 +++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/www/inc/classes/event.php b/www/inc/classes/event.php index 482202a..7ac3883 100644 --- a/www/inc/classes/event.php +++ b/www/inc/classes/event.php @@ -122,7 +122,7 @@ class Event { $lang = LanguageManager::singleton(); - return array("DATE"=>$lang->getDate($this->getStartTime()), "TIME"=>$lang->getTime($this->getStartTime()), "PLACE"=>$this->getRoomId(), "EVENTNAME"=>$this->getTitle(), "ARTIST"=>$this->getArtist(),"PRICE"=>$lang->getPrice($this->getDefaultPrice()), "ID"=>$this->getEventId(), "DESCRIPTION"=>$this->getDescription(), "LINK"=>""); + return array("DATE"=>$lang->getDate($this->getStartTime()), "TIME"=>$lang->getTime($this->getStartTime()), "PLACE"=>$this->getRoomId(), "EVENTNAME"=>$this->getTitle(), "ARTIST"=>$this->getArtist(),"PRICE"=>$lang->getPrice($this->getDefaultPrice()), "ID"=>$this->getEventId(), "DESCRIPTION"=>$this->getDescription(), "LINK"=>"","AVAILABLETICKETS"=>$this->availableTicketAmount()); } /**returns how many tickets can still be sold*/ @@ -138,10 +138,9 @@ class Event //get existing tickets $res=$db->select("ticket","status","eventid=".$db->escapeInt($this->evid)); $amt=0; - reset($res); if(count($res)>0) foreach($res as $tk){ - if(!($tk["status"]&TICKET_MBLOCK))$amt++; + if(($tk["status"] & TICKET_MBLOCK)!=0)$amt++; } return $this->capacity - $amt; } diff --git a/www/template/de/index.html b/www/template/de/index.html index 6d331e6..9549833 100644 --- a/www/template/de/index.html +++ b/www/template/de/index.html @@ -17,6 +17,15 @@ Ort: @PLACE@
@ARTIST@
Kartenpreis: @PRICE@ EUR
Info +#if:AVAILABLETICKETS>0 Bestellen +#if:AVAILABLETICKETS<=5 +*nur noch Restkarten* +#endif +#endif +#if:AVAILABLETICKETS==0 +*ausverkauft* +#endif +

#endset -- 1.7.2.5