public function changeAmount($amt)
{
global $db;
- if($amd<=0){
+ if($amt<=0){
$db->deleteRows("cart_ticket","cartid='".addslashes($this->cartid)."' and eventid=".$this->eventid);
+ $this->amount=0;
}else{
$db->update("cart_ticket",array("amount"=>($amt+0)),"cartid='".addslashes($this->cartid)."' and eventid=".$this->eventid);
+ $this->amount=$amt;
}
}
{
return new Event($this->eventid);
}
+
+ /**return the eventID*/
+ public function getEventId()
+ {
+ return $this->eventid;
+ }
+
+ /**return the current amount*/
+ public function getAmount()
+ {
+ return $this->amount;
+ }
};
/**this class represents a shopping cart*/
return $this->cartid!==false;
}
+ /**returns the ID of this cart, returns false if the cart is not valid*/
+ public function getCartId()
+ {
+ return $this->cartid;
+ }
+
/**use this to get all existing tickets in this cart, then manipulate the tickets directly*/
public function getTickets()
{