-Subproject commit ea368b8d4490835ee46b1043d4b0fce403a18f01
+Subproject commit 96c683cfd7117c221597e0aa6d4eba772272cba3
-Subproject commit 6528fd26d09b68b51e8d2edba8e71192a71244da
+Subproject commit 2ba4702b5aa2ae173387fa96a8bc33f835b3d8db
<?php
-// (c) Konrad Rosenbaum, 2007-2011
+// (c) Konrad Rosenbaum, 2007-2021
// (c) Peter Keller, 2007/8
// protected under the GNU AGPL version 3 or at your option any newer
// see COPYING.AGPL
+//PHP error handling
+ini_set("error_log",str_replace("*",date("Ymd"),"./log/error-*.log"));
+
//load WOB data
include('./inc/wbase/autoload.php');
include('./inc/wob/autoload.php');
public static function createEventList()
{
global $twig,$basevars,$session;
-
+
//pass 1: get layout of single event
$p=$twig->loadTemplate("tickets.html");
$list=$basevars;
+ $list['events']=array();
$trn=WTrGetAllEvents::execute();
$events = $trn->resultevents();
$now=time();
public static function createEventDetails()
{
global $twig,$session,$basevars;
-
+
if (isset($_GET["event"])) {
$eventID = $_GET["event"]+0;
}
// set event details
$list=$basevars;
$list['event']=$event;
-
+
// create page
return $p->render($list);
}
$cnt++;
return $cnt;
}
-
+
/**helper for web UI: returns the name of the field for this event price, always the configured amount field from WebCart plus an index indicating category and event IDs*/
public function getAmountinputfield()
{
return WebCart::TicketAmountField."[".$this->prop_pricecategoryid.":".$this->prop_eventid."]";
}
-
+
/**helper for web UI: returns the value for HTML variables for this event price: an index indicating category and event IDs*/
public function getCategoryIdWeb()
{
global $basevars;
return $basevars["inputnames"]["ticket"]."=".$this->prop_pricecategoryid.":".$this->prop_eventid;
}
-
+
/**helper function for web UI: returns the event ID from an amount field index */
static public function getEventIdFromAmountIndex($idx)
{
$sl=explode(":",$idx);
- if(count($sl==2))return $sl[1]+0;
+ if(count($sl)==2)return $sl[1]+0;
else return null;
}
-
+
/**helper function for web UI: returns the event ID from an amount field index */
static public function getCategoryIdFromAmountIndex($idx)
{
$sl=explode(":",$idx);
- if(count($sl==2))return $sl[0]+0;
+ if(count($sl)==2)return $sl[0]+0;
else return null;
}
};
//return...
$trans->setevents($evlst2);
}
-
+
/**XML iface: get list of events*/
public static function getEventList($trans)
{
$evlst=WOEvent::fromTableArrayevent(WTevent::selectFromDB("eventid in ".$db->escapeIntList($trans->geteventids())));
$trans->setevents($evlst);
}
-
+
/**called by CreateEvent transaction*/
public static function createEvent($trans)
{
//return
$trans->setevent(WOEvent::fromTableevent($tab));
}
-
+
/**called by ChangeEvent transaction*/
public static function changeEvent($trans)
{
//return
$trans->setevent(WOEvent::fromTableevent($tab));
}
-
+
/**helper function for create/changeEvent - pushes the current list of prices to the database*/
public function syncPricesToDB()
{
}
}
}
-
+
/**called by CancelEvent transaction*/
static public function cancelEvent($trans)
{
$tab->update();
WOEvent::fromTableevent($tab)->cancelAllTickets();
}
-
+
/**helper function: cancels all usable tickets of this event*/
public function cancelAllTickets()
{
}
}
}
-
+
/**called by the GetEventSummary transaction: returns the full event summary*/
public static function getSummary($trans)
{
$olst=WOOrder::fromTableArrayorder(WTorder::selectFromDB("orderid in ".$db->escapeIntList($oidl),"ORDER BY orderid"));
$trans->setorders($olst);
}
-
+
/**called by the GetEntranceEvents transaction*/
public static function getEntranceEvents($trans)
{
return count($this->prop_tickets)==0 && count($this->prop_vouchers)==0 && count($this->prop_items)==0;
$prc=0;
}
-
+
/**returns the overall sum for twig*/
public function getTotalsum()
{
$itm=WTcartticket::getFromDB($cartid,$evid,$pcid);
if(is_a($itm,"WTcartticket")){
//yes: add to it
-// echo "add".$amount;
$itm->amount+=$amount;
$itm->update();
}else{
//no: add new item
-// echo "ins".$amount;
$itm=WTcartticket::newRow();
$itm->cartid=$cartid;
$itm->eventid=$evid;
$itm->amount=$amount;
$itm->insert();
}
-// die ("hallo");
}
///transaction to add coupon to cart
$cartid=$trans->getcartid();
$evid=$trans->geteventid();
$pcid=$trans->getpricecategoryid();
- error_log("hallo ".$cartid." ".$evid." ".$pcid);
//get cart
$cart=WOWebCart::fromTablecart(WTcart::getFromDB($cartid));
if(!is_a($cart,"WOWebCart"))return;
$itm=WTcartticket::getFromDB($cartid,$evid,$pcid);
if(is_a($itm,"WTcartticket")){
//yes: remove it
-// echo "add".$amount;
$itm->deleteFromDb();
}
}
-
+
///transaction to add vouchers
static public function addVoucher($trans)
{
$cv->value=$prc;
$cv->insert();
}
-
+
///transaction to remove vouchers
static public function removeVoucher($trans)
{