<?php
	session_start();
	require_once("db/db.php");	
	require_once("common/common.php");
	ini_set('session.gc_maxlifetime', 99999999); //设置时间 永不过期
	//判断是否登录系统		
	if($_SESSION['main_wx_userlogined']!="1" | $_SESSION['main_wx_userno']=="")
	{
		//没有登录开始启动登录
		header('location:..\loginwx.php?rset=0');
		exit;
	}
	
	$chainno=$_SESSION["ChainNo"];
	
	$datday1=$_REQUEST["datday1"];
	
	
	if($datday1=="")
	{
		$strHotelDay="";
		$sql = sprintf("SELECT convert(varchar(10),DateAdd(day,-1,SystemDate),120) AS HotelDate FROM TR_Night_Date WHERE Chain_No='%s'",$chainno);
		$result = querySql($sql);
			
		if($row = fetch_array($result))
		{
			$strHotelDay = $row['HotelDate'];  
		}
		freeResult($result);
			
		if(strlen($strHotelDay)<10)
		{
			$strtemp=getdate();
				
			$datday1= $strtemp[year]."-".sprintf("%02d",$strtemp[mon])."-".sprintf("%02d",$strtemp[mday]);
		}
		else
		{
			$datday1=$strHotelDay;
		}
	}
?>
<!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">
	
	<Meta http-equiv="Page-Enter" Content="blendTrans(Duration=0.5)"> 
	<Meta http-equiv="Page-Exit" Content="blendTrans(Duration=0.5)">
	
	<title>客房云点通</title>
	
	<link rel="stylesheet" href="jsp4/jquery.mobile-1.4.3.min.css">
	<script src="jsp4/jquery.js"></script>
	<script src="jsp4/jquery.mobile-1.4.3.min.js"></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>
	
<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">

<section data-role="page" id="pagepayfor1">		
	<link rel="stylesheet" href="css/mycss.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>
	
	<header data-role="header" data-position="fixed" data-tap-toggle="false">
		<table width="100%" height="35" border="0" cellpadding="0" cellspacing="0">	   
			<tr>
				<td height="35" width="45" align="right">
					<a href="index.php" data-role="button" data-icon="carat-l" data-iconpos="notext" rel="external"></a>
				</td>
				<td height="35" align="left" colspan="2">
					<table width="100%" height="10" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td width="80" align="right" ><span style="color:#000 ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">结束日期：</span></td>
							<td width="90" align="left"  class="STYLEM2">
								<input type="text" id="dtp1" name="dtp1" readonly= "true" value="<?php echo $datday1;?>" data-role="date">
							</td>
							
							<td width="8" align="center"></td>
							<td width="80" align="left"  class="STYLEM2">
								<div id="bmtSendOk" onClick="OnSendFindClick()" style="border-radius:3px; width:70px; height:28px; background-color:#D7AA28;opacity:0.9;">
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr><td width="100%" height="100%" align="center">
											<span style="color:#fff ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">查 询</span>
										</td></tr>
									</table>
								</div>
							</td>
							<td align="left">&nbsp;</td>
						</tr>
					</table>
									
					
				</td>
			</tr>		  
			
		</table>
	</header>
	
	
	<article data-role="none">
		<table width="100%" height="10" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
		
			<tr><td height="5"></td></tr>
			
			<tr>
				<td align="center"><img src="submonth1.php?HotelDate=<?php echo $datday1;?>&ChainNo=<?php echo $_SESSION["ChainNo"];?>"></td>
			</tr>
			
			<tr><td height="10"></td></tr>
			<tr>
				<td align="center"><img src="submonth2.php?HotelDate=<?php echo $datday1;?>&ChainNo=<?php echo $_SESSION["ChainNo"];?>"></td>
			</tr>
			
			<tr><td height="10"></td></tr>
			<tr>
				<td align="center"><img src="submonth3.php?HotelDate=<?php echo $datday1;?>&ChainNo=<?php echo $_SESSION["ChainNo"];?>"></td>
			</tr>
			
			<tr><td height="10"></td></tr>
			<tr>
				<td align="center"><img src="submonth4.php?HotelDate=<?php echo $datday1;?>&ChainNo=<?php echo $_SESSION["ChainNo"];?>"></td>
			</tr>
		</table>
	</article>
	
	<footer data-role="footer" data-position="fixed" data-tap-toggle="false" style="border-top:0px solid #F2E2E2;border-bottom:0px solid #F2E2E2;border-left:1px solid #F2E2E2;border-right:1px solid #F2E2E2;">
		<table width="100%" height="40" border="0" cellpadding="0" cellspacing="0">
			<tr height="42" valign="top">
				<td width="50%">
					<a class="ui-btn ui-icon-grid ui-btn-icon-top" target="_parent" href="repmonthreport.php" style="width:100%;height:10px;margin:0px auto 0px auto;text-shadow:none;">月报表明细</a>
				</td>
				
				<td width="50%">					
					<a class="ui-btn ui-icon-bullets ui-btn-icon-top" target="_parent" href="#" style="width:100%;height:10px;margin:0px auto 0px auto;text-shadow:none;color:#666666;background-color:#F3F4EC;">图表分析</a>
				</td>
				
			</tr>
		</table>		
	</footer>
	
	
	<script tyle="text/javascript"> 
		//处理点击事件进入相应的页面
		function OnSendFindClick()
			{
				var strday1 = $("#dtp1").val();
				if(strday1=="")
				{	
					$("#dtp1").focus();
					return;
				}
				
		 		parent.window.location.href='repmonthreportb.php?datday1=' + strday1;
			}
						
	</script> 
	
</section>

</body>
</html>
