<?php
	session_start();
	require_once("../Wx.Config.php");	//只加载一次

	ini_set('session.gc_maxlifetime', 99999999); //设置时间 永不过期

	//获取客户的微信ID号
	$strwxid=trim($_REQUEST['wxudid']);
	if(strlen($strwxid)>10)
	{
		$_SESSION["main_wxudid"]=$strwxid;
	}
	$strselChainNo=trim($_REQUEST['chid']);
	$_SESSION["main_posChainNo"]=$strselChainNo;
	$darpid=trim($_REQUEST['dpid']);
	if(strlen($darpid)>0)
	{
		$_SESSION["main_posDefDepID"]=$darpid;
	}
/*	
	//判断是否登录系统		
	if($_SESSION["main_viplogined"]!="1" |$_SESSION["main_vipno"]=="")
	{
		//没有登录开始启动登录
		header('location:login.php?stext=');
		exit;
	}
	//判断是否有默认分店,如果有则直接进入默认分店界面
	$strlocalchainno=trim($_REQUEST['hotelno']);
	if(strlen($strlocalchainno)>0)
	{
		$_SESSION["main_defhotelcode"]=$strlocalchainno;
	}
	
*/
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="gb2312">	
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
	<meta name="apple-mobile-web-app-capable" content="1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=0">
	<meta name="apple-touch-fullscreen" content="1">

	<title>微信点单</title>
	
	<link rel="stylesheet" href="css/mycss.css"> 
	<script src="jsp4/jquery.js"></script>
	<!--<link rel="stylesheet" href="jsp5/jquery.mobile-1.4.5.min.css">-->
	<!--<script src="jsp4/jquery.mobile-1.4.3.min.js"></script>-->
	<script src="jsp5/jquery.mobile-1.4.5.min.js"></script>
	<link rel="stylesheet" href="jsp5/jquery.mobile-1.4.5.min.css">
	    
	<script language="JavaScript"> 
		//不允许进行后退
		javascript:window.history.forward(0); 
	</script>
        
	<script>
		//禁止页面上下滑动,整个页面都不能滑动了
		document.addEventListener('touchmove', function(e) {
			e.preventDefault();
		});
	</script>
</head>

<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" bgcolor="#E0BABA">		
	<div onClick="bmtStartIndex()" style="width:100%;">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td height="100" width="100%">
                </td>
            </tr>
            <tr>
                <td height="40" width="100%" align="center">
                     <span style="color:#A3000F;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:25px;text-shadow:none;">正在加载参数</span>
                </td>
            </tr>
            <tr>
                <td height="20" width="100%" align="center">
                     <span style="color:#A3000F;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:25px;text-shadow:none;">请稍后</span>
                </td>
            </tr>
			<tr>
                <td height="20" width="100%" align="center">
                     <span style="color:#A3000F;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:25px;text-shadow:none;">......</span>
                </td>
            </tr>
            <tr>
                <td height="50" width="100%">
                </td>
            </tr>
        </table>
	</div>
	<script>	
		//得到临时购物车号
		var strtempidno = localStorage["deftemp_cartid"];
		if(strtempidno == undefined)
		{
			strtempidno="";
		}
		//alert (strtempidno);
		if(strtempidno.length<17)
		{
			//由服务器生成唯一的购物车号			
			//用ajax的“同步方式”调用一般处理程序: 生成唯一的购物车流水号
			$.ajax({
				url: "createcartid.php",
				async: false,//改为同步方式
				type: "POST",
				//data: {doid:1, rmid: "" },
				success: function (RetData) 
				{
					strtempidno = RetData;
				}
			});
			
			strtempidno = strtempidno.trim();
			if(strtempidno.length>16)
			{
				localStorage["deftemp_cartid"] = strtempidno;
			}
		}
		
		var selDpartID = '<?php echo $darpid;?>';
		if(selDpartID.length>0)
		{
			window.location="index2.php?cartid=" + strtempidno + "&dlistno=" + selDpartID;	
		}
		else
		{
			window.location="indexseld.php?cartid=" + strtempidno + "&chid=<?php echo $strselChainNo;?>";
		}

	</script>
    
     <script type="text/javascript">
		function bmtStartIndex()
		{
			var strtempidno2 = localStorage["deftemp_cartid"];
			if(strtempidno2 == undefined)
			{
				strtempidno2="";
			}
			var selDpartID = '<?php echo $darpid;?>';
			window.location="index2.php?cartid=" + strtempidno2;			
							
		}
		
	</script>
</body>
	
</html>