<?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;
	}
	
	$selroomstate=$_REQUEST["roomstate"];
	if($selroomstate=="*" | $selroomstate=="")
	{
		$selroomstate=$_SESSION['roomstate'];
	}
	else
	{
		if($selroomstate=="ALL")
		{
			$selroomstate="";
			$_SESSION['roomstate']="";
		}
		else
		{
			$_SESSION['roomstate']=$selroomstate;
		}
	}
	//===========
	$selbkimg1="";
	$selbkimg2="";
	$selbkimg3="";
	$selbkimg4="";
	$selbkimg5="";
	$selbkimg6="";
	$selbkimg7="";
	$selbkimg8="";
	$selbkimg9="";
	$selbkimg0="";
	//状态:0空房,1预订房,2在住房,3钟点房,4自用房,5退客房,6维修房,7锁房(9为住客脏房)
	switch($selroomstate)
	{
		case "空净房":
			$selbkimg1="background='images/selfocusd.png'";
			break;
		case "在住房":
			$selbkimg2="background='images/selfocusd.png'";
			break;
		case "钟点房":
			$selbkimg3="background='images/selfocusd.png'";
			break;
		case "住客脏房":
			$selbkimg4="background='images/selfocusd.png'";
			break;
		case "退客房":
			$selbkimg5="background='images/selfocusd.png'";
			break;
		case "维修房":
			$selbkimg6="background='images/selfocusd.png'";
			break;
		case "预订房":
			$selbkimg7="background='images/selfocusd.png'";
			break;
		case "免费房":
			$selbkimg9="background='images/selfocusd.png'";
			break;
		case "锁房":
			$selbkimg0="background='images/selfocusd.png'";
			break;
		default:
			$selbkimg8="background='images/selfocusd.png'";
			break;
	}	
	
	
	$strRevChainNo=$_REQUEST["chainno"];
	if(strlen($strRevChainNo)>0)
	{
		$sql=sprintf("SELECT Chain_No,Chain_Name FROM Chain_Infor WHERE Chain_No='%s'",$strRevChainNo);				
		$result = querySql($sql);		
		if($row = fetch_array($result))
		{
			$strNewChainNo= $row['Chain_No'];
			$strNewChainName= $row['Chain_Name'];
		}
		freeResult($result);
		
		$_SESSION["ChainNo"]=$strNewChainNo;
		$_SESSION["ChainName"]=$strNewChainName;
			
	}
	
	//判断是否可以入住和锁房
	$strNowUserNo=trim($_SESSION["main_wx_userno"]);
	$blnCanCheckInFlag=0;
	
	$sql=sprintf("SELECT Use_Flag FROM Sys_Group_Quanxian a,User_QuanXian b WHERE a.Group_No=b.Group_No And b.Use_No='%s' And (Modul_Name='men_bar337')",$strNowUserNo);
	$result = querySql($sql);
	if($row = fetch_array($result))
	{
		if($row['Use_Flag']>0)
		{
			$blnCanCheckInFlag=1;	//有设置维修房的权限
		}
	}
	//释放数据库
	freeResult($result);
	
	
?>
<!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><?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>
	
	<style>
	.grid-container {
		  display: grid;
		  grid-template-columns: repeat(5, 1fr); /* 创建三列，每列等宽 */
		  gap: 0px; /* 设置列与列之间的间隔 */
		}
	</style>
	
	<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>
</head>

