public function placeOrder($isSale=false)
{
//sanity check
- print(1);
+// print(1);
if(!$this->canChange())return false;
if((count($this->newtickets)+count($this->newvouchers))==0)return false;
- print("a");
+// print("a");
global $db,$session;
$db->beginTransaction();
if(!$this->validateOrder()){
$db->rollbackTransaction();
return false;
}
- print(2);
+// print(2);
//create order
$this->status=ORDER_PLACED;
if(isset($session))$usr=$session->getUser();
$this->ordertime=time();
$this->amountpaid=0;
$this->orderid=$db->insert("order",array("customerid"=>$this->customerid,"soldby"=>$usr,"deliveryaddress"=>$this->deliveryaddress,"status"=>$this->status,"ordertime"=>$this->ordertime,"comments"=>$this->comment,"amountpaid"=>0));
- print(3);
+// print(3);
//orderid ok?
if($this->orderid===false){
$db->rollbackTransaction();
$this->status=ORDER_SENT;
$this->amountpaid=$totalprice;
}
- print(4);
+// print(4);
//end
$db->commitTransaction();
return true;