<?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"];
	$datday2=$_REQUEST["datday2"];
	
	//echo $datday1."**".$datday2;;
	
	if($datday1=="" | $datday2=="")
	{
		//设置默认日期
		$strHotelMonth="";
		$strHotelDay="";
		$sql = sprintf("SELECT convert(varchar(7),DateAdd(day,-1,SystemDate),120) AS HotelMonth,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))
		{
			$strHotelMonth = $row['HotelMonth'];  
			$strHotelDay = $row['HotelDate'];  
		}
		freeResult($result);
			
		if(strlen($strHotelDay)<10)
		{
			$strtemp=getdate();
				
			//$strtemp1=date("Y-m-d",strtotime("-5 day"));
			//$strtemp1=date('Y-m-d',$strtemp - 1*24*60*60);
			$datday1= $strtemp[year]."-".sprintf("%02d",$strtemp[mon])."-01";
			$datday2= $strtemp[year]."-".sprintf("%02d",$strtemp[mon])."-".sprintf("%02d",$strtemp[mday]);
		}
		else
		{
			$datday1=$strHotelMonth.'-01';
			$datday2=$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><?php echo $_SESSION['ChainName']?></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>
	
	<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>
</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">		
		
	<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="100%" align="center">
					<div style="width:100%;height:20px;margin-top:6px;" align="center">
						<span style="color:#000 ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-shadow:none;">营业月报表</span>
					</div>
					<div style="width:100%;height:15px;" align="center" valign="top">
						<span style="color:#000 ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;"><?php echo $datday1.'&nbsp;至&nbsp;'.$datday2;?></span>
					</div>
				</td>
			</tr>
			
			<tr><td height="8" width="100%" align="center"></td></tr>
			
		</table>
	</header>
	
	
	<article data-role="none">
		

		<ul data-role="listview" data-inset="true" data-divider-theme="a">   			
			
			<?php				
							
				//1.得到总房数
				$AllRoomCount=0;
				$sql=sprintf("SELECT COUNT(a.Room_No)AS RoomCount FROM TR_Room_Inform a,TR_Room_Type b WHERE a.TypeListNo=b.ListNo AND b.Chain_No='%s'",$chainno);
						
				$result = querySql($sql);		
				$row = fetch_array($result);
				
				$AllRoomCount=$row['RoomCount'];
				
				freeResult($result);	//关闭记录集
				
				

				$SumRoomCountAll=0;
				$SumTimeCountAll=0;
				$SumFreeCountAll=0;
				$SumWXCountAll=0;
				$RoomRZCountAll=0;
				$RoomCZCountDayAll=0;

				$SumRoomValAll=0;
				$SumOtherValAll=0;
				$SumAllValAll=0;
				$SumCZLValAll=0;
				$SumPJFJValAll=0;
				$SumAVPValAll=0;
				$SumRAPValAll=0;


				
				$HotelDate="";
				$SumRoomCount=0;
				$SumTimeCount=0;
				$SumFreeCount=0;
				$SumWXCount=0;
				
				$SumRoomVal=0;
				$SumOtherVal=0;
				$SumAllVal=0;
				$SumCZLVal=0;
				$SumPJFJVal=0;
				$SumAVPVal=0;
				$SumRAPVal=0;
				
				$sql=sprintf("SELECT convert(varchar(10),t.HotelDate,120)AS HotelDay,SUM(RoomCount)AS SumRoomCount,SUM(TimeCount)AS SumTimeCount,SUM(FreeCount)AS SumFreeCount,SUM(WeiXCount)AS SumWXCount
					,SUM(SumRoomVal)AS SumRoomVal,SUM(SumOtherVal)AS SumOtherVal,SUM(SumAllVal)AS SumAllVal,SUM(CZLVal)AS SumCZLVal,Sum(PJFJVal)AS SumPJFJVal,Sum(AVPVal)AS SumAVPVal,Sum(RAPVal)AS SumRAPVal FROM (

					SELECT HotelDate,COUNT(ListNo) AS RoomCount,0 AS TimeCount,0 AS FreeCount,0 AS WeiXCount,0 AS SumRoomVal,0 AS SumOtherVal,0 AS SumAllVal
						,0 AS CZLVal,0 AS PJFJVal,0 AS AVPVal,0 AS RAPVal
					FROM TR_RepHotelDayList WHERE Chain_No='%s' AND HotelDate>='%s' AND HotelDate<='%s' AND Sited_TimeFlag=0 AND Sited_FreeFlag=0 AND Room_No<>'已退房' AND Room_No<>'临时帐' GROUP BY HotelDate

					UNION SELECT HotelDate,0 AS RoomCount,COUNT(ListNo) AS TimeCount,0 AS FreeCount,0 AS WeiXCount,0 AS SumRoomVal,0 AS SumOtherVal,0 AS SumAllVal
						,0 AS CZLVal,0 AS PJFJVal,0 AS AVPVal,0 AS RAPVal
					FROM TR_RepHotelDayList WHERE Chain_No='%s' AND HotelDate>='%s' AND HotelDate<='%s' AND Sited_TimeFlag=1 AND Room_No<>'已退房' AND Room_No<>'临时帐' GROUP BY HotelDate

					UNION SELECT HotelDate,0 AS RoomCount,0 AS TimeCount,COUNT(ListNo) AS FreeCount,0 AS WeiXCount,0 AS SumRoomVal,0 AS SumOtherVal,0 AS SumAllVal
						,0 AS CZLVal,0 AS PJFJVal,0 AS AVPVal,0 AS RAPVal
					FROM TR_RepHotelDayList WHERE Chain_No='%s' AND HotelDate>='%s' AND HotelDate<='%s' AND Sited_FreeFlag=1 AND Room_No<>'已退房' AND Room_No<>'临时帐' GROUP BY HotelDate

					UNION SELECT HotelDate,0 AS RoomCount,0 AS TimeCount,0 AS FreeCount,SUM(DayVal) AS WeiXCount,0 AS SumRoomVal,0 AS SumOtherVal,0 AS SumAllVal
						,0 AS CZLVal,0 AS PJFJVal,0 AS AVPVal,0 AS RAPVal
					FROM TR_RepHotelDayReport WHERE Chain_No='%s' AND HotelDate>='%s' AND HotelDate<='%s' AND ItemName='维修房数' GROUP BY HotelDate

					UNION SELECT HotelDate,0 AS RoomCount,0 AS TimeCount,0 AS FreeCount,0 AS WeiXCount,0 AS SumRoomVal,0 AS SumOtherVal,0 AS SumAllVal
						,SUM(DayVal) AS CZLVal,0 AS PJFJVal,0 AS AVPVal,0 AS RAPVal
					FROM TR_RepHotelDayReport WHERE Chain_No='%s' AND HotelDate>='%s' AND HotelDate<='%s' AND ItemName='客房出租率' GROUP BY HotelDate

					UNION SELECT HotelDate,0 AS RoomCount,0 AS TimeCount,0 AS FreeCount,0 AS WeiXCount,0 AS SumRoomVal,0 AS SumOtherVal,0 AS SumAllVal
						,0 AS CZLVal,SUM(DayVal) AS PJFJVal,0 AS AVPVal,0 AS RAPVal
					FROM TR_RepHotelDayReport WHERE Chain_No='%s' AND HotelDate>='%s' AND HotelDate<='%s' AND ItemName='平均房价' GROUP BY HotelDate

					UNION SELECT HotelDate,0 AS RoomCount,0 AS TimeCount,0 AS FreeCount,0 AS WeiXCount,0 AS SumRoomVal,0 AS SumOtherVal,0 AS SumAllVal
						,0 AS CZLVal,0 AS PJFJVal,SUM(DayVal) AS AVPVal,0 AS RAPVal
					FROM TR_RepHotelDayReport WHERE Chain_No='%s' AND HotelDate>='%s' AND HotelDate<='%s' AND ItemName='AVP(房费/住房数)' GROUP BY HotelDate

					UNION SELECT HotelDate,0 AS RoomCount,0 AS TimeCount,0 AS FreeCount,0 AS WeiXCount,0 AS SumRoomVal,0 AS SumOtherVal,0 AS SumAllVal
						,0 AS CZLVal,0 AS PJFJVal,0 AS AVPVal,SUM(DayVal) AS RAPVal
					FROM TR_RepHotelDayReport WHERE Chain_No='%s' AND HotelDate>='%s' AND HotelDate<='%s' AND ItemName='RAP(房费/总房数)' GROUP BY HotelDate

					UNION SELECT HotelDate,0 AS RoomCount,0 AS TimeCount,0 AS FreeCount,0 AS WeiXCount,SUM(TJ_RoomVal)AS SumRoomVal,SUM(TJ_TelVal+TJ_FBVal+TJ_PCVal+TJ_VIPVal+TJ_OtherVal)AS SumOtherVal,SUM(TJ_SumVal)AS SumAllVal
						,0 AS CZLVal,0 AS PJFJVal,0 AS AVPVal,0 AS RAPVal
					FROM TR_RepHotelDayList WHERE Chain_No='%s' AND HotelDate>='%s' AND HotelDate<='%s' GROUP BY HotelDate) t GROUP BY t.HotelDate ORDER BY t.HotelDate DESC"
						,$chainno,$datday1,$datday2,$chainno,$datday1,$datday2,$chainno,$datday1,$datday2,$chainno,$datday1,$datday2,$chainno,$datday1,$datday2,$chainno,$datday1,$datday2
						,$chainno,$datday1,$datday2,$chainno,$datday1,$datday2,$chainno,$datday1,$datday2);

				$result = querySql($sql);		
				
				while($row = fetch_array($result))
				{
					$intRowCount=$intRowCount+1;
					
					//得到每一条的记录信息					
					$HotelDate=$row['HotelDay'];
					$RoomRZCount=$row['SumRoomCount'];
					$SumTimeCount=$row['SumTimeCount'];
					$SumFreeCount=$row['SumFreeCount'];
					$SumWXCount=$row['SumWXCount'];
					
					$SumRoomVal=$row['SumRoomVal'];
					$SumOtherVal=$row['SumOtherVal'];
					$SumAllVal=$row['SumAllVal'];
					$SumCZLVal=$row['SumCZLVal'];
					$SumPJFJVal=$row['SumPJFJVal'];
					$SumAVPVal=$row['SumAVPVal'];
					$SumRAPVal=$row['SumRAPVal'];
											
					//得到周期
					$DayWeek="";
					$intTemp=date('w',strtotime($HotelDate));
					//$intTemp=date('w',strtotime('2014-09-07'));
					switch($intTemp)
					{
						case 1:
							$DayWeek="周一";
							break;
						case 2:
							$DayWeek="周二";
							break;
						case 3:
							$DayWeek="周三";
							break;
						case 4:
							$DayWeek="周四";
							break;
						case 5:
							$DayWeek="周五";
							break;
						case 6:
							$DayWeek="周六";
							break;
						case 0:
							$DayWeek="周日";
							break;
						default:
							$DayWeek="";
							break;
					}
					
					//日租房数
					$SumRoomCount=$RoomRZCount+$SumTimeCount+$SumFreeCount;		//总出租数
					//间夜数:所有，含免费房和钟点房
					$RoomCZCountDay=round(($SumRoomCount - $SumTimeCount * 0.5),1) ;		//出租间夜数
					//出租率不含免费房
					$SumCZLValNoFree=round((($RoomRZCount+$SumTimeCount*0.5) * 100)/$AllRoomCount,1);
					//出租率钟点0.50
					$SumCZLValB=round((($RoomRZCount+$SumFreeCount+$SumTimeCount*0.5) * 100)/$AllRoomCount,1);
					//平均房价不含免费房
					//$RoomAVPriceNMF=0;
					//平均房价不含钟点房
					//$RoomAVPriceNZD=0;
					





				$SumRoomCountAll= $SumRoomCountAll + $SumRoomCount;
				$SumTimeCountAll= $SumTimeCountAll + $SumTimeCount;
				$SumFreeCountAll= $SumFreeCountAll + $SumFreeCount;
				$SumWXCountAll= $SumWXCountAll + $SumWXCount;
				$RoomRZCountAll = $RoomRZCountAll + $RoomRZCount;
				$RoomCZCountDayAll= $RoomCZCountDayAll + $RoomCZCountDay;


				$SumRoomValAll= $SumRoomValAll + $SumRoomVal;
				$SumOtherValAll= $SumOtherValAll + $SumOtherVal;
				$SumAllValAll= $SumAllValAll + $SumAllVal;



					//以下开始显示数据内容
			?>
						<div data-role="none" class="STYLEM2">
							<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="#F5F2E6">
								<tr>
									<td width="78" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;<?php echo $HotelDate;?></span></td>
									<td align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;"><?php echo $DayWeek;?></span></td>
									<td width="85" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">总房数 <?php echo $AllRoomCount;?></span></td>
									<td width="95" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">总出租数 <?php echo  number_format($SumRoomCount);?></span></td>
								</tr>
							</table>
						</div>
						<div data-role="none" class="STYLEM35">
							<table width="100%" height="50" border="0" cellpadding="0" cellspacing="0" >
								<tr>
									<td width="34%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;日租房数 <?php echo number_format($RoomRZCount);?></span></td>
									<td width="30%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">钟点房数 <?php echo number_format($SumTimeCount);?></span></td>
									<td width="36%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">免费房数 <?php echo number_format($SumFreeCount);?></span></td>
								</tr>
								<tr>
									<td width="34%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;维修房数 <?php echo number_format($SumWXCount);?></span></td>
									<td width="30%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">总间夜数 <?php echo number_format($RoomCZCountDay,1);?></span></td>
									<td width="36%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">间夜出租率 <?php echo number_format($SumCZLValB,1);?>%</span></td>
								</tr>
							</table>
						</div>
						<div data-role="none" class="STYLEM35">
							<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" >
								<tr>
									<td width="34%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;总出租率 <?php echo number_format($SumCZLVal,1);?>%</span></td>
									<td width="66%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">出租率(不含免费房) <?php echo number_format($SumCZLValNoFree,1);?>%</span></td>
								</tr>
							</table>
						</div>
						<div data-role="none" class="STYLEM35">
							<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="#F2F2F2">
								<tr>
									<td width="34%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;房费合计 <?php echo number_format($SumRoomVal,1);?></span></td>
									<td width="30%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">杂项收入 <?php echo number_format($SumOtherVal,1);?></span></td>
									<td width="36%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">营业收入 <?php echo number_format($SumAllVal,1);?></span></td>
								</tr>
							</table>
						</div>
						
						<div data-role="none" class="STYLEM35">
							<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="34%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;平均房价 <?php echo number_format($SumPJFJVal,1);?></span></td>
									<td width="30%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">平均房租 <?php echo number_format($SumAVPVal,1);?></span></td>
									<td width="36%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">客房RAP <?php echo number_format($SumRAPVal,1);?></span></td>
								</tr>
							</table>
						</div>
			<?php
				}
				//释放数据库
				freeResult($result);
				closeDb();
			?>


					<!--合计--------------->
					<div data-role="none" class="STYLEM2">
							<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="#E3DAB9">
								<tr>
									<td width="78" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;区间合计:</span></td>
									<td align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;"></span></td>
									<td width="85" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">总房数 <?php echo $AllRoomCount;?></span></td>
									<td width="95" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">总出租数 <?php echo  number_format($SumRoomCountAll);?></span></td>
								</tr>
							</table>
						</div>
						<div data-role="none" class="STYLEM35">
							<table width="100%" height="50" border="0" cellpadding="0" cellspacing="0" >
								<tr>
									<td width="34%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;日租房数 <?php echo number_format($RoomRZCountAll);?></span></td>
									<td width="30%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">钟点房数 <?php echo number_format($SumTimeCountAll);?></span></td>
									<td width="36%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">免费房数 <?php echo number_format($SumFreeCountAll);?></span></td>
								</tr>
								<tr>
									<td width="34%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;维修房数 <?php echo number_format($SumWXCountAll);?></span></td>
									<td width="30%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">总间夜数 <?php echo number_format($RoomCZCountDayAll,1);?></span></td>
									<td width="36%" align="left"></td>
								</tr>
							</table>
						</div>

						<div data-role="none" class="STYLEM35">
							<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="#F2F2F2">
								<tr>
									<td width="34%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;房费合计 <?php echo number_format($SumRoomValAll,1);?></span></td>
									<td width="30%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">杂项收入 <?php echo number_format($SumOtherValAll,1);?></span></td>
									<td width="36%" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">营业收入 <?php echo number_format($SumAllValAll,1);?></span></td>
								</tr>
							</table>
						</div>
						


		</ul>
	</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="65" border="0" cellpadding="0" cellspacing="0">
			<tr bgcolor="#f1e3e3"><td height="1" align="center" colspan="4"></tr>
			
			<tr height="30" valign="top" bgcolor="#F3F4EC">
				<td height="30" valign="middle" colspan="4">
					<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;text-shadow:none;">&nbsp;注: 间夜数 = 日租房数 + 免费房数 + 钟点房数 X 0.5 </span>
				</td>
			</tr>
			
			<tr height="42" valign="top">
				<td width="25%"> <!--index.php-->
					<a class="ui-btn ui-icon-home ui-btn-icon-top" target="_parent" href="..\indexm.php?rset=0" style="width:90%;height:10px;margin:0px auto 0px auto;">
					<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">主页</span>
					</a>
				</td>
				<td width="25%">
					<a class="ui-btn ui-icon-bullets ui-btn-icon-top" target="_parent" href="#" style="width:90%;height:10px;margin:0px auto 0px auto;color:#666666;background-color:#F3F4EC;text-shadow:none;">
					<span style="color: #666666;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">月报表明细</span>
					</a>
				</td>
				
				<td width="25%">					
					<a class="ui-btn ui-icon-bars ui-btn-icon-top" target="_parent" href="repmonthreportb.php?datday1=<?php echo $datday2;?>" style="width:90%;height:10px;margin:0px auto 0px auto;text-shadow:none;">
					<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">图表分析</span>
					</a>
				</td>
				
				<td width="25%">
					
					<a class="ui-btn ui-icon-search ui-btn-icon-top" data-rel="popup" data-position-to="window" href="#ShowRoomInput" style="width:90%;height:10px;margin:0px auto 0px auto;">
					<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">查询条件</span>
					</a>
					
					<div data-role="popup" id="ShowRoomInput" data-corners="false">
						<a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a>
						<table width="280" height="213" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
							<tr><td height ="2" colspan="3" align="center"></td></tr>
							<tr><td height ="35" colspan="3" align="center"><span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:18px;text-shadow:none;">查询条件</span></td></tr>
							<tr><td height ="1" colspan="3" align="center" bgcolor="#F2E2E2"></td></tr>
							
							<tr><td height ="15" colspan="3" align="center"></td></tr>
							<tr>
								<td height ="30" width="10"></td>
								<td height ="30">
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td width="90" height="100%" align="right">
												<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;text-shadow:none;">起始日期：</span>
											</td>
											<td height="100%" align="left">
												<input type="date" id="dtp1" name="dtp1"  value="<?php echo $datday1;?>"  data-mini="true" />
											</td>
											<td height ="100%" width="10"></td>
										</tr>
									</table>
								</td>
								<td height ="30" width="10"></td>
							</tr>
							
							<tr><td height ="15" colspan="3" align="center"></td></tr>
							<tr>
								<td height ="30" width="10"></td>
								<td height ="30">
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td width="90" height="100%" align="right">
												<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;text-shadow:none;">结束日期：</span>
											</td>
											<td height="100%" align="left">
												<input type="date" id="dtp2" name="dtp2"  value="<?php echo $datday2;?>"  data-mini="true" />
											</td>
											<td height ="100%" width="10"></td>
										</tr>
									</table>
								</td>
								<td height ="30" width="10"></td>
							</tr>
							
							<tr><td height ="30" colspan="3" align="center"></td></tr>

							<tr>
								<td height ="40" width="10"></td>
								<td height ="40" align="center">
									<div onClick="OnSendFindClick()" style="border-radius:5px;width:86%; height:38px; background-color:#D7AA28;">
										<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:16px;text-shadow:none;">确 定</span>                            	
											</td></tr>
										</table>
									</div>
								</td>
								<td height ="40" width="10"></td>
							</tr>
							
							<tr><td height ="30" colspan="3" align="center"></td></tr>
						
						</table>
					</div>
				</td>
			</tr>
		</table>		
	</footer>
	
	<script tyle="text/javascript"> 
		//相应查询按钮的事件
		function OnSendFindClick()
		{
			var strday1 = $("#dtp1").val();
			var strday2 = $("#dtp2").val();
				
			if(strday1=="")
			{	
				$("#dtp1").focus();
				return;
			}
			if(strday2=="")
			{	
				$("#dtp2").focus();
				return;
			}
			parent.window.location.href='repmonthreport.php?datday1=' + strday1 + '&datday2=' + strday2;
		};
			
		
	</script> 
	
</section>

</body>
</html>