<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">
<!--第一个页面的内容实现---------------------------->
<section data-role="page" id="pageroomview1">	
	<link rel="stylesheet" href="css/mycss.css">
	<script tyle="text/javascript"> 
		//处理点击事件进入相应的页面
		function gbClick(id)
		{ 
			switch (id)
			{
				case -1:	//返回
					parent.window.location.href='index.php';
					break;
				case 0:	//刷新
					window.location.href="repRoomView.php?roomstate=*";
					break;
				case 1:	//进入实时房态  空房 住客 钟点 住脏 脏房 维修 预订
					window.location.href="repRoomView.php?roomstate=空净房";
					break;
				case 2:	//进入总台缴款记录表
					window.location.href="repRoomView.php?roomstate=在住房";
					break;
				case 3:	//进入总台缴款记录表
					window.location.href="repRoomView.php?roomstate=钟点房";
					break;
				case 4:	//进入总台缴款记录表
					window.location.href="repRoomView.php?roomstate=住客脏房";
					break;
				case 5:	//进入总台缴款记录表
					window.location.href="repRoomView.php?roomstate=退客房";
					break;
				case 6:	//进入总台缴款记录表
					window.location.href="repRoomView.php?roomstate=维修房";
					break;
				case 7:	//进入总台缴款记录表
					window.location.href="repRoomView.php?roomstate=预订房";
					break;
				case 9:	//进入总台缴款记录表
					window.location.href="repRoomView.php?roomstate=免费房";
					break;
				case 10:	//进入总台缴款记录表
					window.location.href="repRoomView.php?roomstate=锁房";
					break;
				case 8:	//进入总台缴款记录表
					window.location.href="repRoomView.php?roomstate=ALL";
					break;
			}
		}
			
		function bgMouseIn(obj)
		{ 	//onmouseover,onmousemove
	　　	obj.bgColor=obj.bgColor==""?"#000000":""; 
		} 
		function bgMouseOut(obj)
		{ 	//onmouseover,onmousemove,onmouseout
	　　	obj.bgColor=obj.bgColor==""?"#000000":""; 
		} 
		function bgMouseDown(obj)
		{ 	//onmouseover,onmousemove,onmouseout
	　　	obj.bgColor=obj.bgColor==""?"#000000":""; 
		} 
		function bgMouseUp(obj)
		{ 	//onmouseover,onmousemove,onmouseout
	　　	obj.bgColor=obj.bgColor==""?"#ffffcc":""; 
		} 
		//<td onmouseover="bgMouseIn(this)" onmouseout="bgMouseOut(this)" onmousedown="bgMouseDown(this)" onmouseup="bgMouseUp(this)" onclick="gbClick(1)"></td> 
	</script>

	<?php
		$colKF="#F0ECDF";	//空房数
		$colZK="#66FF00";	//住客
		$colZD="#CCCC33";	//钟点
		$colZZ="#33FF00";	//住客脏房0099FF
		$colZF="#999999";	//脏房
		$colWX="#FF3737";	//维修
		$colYD="#0099FF";	//预订
		$colAL="#99FFFF";	//所有			
		
		$colKFTxt="#000";	//空房数
		$colZKTxt="#000";	//住客
		$colZDTxt="#000";	//钟点
		$colZZTxt="#000";	//住客脏房0099FF
		$colZFTxt="#000";	//脏房
		$colWXTxt="#000";	//维修
		$colYDTxt="#000";	//预订
		$colALTxt="#000";	//所有	
		
		$colMF='#33FF00';	//免费房
		$colMFTxt='#000';	//免费房
		$colSF='#D7E8F3';	//锁房
		$colSFTxt='#000';	//锁房
		
		//获取数据库中设置的状态颜色**************************************//
		$strSelSubStateName='';
		$strSelSubStateColor='';
		$strSelSubTextColor='';
		$lngSelSubColor=0;
		
		$sql=sprintf("SELECT State_Name,State_Color,TextColor FROM TR_Room_State ");

		$result = querySql($sql);		
		while($row = fetch_array($result))
		{
			$strSelSubStateName= $row['State_Name'];
			//背景色
			$lngSelSubColor= $row['State_Color'];
			$hexadecimalNumber = dechex($lngSelSubColor);
			$strSelSubStateColor="#".substr($hexadecimalNumber, -6);
			//字体颜色
			$lngSelSubColor= $row['TextColor'];
			$hexadecimalNumber = dechex($lngSelSubColor);
			$strSelSubTextColor="#".substr($hexadecimalNumber, -6);
		
			switch($strSelSubStateName)
			{
				case '空房':
					$colKF=$strSelSubStateColor;	//空房
					$colKFTxt=$strSelSubTextColor;	//空房
					break;
				case '在住房':
					$colZK=$strSelSubStateColor;	//住客
					$colZZ=$strSelSubStateColor;	//住客脏房
					
					$colZKTxt=$strSelSubTextColor;	//住客
					$colZZTxt=$strSelSubTextColor;	//住客脏房
					break;
				case '钟点房':
					$colZD=$strSelSubStateColor;	//钟点
					$colZDTxt=$strSelSubTextColor;	//钟点
					break;
				case '退客房':
					$colZF=$strSelSubStateColor;	//脏房
					$colZFTxt=$strSelSubTextColor;	//脏房
					break;
				case '维修房':
					$colWX=$strSelSubStateColor;	//维修
					$colWXTxt=$strSelSubTextColor;	//维修
					break;
				case '预订房':
					$colYD=$strSelSubStateColor;	//预订
					$colYDTxt=$strSelSubTextColor;	//预订
					break;
				case '免费房':
					$colMF=$strSelSubStateColor;	//免费房
					$colMFTxt=$strSelSubTextColor;	//免费房
					break;
				case '锁房':
					$colSF=$strSelSubStateColor;	//锁房
					$colSFTxt=$strSelSubTextColor;	//锁房
					break;					
					
					
			}
		}
		freeResult($result);
		
		//$decimalNumber = -8040705;
		//$hexadecimalNumber = dechex($decimalNumber);
		//$colZK="#".substr($hexadecimalNumber, -6);
		//****************************************************************//
		
		
		
  		$rmCountKF=0;	//空房数
		$rmCountZK=0;	//住客
		$rmCountZD=0;	//钟点
		$rmCountZZ=0;	//住客脏房
		$rmCountZF=0;	//脏房
		$rmCountWX=0;	//维修
		$rmCountYD=0;	//预订
		$rmCountAL=0;	//所有
		
		$rmCountMF=0;	//免费
		$rmCountSF=0;	//锁房
		
		$rmRate=0;		//出租率
		$intStateID=0;
		$strtemp="";
		$inttemp=0;
		
		
		
	
		$chainno=$_SESSION["ChainNo"];

		//开始去房间状态数量
		//状态:0空房,1预订房,2在住房,3钟点房,4自用房,5退客房,6维修房,7锁房(9为住客脏房)
		$sql=sprintf("SELECT a.Room_State,COUNT(Room_No)AS RoomCount FROM TR_Room_Inform a,TR_Room_Type b 
				WHERE a.TypeListNo=b.ListNo AND b.Chain_No='%s' GROUP BY Room_State UNION 
				SELECT 9 AS Room_State,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' AND a.Room_State=2 AND a.Dirty_Flag=1",$chainno,$chainno);
				
		$result = querySql($sql);		
		while($row = fetch_array($result))
		{
			$intStateID= $row['Room_State'];
			$inttemp= $row['RoomCount'];
			switch($intStateID)
			{
				case 0:
					$rmCountKF=$rmCountKF + $inttemp;	//空房数
					break;
				case 5:
					$rmCountZF=$rmCountZF + $inttemp;	//脏房
					break;
				case 6:
					$rmCountWX=$rmCountWX + $inttemp;	//维修
					break;
				case 7:
					$rmCountSF=$rmCountSF + $inttemp;	//锁房
					break;
				case 1:
					$rmCountYD=$rmCountYD + $inttemp;	//预订
					break;
				case 2:
					$rmCountZK=$rmCountZK + $inttemp;	//住客
					break;
				case 3:
					$rmCountZD=$rmCountZD + $inttemp;	//钟点
					break;
				case 9:
					$rmCountZZ=$rmCountZZ + $inttemp;	//住客脏房
					$rmCountZK=$rmCountZK + $inttemp;	//住客
			}
			if($intStateID<>9)
				$rmCountAL=$rmCountAL + $inttemp;	//所有
		}
		$rmCountZK=$rmCountZK - $rmCountZZ;	//住客房中减去住客脏房
		//释放数据库
		freeResult($result);
		
		//得到免费房数
		$sql=sprintf("SELECT COUNT(a.ListNo)AS RoomCount FROM TR_Order_Inform b,TR_Order_Room_List a 
			WHERE a.Order_No=b.Order_No And b.Chain_No='%s' And b.Order_State<2 And a.Room_BillState=2 And a.Sited_FreeFlag>0",$chainno);
		$result = querySql($sql);		
		if($row = fetch_array($result))
		{
			$rmCountMF= $row['RoomCount'];
		}
		freeResult($result);
		closeDb();
		
		if($rmCountAL>0)
		{
			$rmRate=round(100*($rmCountZK + $rmCountZD + $rmCountZZ)/$rmCountAL,2);		//出租率
		}
		else
		{
			$rmRate=0;
		}
		
		
	 ?>
	 
	<header data-role="header" data-position="fixed" data-tap-toggle="false" style="border-top-width:0px;border-bottom-width:0px;">
		<table width="100%" height="35" border="0" cellpadding="0" cellspacing="0">
			<!--
			<tr>
				<td height="35" width="45" align="right">
					<a href="index.php" data-transition="flip" data-role="button" data-icon="carat-l" data-iconpos="notext" data-direction="reverse" rel="external"></a>
				</td>
				<td height="35" align="center"><?php echo $_SESSION['ChainName']?></td>
				<td height="35" width="45" align="left"><a href="#" data-role="button" data-icon="refresh" data-iconpos="notext" onclick="location.reload()"></td>
			</tr>
			
			style="border-top: none; border-left: none; border-right: none; border-bottom: 1px solid #F3EDED;"
			-->
			<tr bgcolor="#FFFFFF">
				<td height="35" colspan="3">
				
					<table width="100%" height="88" border="1" cellpadding="2" cellspacing="2" bordercolor="#FFFFFF" >
						<tr>
							<td width="20%" style="border-radius:5px;" bordercolor="#F3EDED" bgcolor="<?php echo $colKF;?>" <?php echo $selbkimg1;?>align="center" onClick="gbClick(1)" class="STYLEM2"><span style="color: <?php echo $colKFTxt;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">空房 <?php echo $rmCountKF; ?> </span></td>
							<td width="20%" style="border-radius:5px;" bordercolor="#F3EDED" bgcolor="<?php echo $colZK;?>" <?php echo $selbkimg2;?>align="center" onClick="gbClick(2)" class="STYLEM2"><span style="color: <?php echo $colZKTxt;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">住客 <?php echo $rmCountZK; ?> </span></td>
							<td width="20%" style="border-radius:5px;" bordercolor="#F3EDED" bgcolor="<?php echo $colZD;?>" <?php echo $selbkimg3;?>align="center" onClick="gbClick(3)" class="STYLEM2"><span style="color: <?php echo $colZDTxt;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">钟点 <?php echo $rmCountZD; ?> </span></td>
							<td width="20%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $colZZ;?>" <?php echo $selbkimg4;?>align="center" onClick="gbClick(4)" class="STYLEM2"><span style="color: <?php echo $colZZTxt;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">住脏 <?php echo $rmCountZZ; ?> </span></td>
							<td width="20%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $colWX;?>" <?php echo $selbkimg6;?>align="center" onClick="gbClick(6)" class="STYLEM2"><span style="color: <?php echo $colWXTxt;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">维修 <?php echo $rmCountWX; ?> </span></td>
						</tr>
						
						<tr>
							<td width="20%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $colZF;?>" <?php echo $selbkimg5;?>align="center" onClick="gbClick(5)" class="STYLEM2"><span style="color: <?php echo $colZFTxt;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">脏房 <?php echo $rmCountZF; ?> </span></td>
							<td width="20%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $colYD;?>" <?php echo $selbkimg7;?>align="center" onClick="gbClick(7)" class="STYLEM2"><span style="color: <?php echo $colYDTxt;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">预订 <?php echo $rmCountYD; ?> </span></td>
							<td width="20%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $colMF;?>" <?php echo $selbkimg9;?>align="center" onClick="gbClick(9)" class="STYLEM2"><span style="color: <?php echo $colMFTxt;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">免费 <?php echo $rmCountMF; ?> </span></td>
							<td width="20%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $colSF;?>" <?php echo $selbkimg0;?>align="center" onClick="gbClick(10)" class="STYLEM2"><span style="color: <?php echo $colSFTxt;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">锁房 <?php echo $rmCountSF; ?> </span></td>
							<td width="20%" style="border-radius:5px;" bordercolor="#CCCCCC" bgcolor="<?php echo $colAL;?>" <?php echo $selbkimg8;?>align="center" onClick="gbClick(8)" class="STYLEM2"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">全部 <?php echo $rmCountAL; ?> </span></td>
						</tr>
					</table>		
				</td>
			</tr>
			
			<tr bgcolor="#f0f0f0"><td height="1" colspan="3"></td></tr>
		</table>		
	</header>
	
	<article data-role="none" data-shadow="none">		 
		<table width="100%" height="2" border="0" cellpadding="0" cellspacing="0" >
			<tr>
				<td  height="2" bgcolor="#FFFFFF" valign="top" align="center"></td>
			</tr>
			<tr>
				<td valign="top" align="center">
					<table width="100%" height="20" border="1" bordercolor="#FFFFFF" cellspacing="0" cellpadding="0">
					<?php
						//显示一行的6个房号
						$roomno1="";
						$roomno2="";
						$roomno3="";
						$roomno4="";
						$roomno5="";
						
						$strRoomCode1='';
						$strRoomCode2='';
						$strRoomCode3='';
						$strRoomCode4='';
						$strRoomCode5='';
						
						$isdirtyflag1=0;
						$isdirtyflag2=0;
						$isdirtyflag3=0;
						$isdirtyflag4=0;
						$isdirtyflag5=0;
						
						$statetext1="";
						$statetext2="";
						$statetext3="";
						$statetext4="";
						$statetext5="";
						$statetemp="";
						
						$statename1="#FFFFFF";
						$statename2="#FFFFFF";
						$statename3="#FFFFFF";
						$statename4="#FFFFFF";
						$statename5="#FFFFFF";
						
						$statetxtcolor1='#000';
						$statetxtcolor2='#000';
						$statetxtcolor3='#000';
						$statetxtcolor4='#000';
						$statetxtcolor5='#000';
						
						$strroomurl="*";
						$strroomurl1="*";
						$strroomurl2="*";
						$strroomurl3="*";
						$strroomurl4="*";
						$strroomurl5="*";
												
						$strtemp="#FFFFFF";
						$strTextColor='#000';
						$intPos=0;

						
						function ClearNewRowText()
						{
							//归为玲一行
								$roomno1="";
								$roomno2="";
								$roomno3="";
								$roomno4="";
								$roomno5="";
								
								$strRoomCode1='';
								$strRoomCode2='';
								$strRoomCode3='';
								$strRoomCode4='';
								$strRoomCode5='';
								
								$statetemp1="";
								$statetemp2="";
								$statetemp3="";
								$statetemp4="";
								$statetemp5="";
																
								$statename1="#FFFFFF";
								$statename2="#FFFFFF";
								$statename3="#FFFFFF";
								$statename4="#FFFFFF";
								$statename5="#FFFFFF";
								
								$statetxtcolor1='#000';
								$statetxtcolor2='#000';
								$statetxtcolor3='#000';
								$statetxtcolor4='#000';
								$statetxtcolor5='#000';
								
								$strroomurl1="*";
								$strroomurl2="*";
								$strroomurl3="*";
								$strroomurl4="*";
								$strroomurl5="*";
								
								$intPos=0;
						}
						
						
						$chainno=$_SESSION["ChainNo"];
						
						$strFildText='';		//排序字段
						$strFildTextOld='';		//排序字段
						//开始取房间状态数量
						if($selroomstate=="")
						{
							$sql=sprintf("SELECT a.Room_No,a.Room_State,a.Dirty_Flag,b.Room_Code,a.Room_Floor FROM TR_Room_Inform a,TR_Room_Type b 
										WHERE a.TypeListNo=b.ListNo AND b.Chain_No='%s' ORDER BY a.Room_Floor ASC,a.Room_No ASC",$chainno);
						}
						else
						{
							//状态:0空房,1预订房,2在住房,3钟点房,4自用房,5退客房,6维修房,7锁房(9为住客脏房)
							$intselroomstate=20;
							switch($selroomstate)
							{
								case "空净房":
									$intselroomstate=0;	//空房数
									break;
								case "退客房":
									$intselroomstate=5;	//脏房
									break;
								case "维修房":
									$intselroomstate=6;	//维修
									break;
								case "预订房":
									$intselroomstate=1;	//预订
									break;
								case "在住房":
									$intselroomstate=2;	//住客
									break;
								case "钟点房":
									$intselroomstate=3;	//钟点				
									break;
								case "住客脏房":
									$intselroomstate=9;	//住客脏房
									break;
								case "免费房":
									$intselroomstate=11;	//免费房
									break;
								case "锁房":
									$intselroomstate=7;	//锁房
									break;
								default:
									$intselroomstate=20;
									break;
							}
							
							if($intselroomstate==20)
								$sql=sprintf("SELECT a.Room_No,a.Room_State,a.Dirty_Flag,b.Room_Code,a.Room_Floor FROM TR_Room_Inform a,TR_Room_Type b 
										WHERE a.TypeListNo=b.ListNo AND b.Chain_No='%s' ORDER BY a.Room_Floor ASC,a.Room_No ASC",$chainno);
							elseif($intselroomstate==9)
								$sql=sprintf("SELECT a.Room_No,a.Room_State,a.Dirty_Flag,b.Room_Code,a.Room_Floor FROM TR_Room_Inform a,TR_Room_Type b 
										WHERE a.TypeListNo=b.ListNo AND b.Chain_No='%s' AND a.Room_State=2 AND a.Dirty_Flag=1 ORDER BY a.Room_Floor ASC,a.Room_No ASC",$chainno);
							elseif($intselroomstate==11)
								$sql=sprintf("SELECT a.Room_No,a.Room_State,a.Dirty_Flag,b.Room_Code,a.Room_Floor FROM TR_Room_Inform a,TR_Room_Type b,
											(SELECT d.Room_No FROM TR_Order_Inform c,TR_Order_Room_List d WHERE d.Order_No=c.Order_No And c.Chain_No='%s' And c.Order_State<2 And d.Room_BillState=2 And d.Sited_FreeFlag>0) n
										WHERE a.TypeListNo=b.ListNo AND b.Chain_No='%s' AND a.Room_State=2 And a.Room_No=n.Room_No ORDER BY a.Room_Floor ASC,a.Room_No ASC",$chainno,$chainno);
							else
								$sql=sprintf("SELECT a.Room_No,a.Room_State,a.Dirty_Flag,b.Room_Code,a.Room_Floor FROM TR_Room_Inform a,TR_Room_Type b 
										WHERE a.TypeListNo=b.ListNo AND b.Chain_No='%s' AND a.Room_State=%d ORDER BY a.Room_Floor ASC,a.Room_No ASC",$chainno,$intselroomstate);
						}
						//状态:0空房,1预订房,2在住房,3钟点房,4自用房,5退客房,6维修房,7锁房(9为住客脏房)
						
						$result = querySql($sql);		
						while($row = fetch_array($result))
						{
							$inttemp1= $row['Room_State'];
							$strtemp2=$row['Room_No'];
							$strRoomCode=$row['Room_Code'];
							$strFildText=$row['Room_Floor'];
														
							$intDirty= $row['Dirty_Flag'];
							$strroomurl="*";
							//生成状态颜色
							switch($inttemp1)
							{
								case 0:
									$strtemp=$colKF;	//空房数
									$strTextColor=$colKFTxt;
									$statetemp="空净房";
									if($intDirty==1)
									{
										$strtemp=$colZF;	//脏房
										$strTextColor=$colZFTxt;
										$statetemp="退客房";
									}
									else
									{
										$strroomurl='*'.$strtemp2;
									}
									
									break;
								case 5:
									$strtemp=$colZF;	//脏房
									$strTextColor=$colZFTxt;
									$statetemp="退客房";
									break;
								case 6:
									$strtemp=$colWX;	//维修
									$strTextColor=$colWXTxt;
									$statetemp="维修房";
									break;
								case 1:
									$strtemp=$colYD;	//预订
									$strTextColor=$colYDTxt;
									$statetemp="预订房";
									break;
								case 2:
									if($intDirty==1)
									{
										$strtemp=$colZZ;	//住客脏房
										$strTextColor=$colZZTxt;
										$statetemp="住脏房";
									}
									else
									{
										$strtemp=$colZK;	//住客
										$strTextColor=$colZKTxt;
										$statetemp="住客房";
									}
									$strroomurl=$strtemp2;
									break;
								case 3:
									$strtemp=$colZD;	//钟点	
									$strTextColor=$colZDTxt;
									$statetemp="钟点房";
									$strroomurl=$strtemp2;
									break;
								default:
									$strtemp="#D7E8F3";
									$strTextColor='#000';
									if($inttemp1==5)
									{
										$statetemp="免费房";
										$strtemp=$colMF;
										$strTextColor=$colMFTxt;
										$strroomurl=$strtemp2;
									}
									if($inttemp1==7)
									{
										$statetemp="锁房";
										$strtemp=$colSF;
										$strTextColor=$colSFTxt;
										$strroomurl='#'.$strtemp2;
									}
									else
									{
										$statetemp="其他";
									}
									break;
							}
								
							$intPos=$intPos+1;
							
							
							
							
							
							if($intPos==5)
							{
								//满足一行显示了
								$roomno5=$strtemp2;
								$strRoomCode5=$strRoomCode;
								//生成状态颜色
								$statename5=$strtemp;
								$statetxtcolor5=$strTextColor;
								$statetext5=$statetemp;
								$strroomurl5=$strroomurl;
								
								$isdirtyflag5=$intDirty;
					?>
					<tr height="50" style="border-radius:5px;" >						
						<td height="58" width="17%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $statename1;?>" align="center" valign="top">
							
								<div onClick="bmtShowRoomClick('<?php echo $strroomurl1;?>')" style="width:100%;height:100%">						
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr><td width="100%" height="6"> 
											<?php	if($isdirtyflag1==1) {?>
												<div style="width:100%;height:6px;background:<?php echo $colZF;?>;border-radius:0px;border-top-right-radius:5px;border-top-left-radius:5px;"></div>
											<?php } else {?>
												<div style="width:100%;height:6px;"></div>
											<?php } ?> 
										</td></tr>
										<tr><td width="100%" align="center" valign="top">
											<div style="width:100%;height:14px;"><span style="color: <?php echo $statetxtcolor1;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $roomno1;?></span></div>
											<div style="width:100%;height:14px;"><span style="color: <?php echo $statetxtcolor1;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:9px;text-shadow:none;"><?php echo $strRoomCode1;?></span> </div>
											<div style="width:100%;height:10px;"><span style="color: <?php echo $statetxtcolor1;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;"><?php echo $statetext1;?></span> </div>
										</td></tr>
									</table>
								</div>
							
						</td>
						<td height="58" width="17%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $statename2;?>" align="center" valign="top">
							
								<div onClick="bmtShowRoomClick('<?php echo $strroomurl2;?>')" style="width:100%;height:100%">						
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr><td width="100%" height="6"> 
											<?php	if($isdirtyflag2==1) {?>
												<div style="width:100%;height:6px;background:<?php echo $colZF;?>;border-radius:0px;border-top-right-radius:5px;border-top-left-radius:5px;"></div>
											<?php } else {?>
												<div style="width:100%;height:6px;"></div>
											<?php } ?>
										</td></tr>
										<tr><td width="100%" align="center" valign="top">
											<div style="width:100%;height:15px;"><span style="color: <?php echo $statetxtcolor2;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $roomno2;?></span></div>
											<div style="width:100%;height:14px;"><span style="color: <?php echo $statetxtcolor2;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:9px;text-shadow:none;"><?php echo $strRoomCode2;?></span> </div>
											<div style="width:100%;height:10px;"><span style="color: <?php echo $statetxtcolor2;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;"><?php echo $statetext2;?></span> </div>
										</td></tr>
									</table>
								</div>
							
						</td>
						<td height="58" width="17%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $statename3;?>" align="center" valign="top">
							
								<div onClick="bmtShowRoomClick('<?php echo $strroomurl3;?>')" style="width:100%;height:100%">						
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr><td width="100%" height="6"> 
											<?php	if($isdirtyflag3==1) {?>
												<div style="width:100%;height:6px;background:<?php echo $colZF;?>;border-radius:0px;border-top-right-radius:5px;border-top-left-radius:5px;"></div>
											<?php } else {?>
												<div style="width:100%;height:6px;"></div>
											<?php } ?>
										</td></tr>
										<tr><td width="100%" align="center" valign="top">
											<div style="width:100%;height:15px;"><span style="color: <?php echo $statetxtcolor3;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $roomno3;?></span></div>
											<div style="width:100%;height:14px;"><span style="color: <?php echo $statetxtcolor3;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:9px;text-shadow:none;"><?php echo $strRoomCode3;?></span> </div>
											<div style="width:100%;height:10px;"><span style="color: <?php echo $statetxtcolor3;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;"><?php echo $statetext3;?></span> </div>
										</td></tr>
									</table>
								</div>
							
						</td>
						<td height="58" width="17%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $statename4;?>" align="center" valign="top">
							
								<div onClick="bmtShowRoomClick('<?php echo $strroomurl4;?>')" style="width:100%;height:100%">						
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr><td width="100%" height="6"> 
											<?php	if($isdirtyflag4==1) {?>
												<div style="width:100%;height:6px;background:<?php echo $colZF;?>;border-radius:0px;border-top-right-radius:5px;border-top-left-radius:5px;"></div>
											<?php } else {?>
												<div style="width:100%;height:6px;"></div>
											<?php } ?>
										</td></tr>
										<tr><td width="100%" align="center" valign="top">
											<div style="width:100%;height:15px;"><span style="color: <?php echo $statetxtcolor4;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $roomno4;?></span></div>
											<div style="width:100%;height:14px;"><span style="color: <?php echo $statetxtcolor4;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:9px;text-shadow:none;"><?php echo $strRoomCode4;?></span> </div>
											<div style="width:100%;height:10px;"><span style="color: <?php echo $statetxtcolor4;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;"><?php echo $statetext4;?></span> </div>
										</td></tr>
									</table>
								</div>
							
						</td>
						<td height="58" width="17%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $statename5;?>" align="center" valign="top">
							
								<div onClick="bmtShowRoomClick('<?php echo $strroomurl5;?>')" style="width:100%;height:100%">						
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr><td width="100%" height="6"> 
											<?php	if($isdirtyflag5==1) {?>
												<div style="width:100%;height:6px;background:<?php echo $colZF;?>;border-radius:0px;border-top-right-radius:5px;border-top-left-radius:5px;"></div>
											<?php } else {?>
												<div style="width:100%;height:6px;"></div>
											<?php } ?>
										</td></tr>
										<tr><td width="100%" align="center" valign="top">
											<div style="width:100%;height:15px;"><span style="color: <?php echo $statetxtcolor5;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $roomno5;?></span></div>
											<div style="width:100%;height:14px;"><span style="color: <?php echo $statetxtcolor5;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:9px;text-shadow:none;"><?php echo $strRoomCode5;?></span> </div>
											<div style="width:100%;height:10px;"><span style="color: <?php echo $statetxtcolor5;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;"><?php echo $statetext5;?></span> </div>
										</td></tr>
									</table>
								</div>
							
						</td>
					</tr>
					<?php
								//归为玲一行
								$roomno1="";
								$roomno2="";
								$roomno3="";
								$roomno4="";
								$roomno5="";
								
								$strRoomCode1='';
								$strRoomCode2='';
								$strRoomCode3='';
								$strRoomCode4='';
								$strRoomCode5='';
								
								$statetemp1="";
								$statetemp2="";
								$statetemp3="";
								$statetemp4="";
								$statetemp5="";
																
								$statename1="#FFFFFF";
								$statename2="#FFFFFF";
								$statename3="#FFFFFF";
								$statename4="#FFFFFF";
								$statename5="#FFFFFF";
								
								$statetxtcolor1='#000';
								$statetxtcolor2='#000';
								$statetxtcolor3='#000';
								$statetxtcolor4='#000';
								$statetxtcolor5='#000';
								
								$strroomurl1="*";
								$strroomurl2="*";
								$strroomurl3="*";
								$strroomurl4="*";
								$strroomurl5="*";
								
								$intPos=0;
							}
							else
							{
								switch($intPos)
								{
									case 1:
										$roomno1=$strtemp2;
										$statename1=$strtemp;
										$statetxtcolor1=$strTextColor;
										$statetext1=$statetemp;
										$isdirtyflag1=$intDirty;
										$strroomurl1=$strroomurl;
										$strRoomCode1=$strRoomCode;
										break;
									case 2:
										$roomno2=$strtemp2;
										$statename2=$strtemp;
										$statetxtcolor2=$strTextColor;
										$statetext2=$statetemp;
										$isdirtyflag2=$intDirty;
										$strroomurl2=$strroomurl;
										$strRoomCode2=$strRoomCode;
										break;
									case 3:
										$roomno3=$strtemp2;
										$statename3=$strtemp;
										$statetxtcolor3=$strTextColor;
										$statetext3=$statetemp;
										$isdirtyflag3=$intDirty;
										$strroomurl3=$strroomurl;
										$strRoomCode3=$strRoomCode;
										break;
									case 4:
										$roomno4=$strtemp2;
										$statename4=$strtemp;
										$statetxtcolor4=$strTextColor;
										$statetext4=$statetemp;
										$isdirtyflag4=$intDirty;
										$strroomurl4=$strroomurl;
										$strRoomCode4=$strRoomCode;
										break;
								}
								
							}
						}
						//最后一行显示进行判断
						//=============================================================================================================================
						if($intPos>0)
						{
					?>
					<tr>
						<td height="58" width="17%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $statename1;?>" align="center" valign="top">
							
								<div onClick="bmtShowRoomClick('<?php echo $strroomurl1;?>')" style="width:100%;height:100%">						
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr><td width="100%" height="6"> 
											<?php	if($isdirtyflag1==1) {?>
												<div style="width:100%;height:6px;background:<?php echo $colZF;?>;border-radius:0px;border-top-right-radius:5px;border-top-left-radius:5px;"></div>
											<?php } else {?>
												<div style="width:100%;height:6px;"></div>
											<?php } ?>
										</td></tr>
										<tr><td width="100%" align="center" valign="top">
											<div style="width:100%;height:15px;"><span style="color: <?php echo $statetxtcolor1;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $roomno1;?></span></div>
											<div style="width:100%;height:14px;"><span style="color: <?php echo $statetxtcolor1;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:9px;text-shadow:none;"><?php echo $strRoomCode1;?></span> </div>
											<div style="width:100%;height:10px;"><span style="color: <?php echo $statetxtcolor1;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;"><?php echo $statetext1;?></span> </div>
										</td></tr>
									</table>
								</div>
							
						</td>
					<?php
						}
						//=============================================================================================================================
						if($intPos>1)
						{
					?>
						<td height="58" width="17%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $statename2;?>" align="center" valign="top">
							
								<div onClick="bmtShowRoomClick('<?php echo $strroomurl2;?>')" style="width:100%;height:100%">						
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr><td width="100%" height="6"> 
											<?php	if($isdirtyflag2==1) {?>
												<div style="width:100%;height:6px;background:<?php echo $colZF;?>;border-radius:0px;border-top-right-radius:5px;border-top-left-radius:5px;"></div>
											<?php } else {?>
												<div style="width:100%;height:6px;"></div>
											<?php } ?>
										</td></tr>
										<tr><td width="100%" align="center" valign="top">
											<div style="width:100%;height:15px;"><span style="color: <?php echo $statetxtcolor2;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $roomno2;?></span></div>
											<div style="width:100%;height:14px;"><span style="color: <?php echo $statetxtcolor2;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:9px;text-shadow:none;"><?php echo $strRoomCode2;?></span> </div>
											<div style="width:100%;height:10px;"><span style="color: <?php echo $statetxtcolor2;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;"><?php echo $statetext2;?></span> </div>
										</td></tr>
									</table>
								</div>
							
						</td>
					<?php
						}
						else
						{
					?>
						<td height="30" width="17%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="#FFFFFF" align="center" valign="top"> </td>
					<?php
						}
						//=============================================================================================================================
						if($intPos>2)
						{
					?>
						<td height="58" width="17%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $statename3;?>" align="center" valign="top">
							
								<div onClick="bmtShowRoomClick('<?php echo $strroomurl3;?>')" style="width:100%;height:100%">						
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr><td width="100%" height="6"> 
											<?php	if($isdirtyflag3==1) {?>
												<div style="width:100%;height:6px;background:<?php echo $colZF;?>;border-radius:0px;border-top-right-radius:5px;border-top-left-radius:5px;"></div>
											<?php } else {?>
												<div style="width:100%;height:6px;"></div>
											<?php } ?>
										</td></tr>
										<tr><td width="100%" align="center" valign="top">
											<div style="width:100%;height:15px;"><span style="color: <?php echo $statetxtcolor3;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $roomno3;?></span></div>
											<div style="width:100%;height:14px;"><span style="color: <?php echo $statetxtcolor3;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:9px;text-shadow:none;"><?php echo $strRoomCode3;?></span> </div>
											<div style="width:100%;height:10px;"><span style="color: <?php echo $statetxtcolor3;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;"><?php echo $statetext3;?></span> </div>
										</td></tr>
									</table>
								</div>
							
						</td>
					<?php
						}
						else
						{
					?>
						<td height="30" width="17%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="#FFFFFF" align="center" valign="top"> </td>
					<?php
						}
						//=============================================================================================================================
						if($intPos>3)
						{
					?>
						<td height="58" width="17%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $statename4;?>" align="center" valign="top">
							
								<div onClick="bmtShowRoomClick('<?php echo $strroomurl4;?>')" style="width:100%;height:100%">						
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr><td width="100%" height="6"> 
											<?php	if($isdirtyflag4==1) {?>
												<div style="width:100%;height:6px;background:<?php echo $colZF;?>;border-radius:0px;border-top-right-radius:5px;border-top-left-radius:5px;"></div>
											<?php } else {?>
												<div style="width:100%;height:6px;"></div>
											<?php } ?>
										</td></tr>
										<tr><td width="100%" align="center" valign="top">
											<div style="width:100%;height:15px;"><span style="color: <?php echo $statetxtcolor4;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $roomno4;?></span></div>
											<div style="width:100%;height:14px;"><span style="color: <?php echo $statetxtcolor4;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:9px;text-shadow:none;"><?php echo $strRoomCode4;?></span> </div>
											<div style="width:100%;height:10px;"><span style="color: <?php echo $statetxtcolor4;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;"><?php echo $statetext4;?></span> </div>
										</td></tr>
									</table>
								</div>
							
						</td>
					<?php
						}
						else
						{
					?>
						<td height="30" width="17%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="#FFFFFF" align="center" valign="top"> </td>
					<?php
						}
						//=============================================================================================================================
						if($intPos>4)
						{
					?>
						<td height="58" width="17%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="<?php echo $statename5;?>" align="center" valign="top">
							
								<div onClick="bmtShowRoomClick('<?php echo $strroomurl5;?>')" style="width:100%;height:100%">						
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr><td width="100%" height="6"> 
											<?php	if($isdirtyflag5==1) {?>
												<div style="width:100%;height:6px;background:<?php echo $colZF;?>;border-radius:0px;border-top-right-radius:5px;border-top-left-radius:5px;"></div>
											<?php } else {?>
												<div style="width:100%;height:6px;"></div>
											<?php } ?>
										</td></tr>
										<tr><td width="100%" align="center" valign="top">
											<div style="width:100%;height:15px;"><span style="color: <?php echo $statetxtcolor5;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $roomno5;?></span></div>
											<div style="width:100%;height:14px;"><span style="color: <?php echo $statetxtcolor5;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:9px;text-shadow:none;"><?php echo $strRoomCode5;?></span> </div>
											<div style="width:100%;height:10px;"><span style="color: <?php echo $statetxtcolor5;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;"><?php echo $statetext5;?></span> </div>
										</td></tr>
									</table>
								</div>
							
						</td>
					<?php
						}
						else
						{
					?>
						<td height="30" width="17%" style="border-radius:5px;" bordercolor="#FFFFFF" bgcolor="#FFFFFF" align="center" valign="top"> </td>
					<?php
						}
						//=============================================================================================================================
						if($intPos>0)
						{
					?>
					<tr>
					<?php
						}
						//=============================================================================================================================
						//释放数据库
						freeResult($result);
						closeDb();
					?>
				</table>    
			</td>
		  </tr>
		</table>
		
		
		
		<!-- 模态框 -->
		<div data-role="popup" id="roomModalDoForm" 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="180" height="154" border="0" cellpadding="0" cellspacing="0" bgcolor="#fff">
				<tr><td height ="5" colspan="3" align="center"></td></tr>
				<tr><td height ="35" colspan="3" align="center">
					<span style="color:#000 ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:18px;text-shadow:none;">房号：</span>
					<span id="roomModal_RoomID" style="color:#000 ;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 ="50" width="20"></td>
					<td height ="50" valign="top">
						<?php if($blnCanCheckInFlag>0) {?>
						<div id="roomModal_QXFF" onclick="SubClick_NewCheckIn()" style="width:140px;height:35px;border-radius:4px;top:0px;left:0px;background-image:linear-gradient(45deg, #5762f7 70%, #24d7ff 100%),linear-gradient(225deg, #5762f7 70%, #24d7ff 100%);background-blend-mode: screen;">
							<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td 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>
						<?php } else { ?>	
						<div id="roomModal_QXFF" style="width:140px;height:35px;border-radius:4px;top:0px;left:0px;background-image:linear-gradient(45deg, #c9c9c9 70%, #b2bbbe 100%),linear-gradient(225deg, #c9c9c9 70%, #b2bbbe 100%);background-blend-mode: screen;">
							<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td height="100%" align="center">
										<span style="color:#8e8e8e ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-shadow:none;">入住登记</span> 
									</td>
								</tr>
							</table>
						</div>
						<?php } ?>
					</td>
					<td height ="50" width="4"></td>
				</tr>
				<!--
				<tr>
					<td height ="50" width="20"></td>
					<td height ="50" valign="top">
						<div id="roomModal_QXFF"  style="width:140px;height:35px;border-radius:4px;top:0px;left:0px;background-color:#fadae4;">
							<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td 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 ="50" width="4"></td>
				</tr>
				-->
				<tr>
					<td height ="35" width="20"></td>
					<td height ="35" valign="top">		<!--background-color:#D7AA28;-->
						<?php if($blnCanCheckInFlag>0) {?>
						<div id="roomModal_QXFF" onclick="SubClick_NewLockRoom()" style="width:140px;height:35px;border-radius:4px;top:0px;left:0px;background-image:linear-gradient(45deg, #5762f7 70%, #24d7ff 100%),linear-gradient(225deg, #5762f7 70%, #24d7ff 100%);background-blend-mode: screen;">
							<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td 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>
						<?php } else { ?>	
						<div id="roomModal_QXFF"style="width:140px;height:35px;border-radius:4px;top:0px;left:0px;background-image:linear-gradient(45deg, #c9c9c9 70%, #b2bbbe 100%),linear-gradient(225deg, #c9c9c9 70%, #b2bbbe 100%);background-blend-mode: screen;">
							<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td height="100%" align="center">
										<span style="color:#8e8e8e ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-shadow:none;">临时锁房</span> 
									</td>
								</tr>
							</table>
						</div>
						<?php } ?>
					</td>
					<td height ="35" width="4"></td>
				</tr>
				
				<tr><td height ="20" colspan="3" align="center"></td></tr>
								
			</table>
		</div>
		<!--结束   启动选择班级的窗体 结束-->
			
		
	</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="#pageroomview2" 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="#" 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-bullets ui-btn-icon-top" target="_parent" href="reproomviewtj.php" 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-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 openRoomModal(room) 
			{
				//lngNowRoomListNo=lngRoomLD;
				
				//设置房号
				
				var span1 = document.getElementById('roomModal_RoomID');
				span1.textContent = room;
				/*
				var span2 = document.getElementById('roomModal_RoomType');
				var span3 = document.getElementById('roomModal_RoomState');
				
				span2.textContent = '房型：' + roomtype;
				span3.textContent = '状态：' + roomstate;
				*/
				$('#roomModalDoForm').popup('open');

			}

			// 关闭模态框
			function closeRoomModal() 
			{
				$('#roomModalDoForm').popup('close');
			}
			
			//1.入住登记
			function SubClick_NewCheckIn()
			{
				var span1 = document.getElementById('roomModal_RoomID');
				var strRoomNo=span1.textContent;
				window.location.href='rmroomcheckin.php?romid=' + strRoomNo;
			}
			
			//2.预订登记
			function SubClick_NewBook()
			{
				var span1 = document.getElementById('roomModal_RoomID');
				var strRoomNo=span1.textContent;
				alert(strRoomNo);
			}
			
			//3.临时锁房
			function SubClick_NewLockRoom()
			{
				var span1 = document.getElementById('roomModal_RoomID');
				var strRoomNo=span1.textContent;
				window.location.href='rmroomlock.php?romid=' + strRoomNo;
			}
			
			
			//相应提交按钮事件处理部分
			function bmtShowRoomClick(selroomno)
			{
				//得到当前选择的房间信息
				var selroomid=selroomno;
				var strTypeID=selroomid.substr(0,1);
				if(selroomid=="*")
				{
					return;
				}
				//开始启动客房信息的界面
				if(strTypeID=="*")
				{
					selroomid=selroomid.substr(1);
					//如果是空房
					openRoomModal(selroomid);
				}
				else if(strTypeID=="#")
				{
					//锁房
					selroomid=selroomid.substr(1);
					var urlroom1='rmroomlock.php?romid=' + selroomid + '&blnckin=<?php echo $blnCanCheckInFlag;?>';
					window.location.href=urlroom1;
				}
				else
				{
					//如果是在住房
					//var urlroom='roomorder.php?rmid=' + selroomid;
					var urlroom='rmroomcheckinedit.php?romid=' + selroomid;
					window.location.href=urlroom;
				}
								
			}
	</script>
</section>

<section data-role="page" id="pageroomview2" style="background-color:#fff">
	<article data-role="none">
		<table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" >
			<tr>
				<td height="30" width="4"></td>
				<td height="30">
					<table width="100%" height="28" border="0" cellpadding="0" cellspacing="0" >
					<?php			
						function GetWeekDay($weekday)
						{
							$strRet="";
							switch($weekday)
							{
								case 1:
									$strRet="周日";
									break;
								case 2:
									$strRet="周一";
									break;
								case 3:
									$strRet="周二";
									break;
								case 4:
									$strRet="周三";
									break;
								case 5:
									$strRet="周四";
									break;
								case 6:
									$strRet="周五";
									break;
								case 7:
									$strRet="周六";
									break;
							}
							return $strRet;
						}
						
						$chainno=$_SESSION["ChainNo"];
						$OrderList=0;
						
						$intFixCountSum=0;
						$intRCountSum1=0;
						$intRCountSum2=0;
						$intRCountSum3=0;
						$intRCountSum4=0;
						$intRCountSum5=0;
						$intRCountSum6=0;
						
						//1.得到查询日期和周期
						//$sql=sprintf("SELECT CONVERT(varchar(10),DATEADD(DAY,1,GETDATE()),120)AS SDay1,CONVERT(varchar(10),DATEADD(DAY,2,GETDATE()),120)AS SDay2,
						$sql=sprintf("SELECT CONVERT(varchar(10),GETDATE(),120)AS SDay1,CONVERT(varchar(10),DATEADD(DAY,1,GETDATE()),120)AS SDay2,
									CONVERT(varchar(10),DATEADD(DAY,2,GETDATE()),120)AS SDay3,CONVERT(varchar(10),DATEADD(DAY,3,GETDATE()),120)AS SDay4,
									CONVERT(varchar(10),DATEADD(DAY,4,GETDATE()),120)AS SDay5,CONVERT(varchar(10),DATEADD(DAY,5,GETDATE()),120)AS SDay6,
									CONVERT(varchar(10),DATEADD(DAY,6,GETDATE()),120)AS SDay7,
									DATEPART(WEEKDAY,GETDATE())AS WDay1,DATEPART(WEEKDAY,DATEADD(DAY,1,GETDATE()))AS WDay2,
									DATEPART(WEEKDAY,DATEADD(DAY,2,GETDATE()))AS WDay3,DATEPART(WEEKDAY,DATEADD(DAY,3,GETDATE()))AS WDay4,
									DATEPART(WEEKDAY,DATEADD(DAY,4,GETDATE()))AS WDay5,DATEPART(WEEKDAY,DATEADD(DAY,5,GETDATE()))AS WDay6");
						$result = querySql($sql);
						$row = fetch_array($result);
						$strDay1=$row['SDay1'];
						$strDay2=$row['SDay2'];
						$strDay3=$row['SDay3'];
						$strDay4=$row['SDay4'];
						$strDay5=$row['SDay5'];
						$strDay6=$row['SDay6'];
						$strDay7=$row['SDay7'];
						
						$intTemp=$row['WDay1'];
						$strWeek1=GetWeekDay($intTemp);
						$intTemp=$row['WDay2'];
						$strWeek2=GetWeekDay($intTemp);
						$intTemp=$row['WDay3'];
						$strWeek3=GetWeekDay($intTemp);
						$intTemp=$row['WDay4'];
						$strWeek4=GetWeekDay($intTemp);
						$intTemp=$row['WDay5'];
						$strWeek5=GetWeekDay($intTemp);
						$intTemp=$row['WDay6'];
						$strWeek6=GetWeekDay($intTemp);
						
						freeResult($result);
						//closeDb();
						
						$strRoomType="";
						$fltRoomPrice=0;
						$intFixCount=0;
						$intRCount1=0;
						$intRCount2=0;
						$intRCount3=0;
						$intRCount4=0;
						$intRCount5=0;
						$intRCount6=0;
						//开始去房间状态数量
						$sql=sprintf("SELECT Room_Type,SUM(RoomPrice)AS RoomPrice,SUM(FixCount)AS FixCount,SUM(RCount1)AS RCount1,SUM(RCount2)AS RCount2,SUM(RCount3)AS RCount3,
									SUM(RCount4)AS RCount4,SUM(RCount5)AS RCount5,SUM(RCount6)AS RCount6 FROM(
							SELECT b.Room_Type,b.Room_PriceS AS RoomPrice,Count(a.ListNo)AS FixCount,0 AS RCount1,0 AS RCount2,0 AS RCount3,0 AS RCount4,0 AS RCount5,0 AS RCount6 FROM TR_Room_Inform a,TR_Room_Type b 
							WHERE a.TypeListNo=b.ListNo AND b.Chain_No='%s' GROUP BY b.Room_Type,b.Room_PriceS
							UNION SELECT Room_Type,0 AS RoomPrice,0 AS FixCount,RoomCount AS RCount1,0 AS RCount2,0 AS RCount3,0 AS RCount4,0 AS RCount5,0 AS RCount6 FROM dbo.TRF_RoomTypeFreeCount('%s','%s','%s')
							UNION SELECT Room_Type,0 AS RoomPrice,0 AS FixCount,0 AS RCount1,RoomCount AS RCount2,0 AS RCount3,0 AS RCount4,0 AS RCount5,0 AS RCount6 FROM dbo.TRF_RoomTypeFreeCount('%s','%s','%s')
							UNION SELECT Room_Type,0 AS RoomPrice,0 AS FixCount,0 AS RCount1,0 AS RCount2,RoomCount AS RCount3,0 AS RCount4,0 AS RCount5,0 AS RCount6 FROM dbo.TRF_RoomTypeFreeCount('%s','%s','%s')
							UNION SELECT Room_Type,0 AS RoomPrice,0 AS FixCount,0 AS RCount1,0 AS RCount2,0 AS RCount3,RoomCount AS RCount4,0 AS RCount5,0 AS RCount6 FROM dbo.TRF_RoomTypeFreeCount('%s','%s','%s')
							UNION SELECT Room_Type,0 AS RoomPrice,0 AS FixCount,0 AS RCount1,0 AS RCount2,0 AS RCount3,0 AS RCount4,RoomCount AS RCount5,0 AS RCount6 FROM dbo.TRF_RoomTypeFreeCount('%s','%s','%s')
							UNION SELECT Room_Type,0 AS RoomPrice,0 AS FixCount,0 AS RCount1,0 AS RCount2,0 AS RCount3,0 AS RCount4,0 AS RCount5,RoomCount AS RCount6 FROM dbo.TRF_RoomTypeFreeCount('%s','%s','%s')
							)t GROUP BY Room_Type ORDER BY Room_Type ASC",$chainno,$chainno,$strDay1,$strDay2,$chainno,$strDay2,$strDay3,$chainno,$strDay3,$strDay4,$chainno,$strDay4,$strDay5,$chainno,$strDay5,$strDay6,$chainno,$strDay6,$strDay7);
					
						$result = querySql($sql);		
						while($row = fetch_array($result))
						{
							//得到每一条的记录信息	
							$OrderList=$OrderList+1;
							
							$strRoomType=$row['Room_Type'];
							$fltRoomPrice=$row['RoomPrice'];
							$intFixCount=$row['FixCount'];
							$intRCount1=$row['RCount1'];
							$intRCount2=$row['RCount2'];
							$intRCount3=$row['RCount3'];
							$intRCount4=$row['RCount4'];
							$intRCount5=$row['RCount5'];
							$intRCount6=$row['RCount6'];
							
							$intFixCountSum=$intFixCountSum + $intFixCount;
							
							$intRCountSum1=$intRCountSum1+$intRCount1;
							$intRCountSum2=$intRCountSum2+$intRCount2;
							$intRCountSum3=$intRCountSum3+$intRCount3;
							$intRCountSum4=$intRCountSum4+$intRCount4;
							$intRCountSum5=$intRCountSum5+$intRCount5;
							$intRCountSum6=$intRCountSum6+$intRCount6;
							//以下开始显示数据							
					?>
					
							
							<tr>
								<td width="100%" height="20" align="center">
									<div style="border:1px solid #F0F0F0; background:#fff;width:98%;height:102px;border-radius:6px;">
										<table width="100%" height="28" border="0" cellpadding="0" cellspacing="0">
											<tr bgcolor="#f8f9fa">
												<td width="4" height="30" align="left"></td>
												<td align="left">
													<span id="MsgTxt" style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">&nbsp;<?php echo $OrderList;?>. <?php echo $strRoomType;?></span>
												</td>
												<td width="90" align="left">
													<span id="MsgTxt" style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">房数: <?php echo $intFixCount;?></span>
												</td>
												<td width="90" align="left">
													<span id="MsgTxt" style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">房价: <?php echo $fltRoomPrice;?></span>
												</td>
												<td width="4" align="left"></td>
											</tr>
											
											<tr bgcolor="#fff6f6">
												<td height="1" width="4" align="left"></td>
												<td height="1" colspan="3" align="left" bgcolor="#f2efef"></td>
												<td height="1" width="4" align="left"></td>
											</tr>
											
											
											<tr bgcolor="#f8f9fa">
												<td height="1" width="4" align="left"></td>
												<td height="1" colspan="3" align="left">
													<div style="border:0px solid #fff;width:100%;height:15px;">
														<table width="100%" height="15" border="0" cellpadding="0" cellspacing="0" >
															<tr>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;">&nbsp;<?php echo substr($strDay1,5,5);?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo substr($strDay2,5,5);?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo substr($strDay3,5,5);?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo substr($strDay4,5,5);?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo substr($strDay5,5,5);?></span></td>
																<td height="16" width="20%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo substr($strDay6,5,5);?></span></td>
															</tr>
															
														</table>
													</div>
												</td>
												<td height="1" width="4" align="left"></td>
											</tr>

											<tr bgcolor="#f8f9fa">
												<td height="1" width="4" align="left"></td>
												<td height="1" colspan="3" align="left">
													<div style="border:0px solid #fff;width:100%;height:15px;">
														<table width="100%" height="15" border="0" cellpadding="0" cellspacing="0" >
															<tr>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;">&nbsp;<?php echo $strWeek1;?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo $strWeek2;?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo $strWeek3;?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo $strWeek4;?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo $strWeek5;?></span></td>
																<td height="16" width="20%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo $strWeek6;?></span></td>
															</tr>
								
														</table>
													</div>
												</td>
												<td height="1" width="4" align="left"></td>
											</tr>

											
											<tr bgcolor="#f8f9fa" ><td height="6" colspan="5" align="left"></td></tr>
											
											<tr ><td height="6" colspan="5" align="left"></td></tr>
											<tr>
												<td height="1" width="4" align="left"></td>
												<td height="1" colspan="3" align="left">
													<table width="100%" height="26" border="0" cellpadding="0" cellspacing="0" >
														<tr>
															<td width="16.5%" align="center">&nbsp;<?php echo $intRCount1;?></td>
															<td width="16.5%" align="center"><?php echo $intRCount2;?></td>
															<td width="16.5%" align="center"><?php echo $intRCount3;?></td>
															<td width="16.5%" align="center"><?php echo $intRCount4;?></td>
															<td width="16.5%" align="center"><?php echo $intRCount5;?></td>
															<td width="17.5%" align="center"><?php echo $intRCount6;?></td>
														</tr>
													</table>
												</td>
												<td height="1" width="4" align="left"></td>
											</tr>
										</table>
										
									</div>
								</td>
							</tr>
							
							
							<tr><td height="8" align="left"></td></tr>
							
					<?php
						}
						//释放数据库
						freeResult($result);
						closeDb();
					?>
							<tr><td height="2" align="left"></td></tr>
							
							
							<tr>
								<td width="100%" height="20" align="center">
									<div style="border:1px solid #F0F0F0; background:#fff;width:98%;height:102px;border-radius:6px;">
										<table width="100%" height="28" border="0" cellpadding="0" cellspacing="0">
											<tr bgcolor="#f8f9fa">
												<td width="4" height="30" align="left"></td>
												<td align="left">
													<span id="MsgTxt" style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">&nbsp;&nbsp;合计</span>
												</td>
												<td width="90" align="left">
													<span id="MsgTxt" style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">房数: <?php echo $intFixCountSum;?></span>
												</td>
												<td width="90" align="left">
													
												</td>
												<td width="4" align="left"></td>
											</tr>
											<tr >
												<td height="1" width="4" align="left"></td>
												<td height="1" colspan="3" align="left" bgcolor="#f2efef"></td>
												<td height="1" width="4" align="left"></td>
											</tr>
											
											
											<tr bgcolor="#f8f9fa">
												<td height="1" width="4" align="left"></td>
												<td height="1" colspan="3" align="left">
													<div style="border:0px solid #fff;width:100%;height:15px;">
														<table width="100%" height="15" border="0" cellpadding="0" cellspacing="0" >
															<tr>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;">&nbsp;<?php echo substr($strDay1,5,5);?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo substr($strDay2,5,5);?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo substr($strDay3,5,5);?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo substr($strDay4,5,5);?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo substr($strDay5,5,5);?></span></td>
																<td height="16" width="20%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo substr($strDay6,5,5);?></span></td>
															</tr>
															
														</table>
													</div>
												</td>
												<td height="1" width="4" align="left"></td>
											</tr>

											<tr bgcolor="#f8f9fa">
												<td height="1" width="4" align="left"></td>
												<td height="1" colspan="3" align="left">
													<div style="border:0px solid #fff;width:100%;height:15px;">
														<table width="100%" height="15" border="0" cellpadding="0" cellspacing="0" >
															<tr>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;">&nbsp;<?php echo $strWeek1;?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo $strWeek2;?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo $strWeek3;?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo $strWeek4;?></span></td>
																<td height="16" width="16.5%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo $strWeek5;?></span></td>
																<td height="16" width="20%" align="center"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo $strWeek6;?></span></td>
															</tr>
															
														</table>
													</div>
												</td>
												<td height="1" width="4" align="left"></td>
											</tr>

											<tr bgcolor="#f8f9fa" ><td height="6" colspan="5" align="left"></td></tr>
											
											<tr ><td height="6" colspan="5" align="left"></td></tr>
											<tr>
												<td height="1" width="4" align="left"></td>
												<td height="1" colspan="3" align="left">
													<table width="100%" height="20" border="0" cellpadding="0" cellspacing="0" >
														<tr>
															<td width="16.5%" align="center">&nbsp;<?php echo $intRCountSum1;?></td>
															<td width="16.5%" align="center"><?php echo $intRCountSum2;?></td>
															<td width="16.5%" align="center"><?php echo $intRCountSum3;?></td>
															<td width="16.5%" align="center"><?php echo $intRCountSum4;?></td>
															<td width="16.5%" align="center"><?php echo $intRCountSum5;?></td>
															<td width="17.5%" align="center"><?php echo $intRCountSum6;?></td>
														</tr>
													</table>
												</td>
												<td height="1" width="4" align="left"></td>
											</tr>
										</table>
										
										
										
										
									</div>
								</td>
							</tr>
							
							
							
							
							
							
							<tr><td height="30" align="left"></td></tr>
							
							
							
					
						</table>
					
				</td>
				<td height="30" width="4"></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="#" 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-grid ui-btn-icon-top" target="_parent" href="#pageroomview1" 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="reproomviewtj.php" 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-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>
	
	
	
</section>
</body>
</htlm>


