<?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;
	}
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="gb2312">	
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
	<meta name="apple-mobile-web-app-capable" content="1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=0">
	<meta name="apple-touch-fullscreen" content="1">
	
	<Meta http-equiv="Page-Enter" Content="blendTrans(Duration=0.5)"> 
	<Meta http-equiv="Page-Exit" Content="blendTrans(Duration=0.5)">
	
	<title>客房云点通</title>
	
	<link rel="stylesheet" href="jsp4/jquery.mobile-1.4.3.min.css">
	<script src="jsp4/jquery.js"></script>
	<script src="jsp4/jquery.mobile-1.4.3.min.js"></script>
</head>

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

		if (typeof WeixinJSBridge == "undefined")
		{
			if( document.addEventListener )
			{
				document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
			}
			else if (document.attachEvent)
			{
				document.attachEvent('WeixinJSBridgeReady', onBridgeReady); 
				document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
			}
		}
		else
		{
			onBridgeReady();
		}
	</script>
	
<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">
<section data-role="page" id="pageA0">		
	<link rel="stylesheet" href="css/mycss.css"> 
	
	<header data-role="header" data-position="fixed" data-tap-toggle="false">
		<table width="100%" height="35" border="0" cellpadding="0" cellspacing="0">
		   <tr>
			<td height="35" width="45" align="right">
				<a href="index.php" data-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>
		</table>
	</header>
	
	<article data-role="none">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FAFAFA" >
			<tr>
				<td height="4" width="8"></td>
				<td height="4" align="left"></td>
				<td height="4" width="8"></td>
			</tr>
			
			<?php				
				$chainno=$_SESSION["ChainNo"];
				
				$intRowIndex =0;
				//开始去房间状态数量 Strike_Value,Money_Strike
				$sql=sprintf("SELECT ListNo,convert(varchar(19),TradeTime,120)AS TradeTime,TradeMan,ItemID,ItemText FROM TR_CheckItem_List WHERE TradeTime>=DateAdd(hour,-1,GetDate()) And Chain_No='%s' And ItemState=0 Order By ListNo DESC",$chainno);
														
				$result = querySql($sql);		
				while($row = fetch_array($result))
				{
					//得到每一条的记录信息
					$strlistno=$row['ListNo'];
					$username=$row['TradeMan'];
					$tradetime=$row['TradeTime'];
					
					$intItemID=$row['ItemID'];
					$remarks=$row['ItemText'];
					$strItemName="审核项目";

					switch($intItemID)
					{
						case 1:
							$strItemName="删除过期账";
							break;
						case 2:
							$strItemName="删除临时帐";
							break;
						case 3:
							$strItemName="冲账";
							break;
						case 4:
							$strItemName="结账返单当天";
							break;
						case 5:
							$strItemName="结账返单过期";
							break;
						case 6:
							$strItemName="更改房价当天";
							break;
						case 7:
							$strItemName="更改房价隔天";
							break;
						case 8:
							$strItemName="免费房";
							break;
						case 9:
							$strItemName="日租转钟点";
							break;
						case 10:
							$strItemName="钟点转日租";
							break;
					}	
					$intRowIndex = $intRowIndex + 1;
			?>
			<tr>
				<td width="10"></td>
				<td align="left">
					<div style="width:100%;height:<?php echo $intSuitHeight;?>px;border-radius:4px;border-top:1px solid #F2E2E2;border-bottom:1px solid #F2E2E2;border-left:1px solid #F2E2E2;border-right:1px solid #F2E2E2;">
						<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
							<tr><td height="2"  colspan="4" bgcolor="#F1EAEA"></td></tr>
										
                             <tr>
								<td height="25" width="15" bgcolor="#F1EAEA"></td>
								<td height="25" align="center" valign="middle" colspan="2" bgcolor="#F1EAEA">
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td width="100" align="left" valign="middle">
												<span style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-weight:bold; font-size:14px;text-shadow:none;"><?php echo $intRowIndex.'. '.$strItemName;?></span>
											</td>
											<td align="right" valign="middle">
												<span style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo $tradetime;?></span>
											</td>
										</tr>
									</table>
								</td>
									
								<td height="25" width="15" bgcolor="#F1EAEA"></td>
							</tr>

							<tr><td height="2"  colspan="4" bgcolor="#F1EAEA"></td></tr>
							<tr><td height="1" align="left" bgcolor="#F2E2E2" colspan="4"></td></tr>
                                                       
							<tr><td height="5"  colspan="4"></td></tr>
                                                                   
							<tr>
								<td height="10" width="15"></td>
								<td height="10" align="left" valign="middle" colspan="2">
									<span style="color: #666666;font: 10px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;">申请人：<?php echo $username;?></span>
								</td>
								<td height="10" width="15"></td>
							</tr>
                            <tr>
								<td height="10" width="15"></td>
								<td height="10" align="left" valign="middle" colspan="2">
									<span style="color: #666666;font: 10px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;"><?php echo $remarks;?></span>
								</td>
								<td height="10" width="15"></td>
							</tr>
							
							<tr><td height="5"  colspan="4"></td></tr>							
							
							<tr>
								<td height="1" width="15"></td>
								<td height="1" bgcolor="#F2E2E2" colspan="2"></td>
								<td height="1" width="15"></td>
							</tr>
							
							<tr><td height="5"  colspan="4"></td></tr>							
							
							<tr>
								<td height="35" width="15"></td>
								<td height="35" colspan="2">
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td height="100%" width="42%" bgcolor="#ffffff">
												<div onClick="window.location = 'checkdo.php?bitemid=<?php echo $strlistno; ?>&doid=1';" style="width:100%; height:35px; border-radius:6px; background-color:#D7AA28;">
														<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
															<tr><td width="100%" height="100%" align="center">
																<span style="color:#fff ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;text-shadow:none;">通 过</span>                            	
															</td></tr>
														</table>
													</div>											
											</td>
											<td height="100%"  width="16%"></td>
											<td height="100%"  width="42%">
													<div onClick="window.location = 'checkdo.php?bitemid=<?php echo $strlistno; ?>&doid=2';" style="width:100%; height:35px; border-radius:6px; background-color:#CD0013;">
														<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
															<tr><td width="100%" height="100%" align="center">
																<span style="color:#fff ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;text-shadow:none;">不通过</span>                            	
															</td></tr>
														</table>
													</div>
											</td>
										</tr>
									</table>
								</td>
								<td height="35" width="15"></td>
							</tr>
							
							<tr><td height="8"  colspan="4"></td></tr>	
							
						</table>
					</div>
				</td>
				<td width="10"></td>
			</tr>
			
			<tr>
				<td height="10" width="8"></td>
				<td height="10" align="left"></td>
				<td height="10" width="8"></td>
			</tr>
			<?php 
				}
				//释放数据库
				freeResult($result);
				closeDb();
			?>
			
		</table>
		
	</article>
	
	<footer data-role="footer" data-position="fixed" data-tap-toggle="false">
		<div style="width:100%;height:57px;background-color:#DDDDDD;">
			<nav data-role="navbar" data-type="horizontal">
				<ul>
					<li><a data-icon="eye" style="color:#666666;background-color:#F3F4EC;" href="#">审核项目</a></li>
					<li><a data-icon="edit" href="#pageA1">冲账记录</a></li>
					<li><a data-icon="delete" href="#pageA2">删账记录</a></li>
					<li><a data-icon="bars" href="#pageA3">房价记录</a></li>
					<li><a data-icon="bullets" href="#pageA4">换房记录</a></li>
				</ul>
			</nav>
		</div>
	</footer>
	
