<?php
	session_start();
	
	$strret = '0';
	//header("Content-type: text/html; charset=gb2312"); 
	
	require_once("db/db.php");	
	require_once("common/common.php");
	
	//得到要取消的订单编号
	$strselBillNo=trim($_REQUEST['selbillno']);
	$strQXFlag = trim($_REQUEST['seldid']);
		
	//得到当前使用系统的关键字：会员号，微信号，临时购物号
	if($strQXFlag=='2')
	{
		$sql = sprintf("Update WX_Bill_Inform Set BillState=3 Where Bill_No='%s' And BillState=2",$strselBillNo);
	}
	else
	{
		if($strQXFlag=='3')
		{
			$strNewTableNo = trim($_REQUEST['newtabid']);
			$strNewManCount = trim($_REQUEST['newmannum']);
			$strAddress = trim($_REQUEST['addres']);
			$strTelNo = trim($_REQUEST['telno']);
						
			//保存桌台号和人数
			$sql = sprintf("Update WX_Bill_Inform Set TableNo='%s',ManCount=%s,ReceiveAddr='%s',ReceiveTel='%s' Where Bill_No='%s' And BillState=0",$strNewTableNo,$strNewManCount,$strAddress,$strTelNo,$strselBillNo);
		}
		else
		{
			$sql = sprintf("Update WX_Bill_Inform Set BillState=4 Where Bill_No='%s' And BillState=0",$strselBillNo);
		}
	}
	
	if(executeSql($sql))
	{
		$strret='*1';		
	}

	echo $strret;
	closeDb();		
?>



