<?php
	session_start();
	//判断是否登录系统		
	if($_SESSION["main_viplogined"]!="1" |$_SESSION["main_vipno"]=="")
	{
		//没有登录开始启动登录
		header('location:login.php?stext=');
		exit;
	}
?>
<!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>

	<script src="jsp4/jquery.js"></script>
	<link rel="stylesheet" href="css/mycss.css"> 
	
	<!--<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">
	<link rel="stylesheet" href="jsp4/jquery.mobile.datepicker.css">
	
	<script src="jsp4/jquery.ui.datepicker.js"></script>
	<script id="mobile-datepicker" src="jsp4/jquery.mobile.datepicker.js"></script>
	
	<script language="JavaScript"> 
		//不允许进行后退
		javascript:window.history.forward(0); 
	</script>
</head>

<script>	
	//隐藏维信右上角菜单
	function onBridgeReady(){
		WeixinJSBridge.call('hideOptionMenu');
	}

	if (typeof WeixinJSBridge == "undefined")
	{
		if( document.addEventListener )
		{
			document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
		}
		else if (document.attachEvent)
		{
			document.attachEvent('WeixinJSBridgeReady', onBridgeReady); 
			document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
		}
	}
	else
	{
		onBridgeReady();
	}
</script>

<?php
	require_once("db/db.php");	
	require_once("common/common.php");
	require_once("../Wx.Config.php");	//只加载一次
	
	$intstid=$_REQUEST['stid'];	//1是入住日期,2是预离日期
	$strDayTemp1=$_REQUEST['stday1'];	//入住日期
	$strDayTemp2=$_REQUEST['stday2'];	//入住日期
	if($intstid<>2)
		$intstid=1;
?>

<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">
<!--第一个页面的内容实现---------------------------->
<section data-role="page" id="hispage1">
	<header data-role="header" data-position="fixed" data-tap-toggle="false" style="border-top-width:0px;border-bottom-width:0px;">
        <table width="100%" height="45" border="0" cellpadding="0" cellspacing="0" bgcolor="<?php echo WxMainConfig::colHeadBkColorBook;?>">
		   	<tr>
				<td height="45" width="30" align="center"></td>
				<td height="45" align="center" valign="middle">
					<?php if($intstid==1) { ?>
						<span id="MsgTxt" style="color:<?php echo WxMainConfig::colHeadTextColorBook;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:19px;text-shadow:none;">选择入住日期</span>
					<?php } else { ?>
						<span id="MsgTxt" style="color:<?php echo WxMainConfig::colHeadTextColorBook;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:19px;text-shadow:none;">选择离店日期</span>
					<?php }?>
               	</td>
				<td height="45" width="30" valign="middle"></td>
		  	</tr>
		</table>
	</header>
	
	
	<article data-role="none">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td height="4" width="8"></td>
				<td height="4" align="left"></td>
				<td height="4" width="8"></td>
			</tr>
			
			<tr>
				<td width="8"></td>
				<td align="left">
					<?php if($intstid==1) { ?>
						<input type="text" id="dtp1" name="dtp1" readonly= "true" value="<?php echo $strDayTemp1;?>" data-role="date" data-inline="true" />
					<?php } else { ?>
						<input type="text" id="dtp1" name="dtp1" readonly= "true" value="<?php echo $strDayTemp2;?>" data-role="date" data-inline="true" />
					<?php }?>
				</td>
				<td width="8"></td>
			</tr>
									
			<tr>
				<td height="6" width="8"></td>
				<td height="6" align="left"></td>
				<td height="6" width="8"></td>
			</tr>
			
			<tr>
				<td height="8" width="8"></td>
				<td height="8" align="left">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td width="47%">
									<a class="ui-btn ui-corner-all" href="hotelsel.php?chidno=<?php echo $_SESSION["main_order_chainno"];?>&stday1=<?php echo $strDayTemp1;?>&stday2=<?php echo $strDayTemp2;?>" style="color:#A6A600;" target="_blank" data-role="button">返回</a>
								</td>
								<td width="6%"></td>
								<td width="47%">
									<a class="ui-btn ui-corner-all" style="color:#A6A600;" data-role="button" id="day_setok">确定日期</a>
								</td>
							</tr>
						</table>
				</td>
				<td height="8" width="8"></td>
			</tr>
			
			<tr>
				<td height="6" width="8"></td>
				<td height="6" align="left"></td>
				<td height="6" width="8"></td>
			</tr>
			
			<tr>
				<td height="1" width="8" bgcolor="#F2E2E2"></td>
				<td height="1" align="left" bgcolor="#F2E2E2"></td>
				<td height="1" width="8" bgcolor="#F2E2E2"></td>
			</tr>
			
		</table>
		
		<script type="text/javascript">
			//相应查询按钮的事件
		 	$("#day_setok").click(
				function()
		 		{
		 			var strday1 = $("#dtp1").val();
					if(strday1=="")
					{	
						$("#dtp1").focus();
						return;
					}
					
					//alert("222");
					
					var strurl;
					var strstid;
					strstid=<?php echo $intstid;?>;
					//alert(strstid);
					if(strstid=="2")
					{
						strurl="hotelsel.php?chidno=" + '<?php echo $_SESSION["main_order_chainno"];?>' + "&stday1=" + '<?php echo $strDayTemp1;?>' + "&stday2=" + strday1;
					}
					else
					{
						strurl="hotelsel.php?chidno=" + '<?php echo $_SESSION["main_order_chainno"];?>' + "&stday1=" + strday1 + "&stday2=" + '<?php echo $strDayTemp2;?>';
					}
		 			parent.window.location.href=strurl;
		 		}
			);
		</script>
		
	</article>
</section>

</body>
	
</html>