</section>

<section data-role="page" id="pageA1">		
	<link rel="stylesheet" href="css/mycss.css"> 
	
  	<header data-role="header" data-position="fixed" data-tap-toggle="false">
		<table width="100%" height="35" border="0" cellpadding="0" cellspacing="0">
		   <tr>
			<td height="35" width="45" align="right">
				<a href="index.php" data-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>
		</table>
	</header>
	
	<article data-role="none">
		<ul data-role="listview" data-inset="true" data-divider-theme="a">   			
			<div data-role="none" class="STYLEM2">
				<table width="100%" height="1" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td align="left"></td>
					</tr>
				</table>
			</div>
			<?php				
				$chainno=$_SESSION["ChainNo"];
				
				$orderno="";
				$roomno="";
				$tradetime="";
				$itemname="";
				$scoreval=0;
				//$strikeval=0;
				$payval=0;
				//$paystrike=0;
				$remarks="";
				$username="";
				$scoretime="";
				
				//开始去房间状态数量 Strike_Value,Money_Strike
				$sql=sprintf("SELECT Order_No,Room_No,convert(varchar(16),TradeTime,120)AS TradeTime,Item_Name,Item_Value,Item_PayFor,
							Remarks,TradeMan,convert(varchar(16),Item_Time,120)AS ScoreTime FROM TR_Strike_List WHERE Chain_No='%s' AND DelFlag=0 
							AND TradeTime>Dateadd(day,-20,Getdate()) ORDER BY TradeTime DESC",$chainno);
														
				$result = querySql($sql);		
				while($row = fetch_array($result))
				{
					//得到每一条的记录信息
					$orderno=$row['Order_No'];
					$roomno=$row['Room_No'];
					$tradetime=$row['TradeTime'];
					
					$itemname=$row['Item_Name'];
					$scoreval=$row['Item_Value'];
					$payval=$row['Item_PayFor'];
					$remarks=$row['Remarks'];
					$username=$row['TradeMan'];
					$scoretime=$row['ScoreTime'];
			?>
			<div data-role="none" class="STYLEM2">
				<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="#F5F2E6">
					<tr>
						<td width="120" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;<?php echo $tradetime;?></span></td>
						<td align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">房号 <?php echo $roomno;?></span></td>
						<td width="110" align="right"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;"><?php echo $orderno;?></span></td>
						<td width="10" align="left"></td>
					</tr>
				</table>
			</div>
			<div data-role="none" class="STYLEM3">
				<table width="100%" height="60" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;项目: <?php echo $itemname;?></span></td>
						<td width="80" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">费用: <?php echo $scoreval;?></span></td>
						<td width="80" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">付款: <?php echo $payval;?></span></td>
					</tr>
					<tr>
						<td align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;入账: <?php echo $scoretime;?></span></td>
						<td width="160" align="left" colspan="2"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">经办: <?php echo $username;?></span></td>
					</tr>
					<tr>
						<td align="left" colspan="3"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;原因: <?php echo $remarks;?></span></td>
					</tr>
				</table>
			</div>

			<?php
				}
				//释放数据库
				freeResult($result);
				closeDb();
			?>
		</ul>
	</article>
	
	<footer data-role="footer" data-position="fixed" data-tap-toggle="false">
		<div style="width:100%;height:24px; background-color:#F6F2F2">
			<div data-role="none" class="STYLEM3" style="padding-top:5px;">&nbsp;&nbsp;注: 此处仅显示最近20天的数据信息!</div>
		</div>
		<div style="width:100%;height:1px;background-color:#DDDDDD;"></div>
		<div style="width:100%;height:57px;background-color:#DDDDDD;">
			<nav data-role="navbar" data-type="horizontal">
				<ul>
					<li><a data-icon="eye" href="#pageA0">审核项目</a></li>
					<li><a data-icon="edit" style="color:#666666;background-color:#F3F4EC;" href="#">冲账记录</a></li>
					<li><a data-icon="delete" href="#pageA2">删账记录</a></li>
					<li><a data-icon="bars" href="#pageA3">房价记录</a></li>
					<li><a data-icon="bullets" href="#pageA4">换房记录</a></li>
				</ul>
			</nav>
		</div>
	</footer>
	
</section>

<!--第二个页面 账目删除记录  -->
<section data-role="page" id="pageA2">		
	<link rel="stylesheet" href="css/mycss.css"> 
	
  	<header data-role="header" data-position="fixed" data-tap-toggle="false">
		<table width="100%" height="35" border="0" cellpadding="0" cellspacing="0">
		   <tr>
			<td height="35" width="45" align="right">
				<a href="index.php" data-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>
		</table>
	</header>
	
	<article data-role="none">
		<ul data-role="listview" data-inset="true" data-divider-theme="a">   			
			<div data-role="none" class="STYLEM2">
				<table width="100%" height="1" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td align="left"></td>
					</tr>
				</table>
			</div>
			<?php				
				$chainno=$_SESSION["ChainNo"];
				
				$orderno="";
				$roomno="";
				$tradetime="";
				$itemname="";
				$scoreval=0;
				$payval=0;
				$remarks="";
				$username="";
				$scoretime="";
				
				//开始去房间状态数量 Strike_Value,Money_Strike
				$sql=sprintf("SELECT Order_No,Room_No,convert(varchar(16),TradeTime,120)AS TradeTime,Item_Name,Item_Value,Item_PayFor,
							Remarks,TradeMan,convert(varchar(16),Item_Time,120)AS ScoreTime FROM TR_Strike_List WHERE Chain_No='%s' AND DelFlag=1 And Remarks<>'结账返单'
							AND TradeTime>Dateadd(day,-20,Getdate()) ORDER BY TradeTime DESC",$chainno);
														
				$result = querySql($sql);		
				while($row = fetch_array($result))
				{
					//得到每一条的记录信息
					$orderno=$row['Order_No'];
					$roomno=$row['Room_No'];
					$tradetime=$row['TradeTime'];
					$itemname=$row['Item_Name'];
					$scoreval=$row['Item_Value'];
					$payval=$row['Item_PayFor'];
					$remarks=$row['Remarks'];
					$username=$row['TradeMan'];
					$scoretime=$row['ScoreTime'];
					
			?>
			<div data-role="none" class="STYLEM2">
				<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="#F5F2E6">
					<tr>
						<td width="120" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;<?php echo $tradetime;?></span></td>
						<td align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">房号 <?php echo $roomno;?></span></td>
						<td width="110" align="right"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;"><?php echo $orderno;?></span></td>
						<td width="10" align="left"></td>
					</tr>
				</table>
			</div>
			<div data-role="none" class="STYLEM3">
				<table width="100%" height="60" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;项目: <?php echo $itemname;?></span></td>
						<td width="80" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">费用 <?php echo $scoreval;?></span></td>
						<td width="80" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">付款 <?php echo $payval;?></span></td>
					</tr>
					<tr>
						<td align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;入账: <?php echo $scoretime;?></span></td>
						<td width="160" align="left" colspan="2"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">经办 <?php echo $username;?></span></td>
					</tr>
					<tr>
						<td align="left" colspan="3"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;说明: <?php echo $remarks;?></span></td>
					</tr>
				</table>
			</div>

			<?php
				}
				//释放数据库
				freeResult($result);
				closeDb();
			?>
		</ul>
	</article>
	
	<footer data-role="footer" data-position="fixed" data-tap-toggle="false">
		<div style="width:100%;height:24px; background-color:#F6F2F2">
			<div data-role="none" class="STYLEM3" style="padding-top:5px;">&nbsp;&nbsp;注: 此处仅显示最近20天的数据信息!</div>
		</div>
		<div style="width:100%;height:1px;background-color:#DDDDDD;"></div>
		<div style="width:100%;height:57px;background-color:#DDDDDD;">
			<nav data-role="navbar" data-type="horizontal">
				<ul>
					<li><a data-icon="eye" href="#pageA0">审核项目</a></li>
					<li><a data-icon="edit" href="#pageA1">冲账记录</a></li>
					<li><a data-icon="delete" style="color:#666666;background-color:#F3F4EC;" href="#">删账记录</a></li>
					<li><a data-icon="bars" href="#pageA3">房价记录</a></li>
					<li><a data-icon="bullets" href="#pageA4">换房记录</a></li>
				
				</ul>
			</nav>
		</div>
	</footer>
</section>

<!--第三个页面 房价更改记录  -->
<section data-role="page" id="pageA3">		
	<link rel="stylesheet" href="css/mycss.css"> 
	
  	<header data-role="header" data-position="fixed" data-tap-toggle="false">
		<table width="100%" height="35" border="0" cellpadding="0" cellspacing="0">
		   <tr>
			<td height="35" width="45" align="right">
				<a href="index.php" data-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>
		</table>
	</header>
	
	<article data-role="none">
		<ul data-role="listview" data-inset="true" data-divider-theme="a">   			
			<div data-role="none" class="STYLEM2">
				<table width="100%" height="1" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td align="left"></td>
					</tr>
				</table>
			</div>
			<?php				
				$chainno=$_SESSION["ChainNo"];
				
				$orderno="";
				$roomno="";
				$tradetime="";
				$oldprice=0;
				$newprice=0;
				$remarks="";
				$username="";
				$longime="";
				
				//开始去房间状态数量	
				$sql=sprintf("SELECT Order_No,Room_No,convert(varchar(16),TradeTime,120)AS TradeTime,Old_Price,New_Price,TradeMan,Remarks,LongTime
							FROM TR_RoomPrice_List WHERE  Chain_No='%s' AND TradeTime>dateadd(day,-7,getdate()) AND ABS(Old_Price-New_Price)>10 ORDER BY TradeTime DESC",$chainno);
														
				$result = querySql($sql);		
				while($row = fetch_array($result))
				{
					//得到每一条的记录信息
					$orderno=$row['Order_No'];
					$roomno=$row['Room_No'];
					$tradetime=$row['TradeTime'];
					
					$oldprice=$row['Old_Price'];
					$newprice=$row['New_Price'];

					$remarks=$row['Remarks'];
					$username=$row['TradeMan'];
					$longime=$row['LongTime'];
				
			?>
			<div data-role="none" class="STYLEM2">
				<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="#F5F2E6">
					<tr>
						<td width="120" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;<?php echo $tradetime;?></span></td>
						<td align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">房号 <?php echo $roomno;?></span></td>
						<td width="110" align="right"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;"><?php echo $orderno;?></span></td>
						<td width="10" align="left"></td>
					</tr>
				</table>
			</div>
			<div data-role="none" class="STYLEM3">
				<table width="100%" height="40" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td width="90" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;原房价: <?php echo number_format($oldprice);?></span></td>
						<td align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">间隔: <?php echo $longime;?></span></td>
						<td width="100" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">经办: <?php echo $username;?></span></td>
					</tr>
					
					<tr>
						<td width="90" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;新房价: <?php echo number_format($newprice);?></span></td>
						<td align="left" colspan="2"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">说明: <?php echo $remarks;?></span></td>
					</tr>
				</table>
			</div>

			<?php
				}
				//释放数据库
				freeResult($result);
				closeDb();
			?>
		</ul>
	</article>
	
	<footer data-role="footer" data-position="fixed" data-tap-toggle="false">
		<div style="width:100%;height:24px;background-color:#F6F2F2">
			<div data-role="none" class="STYLEM3" style="padding-top:5px;">&nbsp;&nbsp;注: 此处仅显示最近7天的数据信息!房价调整差额大于10</div>
		</div>
		<div style="width:100%;height:1px;background-color:#DDDDDD;"></div>
		<div style="width:100%;height:57px;background-color:#DDDDDD;">
			<nav data-role="navbar" data-type="horizontal">
				<ul>
					<li><a data-icon="eye" href="#pageA0">审核项目</a></li>
					<li><a data-icon="edit" href="#pageA1">冲账记录</a></li>
					<li><a data-icon="delete" href="#pageA2">删账记录</a></li>
					<li><a data-icon="bars" style="color:#666666;background-color:#F3F4EC;" href="#">房价记录</a></li>
					<li><a data-icon="bullets" href="#pageA4">换房记录</a></li>
				</ul>
			</nav>
		</div>
			
	</footer>
</section>

<!--第四个页面 换房记录  -->
<section data-role="page" id="pageA4">		
	<link rel="stylesheet" href="css/mycss.css"> 
	
  	<header data-role="header" data-position="fixed" data-tap-toggle="false">
		<table width="100%" height="35" border="0" cellpadding="0" cellspacing="0">
		   <tr>
			<td height="35" width="45" align="right">
				<a href="index.php" data-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>
		</table>
	</header>
	
	<article data-role="none">
		<ul data-role="listview" data-inset="true" data-divider-theme="a">   			
			<div data-role="none" class="STYLEM2">
				<table width="100%" height="1" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td align="left"></td>
					</tr>
				</table>
			</div>
			<?php				
				$chainno=$_SESSION["ChainNo"];
				
				$orderno="";
				$oldroomno="";
				$oldroomprice=0;
				$oldroomtype="";
				
				$tradetime="";
				
				$newroomno="";
				$newroomprice=0;
				$newroomtype="";
				
				$remarks="";
				$username="";
				$manname="";
				
				//开始去房间状态数量
				$sql=sprintf("SELECT Order_No,OldRoomNo,OldRoomPrice,OldRoomType,convert(varchar(16),TradeTime,120)AS TradeTime,NewRoomNo,NewRoomPrice,NewRoomType,
						TradeMan,Remarks,CustomName FROM TR_RoomChange_List WHERE Chain_No='%s' AND TradeTime>dateadd(day,-20,getdate()) ORDER BY TradeTime DESC",$chainno);

				$result = querySql($sql);		
				while($row = fetch_array($result))
				{
					//得到每一条的记录信息
					$orderno=$row['Order_No'];
					$oldroomno=$row['OldRoomNo'];
					$oldroomprice=$row['OldRoomPrice'];
					$oldroomtype=$row['OldRoomType'];
					
					$tradetime=$row['TradeTime'];
					
					$newroomno=$row['NewRoomNo'];
					$newroomprice=$row['NewRoomPrice'];
					$newroomtype=$row['NewRoomType'];
					
					$remarks=$row['Remarks'];
					$username=$row['TradeMan'];
					$manname=$row['CustomName'];
								
			?>
			<div data-role="none" class="STYLEM3">
				<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="#F5F2E6">
					<tr>
						<td width="120" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;<?php echo $tradetime;?></span></td>
						<td align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">宾客: <?php echo $manname;?></span></td>
						<td width="110" align="right"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;"><?php echo $orderno;?></span></td>
						<td width="10" align="left"></td>
					</tr>
				</table>
			</div>
			<div data-role="none" class="STYLEM3">
				<table width="100%" height="60" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td width="120" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;原房号: <?php echo $oldroomno;?></span></td>
						<td width="85" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">原房价: <?php echo number_format($oldroomprice);?></span></td>
						<td align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">原房型: <?php echo $oldroomtype;?></span></td>
					</tr>
					
					<tr>
						<td width="120" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;新房号: <?php echo $newroomno;?></span></td>
						<td width="85" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">新房价: <?php echo number_format($newroomprice);?></span></td>
						<td align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">新房型: <?php echo $newroomtype;?></span></td>
					</tr>
					
					<tr>
						<td width="120" align="left"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;操作员: <?php echo $username;?></span></td>
						<td align="left" colspan="2"><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">说明: <?php echo $remarks;?></span></td>
					</tr>
				</table>
			</div>

			<?php
				}
				//释放数据库
				freeResult($result);
				closeDb();
			?>
		</ul>
	</article>
	
	<footer data-role="footer" data-position="fixed" data-tap-toggle="false">
		
		<div style="width:100%;height:24px;background-color:#F6F2F2">
			<div data-role="none" class="STYLEM3" style="padding-top:5px;">&nbsp;&nbsp;注: 此处仅显示最近20天的数据信息!</div>
		</div>
		<div style="width:100%;height:1px;background-color:#DDDDDD;"></div>
		<div style="width:100%;height:57px;background-color:#DDDDDD;">
			<nav data-role="navbar" data-type="horizontal">
				<ul>
					<li><a data-icon="eye" href="#pageA0">审核项目</a></li>
					<li><a data-icon="edit" href="#pageA1">冲账记录</a></li>
					<li><a data-icon="delete" href="#pageA2">删账记录</a></li>
					<li><a data-icon="bars" href="#pageA3">房价记录</a></li>
					<li><a style="color:#666666;background-color:#F3F4EC;" data-icon="bullets" href="#">换房记录</a></li>
				</ul>
			</nav>
		</div>
		
	</footer>
</section>

</body>
</html>
