<?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;
	}
	
	$datday1=$_REQUEST["datday1"];
	$datday2=$_REQUEST["datday2"];
	
	//echo $datday1."**".$datday2;;
	
	if($datday1=="" | $datday2=="")
	{
		//设置默认日期
		$strtemp=getdate();
		$strtemp1=date("Y-m-d",strtotime("-20 day"));
		//$strtemp1=date('Y-m-d',$strtemp - 1*24*60*60);
		$datday1= $strtemp1;//[year]."-".sprintf("%02d",$strtemp1[mon])."-".sprintf("%02d",$strtemp1[mday]);
		$datday2= $strtemp[year]."-".sprintf("%02d",$strtemp[mon])."-".sprintf("%02d",$strtemp[mday]);
	}
	//echo $datday1."+++".$datday2."**".$strtemp1;
?>
<!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>
	
	<style>
	.grid-container {
		  display: grid;
		  grid-template-columns: repeat(5, 1fr); /* 创建三列，每列等宽 */
		  gap: 0px; /* 设置列与列之间的间隔 */
		}
	</style>
</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="45" align="right">
					<a href="../indexm.php?rset=0" data-role="button" data-icon="home" data-iconpos="notext" rel="external"></a>
				</td>
				<td height="35" width="6" align="right"></td>
				<td height="35" align="center" >
					<span style="color:#000 ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:18px;text-shadow:none;">房态统计</span>
					
				</td>
				<td height="35" width="40" align="right"></td>
			</tr>		  
			
		</table>
	</header>
	-->
	
	<article data-role="none" style="background-color:#fff" >
		<table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFF">
			
			<tr>
				<td height="1" width="6" ></td>
				<td height="1">

					<?php				
						$chainno=$_SESSION["ChainNo"];
						
						$strNowDay='2020-01-01';	//当日开始
						$strEndDay='2020-01-02';	//结束日期
						
						$intRoomFixCount=0;		//客房总数
						
						//--1.获取总房间数
						$sql=sprintf("SELECT COUNT(a.ListNo)AS RoomCount,convert(varchar(10),getdate(),23)AS ServerTime1,convert(varchar(10),dateadd(day,1,getdate()),23)AS ServerTime2
								FROM TR_Room_Inform a,TR_Room_Type b Where a.TypeListNo=b.ListNo And b.Chain_No='%s'",$chainno);
						
						$result = querySql($sql);
						if($row = fetch_array($result))
						{
							$intRoomFixCount=$row['RoomCount'];
							$strNowDay=$row['ServerTime1'];
							$strEndDay=$row['ServerTime2'];
						}
						freeResult($result);
						
						
						//--2.统计房间状态数量
						/*
						$intSRCount1=0;
						$intSRCount2=0;
						$intSRCount3=0;
						$intSRCount4=0;
						$intSRCount5=0;
						$intSRCount6=0;
						$intSRCount7=0;
						$intSRCount8=0;
						
						$sql=sprintf("SELECT SRCount1,SRCount2,SRCount3,SRCount4,SRCount5,SRCount6,SRCount7,SRCount8 FROM dbo.TR_RoomStateCountTJ('%s')",$chainno);
						$result = querySql($sql);
						if($row = fetch_array($result))
						{
							$intSRCount1=$row['SRCount1'];
							$intSRCount2=$row['SRCount2'];
							$intSRCount3=$row['SRCount3'];
							$intSRCount4=$row['SRCount4'];
							$intSRCount5=$row['SRCount5'];
							$intSRCount6=$row['SRCount6'];
							$intSRCount7=$row['SRCount7'];
							$intSRCount8=$row['SRCount8'];
						}
						freeResult($result);
						*/
						
						
						//--3.开始统计当日汇总
						$intRoomCount1=0;	//当前在住1
						$intRoomCount2=0;	//预计到店2
						$intRoomCount3=0;	//实际到店3
						$intRoomCount5=0;	//当天入住5
						$intRoomCount6=0;	//预计到店6
						$intRoomCount7=0;	//实际离店7
						$intRoomCount8=0;	//提前离店8
						
						$intManCount1=0;	//当前在住1
						$intManCount2=0;	//预计到店2
						$intManCount3=0;	//实际到店3
						$intManCount5=0;	//当天入住5
						$intManCount6=0;	//预计到店6
						$intManCount7=0;	//实际离店7
						$intManCount8=0;	//提前离店8
						
						$intRoomHadIn = 0;
						$intRoomManHadIn = 0;
						
						//--3.1.当前在住
						$sql=sprintf("SELECT 1 AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								Where a.Order_No=b.Order_No And b.Chain_No='%s' And b.Order_State<2 And a.Room_BillState=2

								--3.2.预订预到的
								UNION SELECT 2 AS MyID,SUM(BookCount)AS RoomCount,Sum(Man_Count + Lady_Count)AS SumManCount
								FROM TR_Order_Inform a WHERE a.Chain_No='%s' AND a.Order_State=0 AND a.CheckInTime>='%s' AND a.CheckInTime<='%s'

								UNION SELECT 9 AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								Where a.Order_No=b.Order_No And b.Chain_No='%s' And b.Order_State=0 And a.Room_BillState=2 AND b.CheckInTime>='%s' AND b.CheckInTime<='%s'

								--3.3.预订接待
								UNION SELECT 3 AS MyID,COUNT(b.ListNo)AS RoomCount,Sum(b.Man_Count)AS SumManCount FROM TR_Order_Inform a,TR_Order_Room_List b,TR_Order_Book_TakeIn c
								WHERE a.Order_No=c.Order_No AND c.DoType=0 AND a.Order_No=b.Order_No AND b.ListNo=c.BListNo AND a.Chain_No='%s'
								AND (c.TradeTime>='%s' AND c.TradeTime<='%s')

								--4.预订数
								--5.当日到店
								UNION SELECT 5 AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								WHERE(a.Order_No = b.Order_No And (b.Order_State = 0 Or b.Order_State = 1 Or b.Order_State = 3) And (a.Room_BillState = 2 Or a.Room_BillState = 3))
								AND b.Chain_No='%s' AND a.SelectRoomTime>='%s' AND a.SelectRoomTime<='%s'

								--6.预计离店
								UNION SELECT 6 AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								WHERE(a.Order_No = b.Order_No And (b.Order_State = 0 Or b.Order_State = 1) And a.Room_BillState = 2)
								AND b.Chain_No='%s' AND (a.Cancel_Date>='%s' AND a.Cancel_Date<'%s')

								--7.实际离店
								UNION SELECT 7 AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								WHERE(a.Order_No = b.Order_No And (b.Order_State = 0 Or b.Order_State = 1 Or b.Order_State = 3) And a.Room_BillState = 3)
								AND b.Chain_No='%s' AND a.Cancel_Date>='%s' AND a.Cancel_Date<'%s'

								--8.提前离店
								UNION SELECT 8 AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								WHERE(a.Order_No = b.Order_No And (b.Order_State = 0 Or b.Order_State = 1 Or b.Order_State = 3) And a.Room_BillState = 3)
								AND b.Chain_No='%s' AND a.Cancel_Date>='%s' AND a.Cancel_Date<'%s' And a.DefCancel_Time>'%s'",$chainno,$chainno,$strNowDay,$strEndDay,$chainno,$strNowDay,$strEndDay
								,$chainno,$strNowDay,$strEndDay,$chainno,$strNowDay,$strEndDay,$chainno,$strNowDay,$strEndDay,$chainno,$strNowDay,$strEndDay,$chainno,$strNowDay,$strEndDay,$strEndDay);

						$result = querySql($sql);
						
						while($row = fetch_array($result))
						{
							$intRowID = $row['MyID'];
							if (is_null($row['RoomCount'])) 
							{
								$intSubRoomCount = 0;
							} else 
							{
								$intSubRoomCount = $row['RoomCount'];
							}
							
							if (is_null($row['SumManCount'])) 
							{
								$intSubManCount = 0;
							} else 
							{
								$intSubManCount = $row['SumManCount'];
							}
														
							switch($intRowID) 
							{
								case 1:
									$intRoomCount1=$intSubRoomCount;
									$intManCount1=$intSubManCount;
									break;
								case 2:
									$intRoomCount2=$intSubRoomCount;
									$intManCount2=$intSubManCount;
									break;
								case 3:
									$intRoomCount3=$intSubRoomCount;
									$intManCount3=$intSubManCount;
									break;
								case 5:
									$intRoomCount5=$intSubRoomCount;
									$intManCount5=$intSubManCount;
									break;
								case 6:
									$intRoomCount6=$intSubRoomCount;
									$intManCount6=$intSubManCount;
									break;
								case 7:
									$intRoomCount7=$intSubRoomCount;
									$intManCount7=$intSubManCount;
									break;
								case 8:
									$intRoomCount8=$intSubRoomCount;
									$intManCount8=$intSubManCount;
									break;
								case 9:
									$intRoomHadIn=$intSubRoomCount;
									$intRoomManHadIn=$intSubManCount;
									break;
							}
							
						}
						//释放数据库 $fltSumVal1
						freeResult($result);
						
						//生成减去预订接待后的预计到店房间数
						$intRoomCount2=$intRoomCount2 - $intRoomHadIn;
						$intManCount2=$intManCount2 - $intRoomManHadIn;
						if($intRoomCount2<0)
						{
							$intRoomCount2=0;
						}
						if($intManCount2<0)
						{
							$intManCount2=0;
						}
						
						 //计算当前在住的占比
						$fltRoomRateFixVal=0;
						if($intRoomFixCount>0)
						{
							$fltRoomRateFixVal= round($intRoomCount1 * 100/$intRoomFixCount,1);
						}
						
						
						//计算本夜占用
						$intTodayNightRoomCount= $intRoomCount1 - $intRoomCount6 + $intRoomCount2;
						$intTodayNightManCount= $intManCount1 - $intManCount6 + $intManCount2;
						if($intRoomFixCount>0)
						{
							$fltTodayNightRateVal= round($intTodayNightRoomCount * 100/$intRoomFixCount,1);
						}
						else
						{
							$fltTodayNightRateVal=0;
						}
						
						
						//--计算散客、团队的
						//--1.当前在住
						
						//散客
						$intRoomCountSK=0;
						$intManCountSK=0;
						
						//团队
						$intRoomCountTD=0;
						$intManCountTD=0;
							
						//美团
						$intRoomCountMT=0;
						$intManCountMT=0;
							
						//携程
						$intRoomCountXC=0;
						$intManCountXC=0;
							
						//飞猪
						$intRoomCountFZ=0;
						$intManCountFZ=0;
							
						//抖音
						$intRoomCountDY=0;
						$intManCountDY=0;
						
						$sql=sprintf("SELECT 'A1' AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								Where a.Order_No=b.Order_No And b.Chain_No='%s' And b.Order_State<2 And a.Room_BillState=2 And (b.Custom_Type='会议' OR b.Custom_Type='团队')
								--2.预订预到的
								UNION SELECT 'A2' AS MyID,SUM(BookCount)AS RoomCount,Sum(Man_Count + Lady_Count)AS SumManCount
								FROM TR_Order_Inform a WHERE a.Chain_No='%s' AND a.Order_State=0 AND a.CheckInTime>='%s' AND a.CheckInTime<='%s'
								And (a.Custom_Type='会议' OR a.Custom_Type='团队')
								
								--5.预计离店
								UNION SELECT 'A3' AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								WHERE(a.Order_No = b.Order_No And (b.Order_State = 0 Or b.Order_State = 1) And (a.Room_BillState = 1 Or a.Room_BillState = 2))
								AND ((a.Cancel_Date>='%s' AND a.Cancel_Date<'%s') OR (a.DefCancel_Time>='%s' AND a.DefCancel_Time<'%s')) AND b.Chain_No='%s'
								AND (a.Cancel_Date>='%s' AND a.Cancel_Date<'%s') AND b.Chain_No='%s'
								And (b.Custom_Type='会议' OR b.Custom_Type='团队')
								
								--美团
								UNION SELECT 'B2' AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								Where a.Order_No=b.Order_No And b.Chain_No='%s' And b.Order_State<2 And a.Room_BillState=2 And b.Custom_Type='美团'
								--2.预订预到的
								UNION SELECT 'B2' AS MyID,SUM(BookCount)AS RoomCount,Sum(Man_Count + Lady_Count)AS SumManCount
								FROM TR_Order_Inform a WHERE a.Chain_No='%s' AND a.Order_State=0 AND a.CheckInTime>='%s' AND a.CheckInTime<='%s'
								And a.Custom_Type='美团'

								--5.预计离店
								UNION SELECT 'B3' AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								WHERE(a.Order_No = b.Order_No And (b.Order_State = 0 Or b.Order_State = 1) And (a.Room_BillState = 1 Or a.Room_BillState = 2))
								AND ((a.Cancel_Date>='%s' AND a.Cancel_Date<'%s') OR (a.DefCancel_Time>='%s' AND a.DefCancel_Time<'%s')) AND b.Chain_No='%s'
								AND (a.Cancel_Date>='%s' AND a.Cancel_Date<'%s') AND b.Chain_No='%s'
								And b.Custom_Type='美团'

								--携程
								UNION SELECT 'C1' AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								Where a.Order_No=b.Order_No And b.Chain_No='%s' And b.Order_State<2 And a.Room_BillState=2 And b.Custom_Type='携程'
								--2.预订预到的
								UNION SELECT 'C2' AS MyID,SUM(BookCount)AS RoomCount,Sum(Man_Count + Lady_Count)AS SumManCount
								FROM TR_Order_Inform a WHERE a.Chain_No='%s' AND a.Order_State=0 AND a.CheckInTime>='%s' AND a.CheckInTime<='%s'
								And a.Custom_Type='携程'

								--5.预计离店
								UNION SELECT 'C3' AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								WHERE(a.Order_No = b.Order_No And (b.Order_State = 0 Or b.Order_State = 1) And (a.Room_BillState = 1 Or a.Room_BillState = 2))
								AND ((a.Cancel_Date>='%s' AND a.Cancel_Date<'%s') OR (a.DefCancel_Time>='%s' AND a.DefCancel_Time<'%s')) AND b.Chain_No='%s'
								AND (a.Cancel_Date>='%s' AND a.Cancel_Date<'%s') AND b.Chain_No='%s'
								And b.Custom_Type='携程'

								--飞猪
								UNION SELECT 'D1' AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								Where a.Order_No=b.Order_No And b.Chain_No='%s' And b.Order_State<2 And a.Room_BillState=2 And b.Custom_Type='飞猪'
								--2.预订预到的
								UNION SELECT 'D2' AS MyID,SUM(BookCount)AS RoomCount,Sum(Man_Count + Lady_Count)AS SumManCount
								FROM TR_Order_Inform a WHERE a.Chain_No='%s' AND a.Order_State=0 AND a.CheckInTime>='%s' AND a.CheckInTime<='%s'
								And a.Custom_Type='飞猪'

								--5.预计离店
								UNION SELECT 'D3' AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								WHERE(a.Order_No = b.Order_No And (b.Order_State = 0 Or b.Order_State = 1) And (a.Room_BillState = 1 Or a.Room_BillState = 2))
								AND ((a.Cancel_Date>='%s' AND a.Cancel_Date<'%s') OR (a.DefCancel_Time>='%s' AND a.DefCancel_Time<'%s')) AND b.Chain_No='%s'
								AND (a.Cancel_Date>='%s' AND a.Cancel_Date<'%s') AND b.Chain_No='%s'
								And b.Custom_Type='飞猪' 

								--抖音
								UNION SELECT 'E1' AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								Where a.Order_No=b.Order_No And b.Chain_No='%s' And b.Order_State<2 And a.Room_BillState=2 And b.Custom_Type='抖音'
								--2.预订预到的
								UNION SELECT 'E2' AS MyID,SUM(BookCount)AS RoomCount,Sum(Man_Count + Lady_Count)AS SumManCount
								FROM TR_Order_Inform a WHERE a.Chain_No='%s' AND a.Order_State=0 AND a.CheckInTime>='%s' AND a.CheckInTime<='%s'
								And a.Custom_Type='抖音' 

								--5.预计离店
								UNION SELECT 'E3' AS MyID,COUNT(a.ListNo)AS RoomCount,Sum(a.Man_Count)AS SumManCount FROM TR_Order_Room_List a,TR_Order_Inform b
								WHERE(a.Order_No = b.Order_No And (b.Order_State = 0 Or b.Order_State = 1) And (a.Room_BillState = 1 Or a.Room_BillState = 2))
								AND ((a.Cancel_Date>='%s' AND a.Cancel_Date<'%s') OR (a.DefCancel_Time>='%s' AND a.DefCancel_Time<'%s')) AND b.Chain_No='%s'
								AND (a.Cancel_Date>='%s' AND a.Cancel_Date<'%s') AND b.Chain_No='%s'
								And b.Custom_Type='抖音'",$chainno,$chainno,$strNowDay,$strEndDay,$strNowDay,$strEndDay,$strNowDay,$strNowDay,$chainno,$strNowDay,$strEndDay,$chainno
								,$chainno,$chainno,$strNowDay,$strEndDay,$strNowDay,$strEndDay,$strNowDay,$strNowDay,$chainno,$strNowDay,$strEndDay,$chainno
								,$chainno,$chainno,$strNowDay,$strEndDay,$strNowDay,$strEndDay,$strNowDay,$strNowDay,$chainno,$strNowDay,$strEndDay,$chainno
								,$chainno,$chainno,$strNowDay,$strEndDay,$strNowDay,$strEndDay,$strNowDay,$strNowDay,$chainno,$strNowDay,$strEndDay,$chainno
								,$chainno,$chainno,$strNowDay,$strEndDay,$strNowDay,$strEndDay,$strNowDay,$strNowDay,$chainno,$strNowDay,$strEndDay,$chainno);
								
						$result = querySql($sql);
						
						while($row = fetch_array($result))
						{
							$intRowID = $row['MyID'];
							if (is_null($row['RoomCount'])) 
							{
								$intSubRoomCount = 0;
							} else 
							{
								$intSubRoomCount = $row['RoomCount'];
							}
							
							if (is_null($row['SumManCount'])) 
							{
								$intSubManCount = 0;
							} else 
							{
								$intSubManCount = $row['SumManCount'];
							}

							
							
							switch($intRowID) 
							{
								case 'A1':	//团队：当前在住
									$intRoomCountTD= $intRoomCountTD + $intSubRoomCount;
									$intManCountTD= $intManCountTD + $intSubManCount;
									break;
								case 'A2':	//团队：预订预到的
									$intRoomCountTD= $intRoomCountTD + $intSubRoomCount;
									$intManCountTD= $intManCountTD + $intSubManCount;
									break;
								case 'A3':	//团队：预计离店
									$intRoomCountTD= $intRoomCountTD - $intSubRoomCount;
									$intManCountTD= $intManCountTD - $intSubManCount;
									break;
									
								case 'B1':	//美团：当前在住
									$intRoomCountMT= $intRoomCountMT + $intSubRoomCount;
									$intManCountMT= $intManCountMT + $intSubManCount;
									break;
								case 'B2':	//美团：预订预到的
									$intRoomCountMT= $intRoomCountMT + $intSubRoomCount;
									$intManCountMT= $intManCountMT + $intSubManCount;
									break;
								case 'B3':	//美团：预计离店
									$intRoomCountMT= $intRoomCountMT - $intSubRoomCount;
									$intManCountMT= $intManCountMT - $intSubManCount;
									break;
								
								case 'C1':	//携程：当前在住
									$intRoomCountXC= $intRoomCountXC + $intSubRoomCount;
									$intManCountXC= $intManCountXC + $intSubManCount;
									break;
								case 'C2':	//携程：预订预到的
									$intRoomCountXC= $intRoomCountXC + $intSubRoomCount;
									$intManCountXC= $intManCountXC + $intSubManCount;
									break;
								case 'C3':	//携程：预计离店
									$intRoomCountXC= $intRoomCountXC - $intSubRoomCount;
									$intManCountXC= $intManCountXC - $intSubManCount;
									break;
									
								case 'D1':	//飞猪：当前在住
									$intRoomCountFZ= $intRoomCountFZ + $intSubRoomCount;
									$intManCountFZ= $intManCountFZ + $intSubManCount;
									break;
								case 'D2':	//飞猪：预订预到的
									$intRoomCountFZ= $intRoomCountFZ + $intSubRoomCount;
									$intManCountFZ= $intManCountFZ + $intSubManCount;
									break;
								case 'D3':	//飞猪：预计离店
									$intRoomCountFZ= $intRoomCountFZ - $intSubRoomCount;
									$intManCountFZ= $intManCountFZ - $intSubManCount;
									break;
									
								case 'E1':	//抖音：当前在住
									$intRoomCountDY= $intRoomCountDY + $intSubRoomCount;
									$intManCountDY= $intManCountDY + $intSubManCount;
									break;
								case 'E2':	//抖音：预订预到的
									$intRoomCountDY= $intRoomCountDY + $intSubRoomCount;
									$intManCountDY= $intManCountDY + $intSubManCount;
									break;
								case 'E3':	//抖音：预计离店
									$intRoomCountDY= $intRoomCountDY - $intSubRoomCount;
									$intManCountDY= $intManCountDY - $intSubManCount;
									break;
							}
							
						}
						//释放数据库 $fltSumVal1
						freeResult($result);
								
						
						//计算散客统计
						$intRoomCountSK = $intTodayNightRoomCount - $intRoomCountTD - $intRoomCountMT - $intRoomCountXC - $intRoomCountFZ - $intRoomCountDY;
						$intManCountSK = $intTodayNightManCount - $intManCountTD - $intManCountMT - $intManCountXC - $intManCountFZ - $intManCountDY;
						if($intRoomCountSK<0)
						{
							$intRoomCountSK=0;
						}
						if($intManCountSK<0)
						{
							$intManCountSK=0;
						}
								
								
								
								
						//--计算总房费
						//--1.当前在住
						
						$fltSumRoomScore=0;
						
						$sql=sprintf("SELECT 1 AS MyID,SUM(a.RoomPrice)AS SumPrice FROM TR_Order_Room_List a,TR_Order_Inform b
									Where a.Order_No=b.Order_No And b.Chain_No='%s' And b.Order_State<2 And a.Room_BillState=2
									--2.预订预到的
									UNION SELECT 2 AS MyID,SUM(b.Room_Count * b.RoomPrice) FROM TR_Order_Inform a,TR_Book_RoomType b
									WHERE a.Order_No=b.Order_No And a.Chain_No='%s' AND a.Order_State=0 AND a.CheckInTime>='%s' AND a.CheckInTime<='%s'

									--5.预计离店
									UNION SELECT 3 AS MyID,SUM(a.RoomPrice)AS SumPrice FROM TR_Order_Room_List a,TR_Order_Inform b
									WHERE(a.Order_No = b.Order_No And (b.Order_State = 0 Or b.Order_State = 1) And (a.Room_BillState = 1 Or a.Room_BillState = 2))
									AND b.Chain_No='%s' AND ((a.Cancel_Date>='%s' AND a.Cancel_Date<'%s'))",$chainno,$chainno,$strNowDay,$strEndDay,$chainno,$strNowDay,$strEndDay);
									
						$result = querySql($sql);
						
						while($row = fetch_array($result))
						{
							$intRowID = $row['MyID'];
							if (is_null($row['SumPrice'])) 
							{
								$intSubScoreVal = 0;
							} else 
							{
								$intSubScoreVal = $row['SumPrice'];
							}
							
							switch($intRowID) 
							{
								case 1:
									$fltSumRoomScore = $fltSumRoomScore + $intSubScoreVal;
									break;
								case 2:
									$fltSumRoomScore = $fltSumRoomScore + $intSubScoreVal;
									break;
								case 3:
									$fltSumRoomScore = $fltSumRoomScore - $intSubScoreVal;
									break;
							}
							
						}
						//释放数据库 $fltSumVal1
						freeResult($result);
								
								
						//计算平均房价
						$fltTodayPriceAVG=0;
						$fltTemp = $intTodayNightRoomCount;
						if($fltTemp>0)
						{
							$fltTodayPriceAVG = round($fltSumRoomScore / $fltTemp,1);
						}
						
						//计算本夜可用
						$intTodayFreeRoomCount = $intRoomFixCount - $intTodayNightRoomCount;
						
						$intWeiXiuRoomCount=0;
						$sql=sprintf("SELECT COUNT(a.Room_No)AS SRCount7 FROM TR_Room_Inform a,TR_Room_Type b WHERE a.TypeListNo=b.ListNo AND b.Chain_No='%s' AND (a.Room_State=6)",$chainno);
						$result = querySql($sql);
						if($row = fetch_array($result))
						{
							$intWeiXiuRoomCount=$row['SRCount7'];
						}
						freeResult($result);
						
						
						//可卖房数= 本夜可用 - 维修房数
						$intTodayCanSaleCount = $intTodayFreeRoomCount - $intWeiXiuRoomCount;
		
		
					?>
					
					
					
					
					
					
					<div data-role="none" class="STYLEM2">
												
						<table width="100%" height="30" cellpadding="0" cellspacing="0" style="border-left: 1px solid #F6F2F2;border-right: 1px solid #F6F2F2;">
							<tr bgcolor="#F6F2F2">
								<td height="30" width="10"></td>
								
								<td height="30" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">1.业务流转</span>
								</td>
								
								<td height="30" 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 height="30" 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 height="30" 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 height="30" width="10"></td>
							</tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">当前在住</span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intRoomCount1;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intManCount1;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $fltRoomRateFixVal;?>%</span>
								</td>
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="6" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">预计到店</span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intRoomCount2;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intManCount2;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									
								</td>
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="6" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">实际到店</span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intRoomCount3;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intManCount3;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									
								</td>
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="6" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">当天入住</span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intRoomCount5;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intManCount5;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									
								</td>
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="6" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">预计离店</span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intRoomCount6;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intManCount6;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									
								</td>
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="6" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">实际离店</span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intRoomCount7;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intManCount7;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									
								</td>
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="6" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">提前离店</span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intRoomCount8;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intManCount8;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									
								</td>
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="6" align="center"></tr>
							
						</table>
						
						<table width="100%" height="8" border="0"  cellpadding="0" cellspacing="0">
							<tr><td height="8"></td></tr>
						</table>
					</div>
				
				
				
				
				
					<div data-role="none" class="STYLEM2">
						
						<table width="100%" height="30" cellpadding="0" cellspacing="0" style="border-left: 1px solid #F6F2F2;border-right: 1px solid #F6F2F2;">
							
							<tr bgcolor="#F6F2F2">
								<td height="30" width="10"></td>
								
								<td height="30" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">2.本日预测</span>
								</td>
								
								<td height="30" 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 height="30" 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 height="30" 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 height="30" width="10"></td>
							</tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">本夜占用</span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intTodayNightRoomCount;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intTodayNightManCount;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $fltTodayNightRateVal;?>%</span>
								</td>
								<td height="25" width="10"></td>
							</tr>
														
							<tr bgcolor="#F6F2F2"><td height="1" colspan="6" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">散客</span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intRoomCountSK;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intManCountSK;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									
								</td>
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="6" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">美团</span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intRoomCountMT;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intManCountMT;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									
								</td>
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="6" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">携程</span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intRoomCountXC;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intManCountXC;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									
								</td>
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="6" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">飞猪</span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intRoomCountFZ;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intManCountFZ;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									
								</td>
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="6" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">抖音</span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intRoomCountDY;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intManCountDY;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									
								</td>
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="6" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">团队/会议</span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intRoomCountTD;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intManCountTD;?></span>
								</td>
								
								<td height="25" width="80" align="right">
									
								</td>
								<td height="25" width="10"></td>
							</tr>
							
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="6" align="center"></tr>
							
						</table>
						
						<table width="100%" height="8" border="0"  cellpadding="0" cellspacing="0">
							<tr><td height="8"></td></tr>
						</table>
						
					</div>
				
				
				
				
				
					<div data-role="none" class="STYLEM2">
						<table width="100%" height="2" border="0"  cellpadding="0" cellspacing="0">
							<tr><td height="2"></td></tr>
						</table>
						
						<table width="100%" height="30" cellpadding="0" cellspacing="0" style="border-left: 1px solid #F6F2F2;border-right: 1px solid #F6F2F2;">
							<tr bgcolor="#F6F2F2">
								<td height="30" width="10"></td>
								<td height="30" colspan="2" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">3.项目预测</span>
								</td>
								<td height="30" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">预计客房收入</span>
								</td>
								
								<td height="25" width="100" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo number_format($fltSumRoomScore,2);?></span>
								</td>
								
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">平均房价</span>
								</td>
								
								<td height="25" width="100" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo number_format($fltTodayPriceAVG,2);?></span>
								</td>
								
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">本夜可用</span>
								</td>
								
								<td height="25" width="100" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intTodayFreeRoomCount;?></span>
								</td>
								
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
							
							<tr>
								<td height="25" width="10"></td>
								
								<td height="25" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">可卖房数</span>
								</td>
								
								<td height="25" width="100" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $intTodayCanSaleCount;?></span>
								</td>
								
								<td height="25" width="10"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
							
						</table>
						
						
						<table width="100%" height="38" border="0"  cellpadding="0" cellspacing="0">
							<tr><td height="10"></td></tr>
							<tr>
								<td height="15" width="100%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;">本夜占用（10） = 当前在住（10）- 预计离店（0） + 预计到店（0）</span></td>
							</tr>
							<tr>
								<td height="15" width="100%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;">可卖房数（5）=总房数（15）-维修房（0）-本夜占用（10）</span></td>
							</tr>
							<tr><td height="20"></td></tr>
						</table>
					</div>
				
				</td>
				<td height="1" width="6" ></td>
			</tr>
			
		</table>
		
		
	</article>
	
	<footer data-role="footer" data-position="fixed" data-tap-toggle="false" style="border-top:0px solid #f0f0f0;border-bottom:0px solid #f0f0f0;border-left:0px solid #f0f0f0;border-right:0px solid #f0f0f0;">
		<div class="grid-container" style="height:52px;width:100%;border-bottom: 1px solid #deecfb; padding-top:0px;">
			<a class="ui-btn ui-icon-home ui-btn-icon-top" target="_parent" href="..\indexm.php?rset=0" style="width:100%;height:52px;margin:0px auto 0px auto;border-left:0px solid #f0f0f0;border-right:0px solid #f0f0f0;">
				<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">首页</span>
			</a>
			<a class="ui-btn ui-icon-bullets ui-btn-icon-top" target="_parent" href="repRoomView.php#pageroomview2?pgid=1&chainno=<?php echo $chainno;?>" style="width:100%;height:52px;margin:0px auto 0px auto;border-left:1px solid #dbdbdb;border-right:0px solid #f0f0f0;">
				<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">房源预报</span>
			</a>
			<a class="ui-btn ui-icon-grid ui-btn-icon-top" target="_parent" href="repRoomView.php?pgid=1&chainno=<?php echo $chainno;?>" style="width:100%;height:52px;margin:0px auto 0px auto;border-left:1px solid #dbdbdb;border-right:0px solid #f0f0f0;">
				<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">实时房态</span>
			</a>
			<a class="ui-btn ui-icon-bullets ui-btn-icon-top" target="_parent" href="#" style="width:100%;height:52px;margin:0px auto 0px auto;color:#666666;background-color:#d6d8f9;border-left:1px solid #dbdbdb;border-right:0px solid #f0f0f0;">
				<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">房态统计</span>
			</a>
			<a class="ui-btn ui-icon-refresh ui-btn-icon-top" target="_parent" onclick="location.reload()" style="width:100%;height:52px;margin:0px auto 0px auto;;border-left:1px solid #dbdbdb;border-right:0px solid #f0f0f0;">
				<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">刷新</span>
			</a>
		</div>
	</footer>
	
	
	
	<script type="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='rephotelph.php?datday1=' + strday1 + '&datday2=' + strday2;
		};
		 	
	</script>
		
		
</section>

</body>
</html>
