<?php
	session_start();
	header("Content-type:text/html;charset=gb2312");
	//判断是否登录系统		
	if($_SESSION["main_viploginedsk"]!="1" |$_SESSION["main_vipnosk"]=="")
	{
		//没有登录开始启动登录
		require_once("logina.php");	
	}
?>
<!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>微信订房</title>

	<script src="jsp4/jquery.js"></script>
	<link rel="stylesheet" href="css/mycss.css"> 
	
	<!--<link rel="stylesheet" href="jsp5/jquery.mobile-1.4.5.min.css">-->
	<!--<script src="jsp4/jquery.mobile-1.4.3.min.js"></script>-->
	<script src="jsp5/jquery.mobile-1.4.5.min.js"></script>
	<link rel="stylesheet" href="jsp5/jquery.mobile-1.4.5.min.css">
	<link rel="stylesheet" href="jsp4/jquery.mobile.datepicker.css">
	
	<script src="jsp4/jquery.ui.datepicker.js"></script>
	<script id="mobile-datepicker" src="jsp4/jquery.mobile.datepicker.js"></script>
	
	<script language="JavaScript"> 
		//不允许进行后退
		javascript:window.history.forward(0); 
	</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>

<?php
	require_once("db/db.php");	
	require_once("common/common.php");
	require_once("../Wx.Config.php");	//只加载一次
	
	$strorderno=trim($_REQUEST['tbno']);	//订单号
	$strdoid=trim($_REQUEST['doid']);		//1是历史订单,否则我的订单
		
	$sql=sprintf("SELECT Convert(varchar(10),a.CheckInTime,120)as checkintime,Convert(varchar(10),a.CheckOutTime,120)as checkouttime,
					b.Room_Type,b.Room_Count,b.RoomPrice,a.Custom_Name,a.Remarks,a.Book_LinkMan,a.CheckDays,Convert(varchar(5),a.WillTime,8)as willtime,
					a.Book_LinkTel,a.RoomNoTemp,a.intBreakfast,a.intBInvoice,c.Chain_Name,c.Chain_Address,c.Chain_Tel,a.Order_State,
					DATEPART(weekday,a.CheckInTime)AS weekday1,DATEPART(weekday,a.CheckOutTime) AS weekday2 FROM TR_Order_Inform a,
					TR_Book_RoomType b,Chain_Infor c WHERE a.Order_No=b.Order_No AND a.Chain_No=c.Chain_No AND a.Order_No='%s';",$strorderno);
					
	$result = querySql($sql);
	$row = fetch_array($result);
	
	$strchainname = trim($row['Chain_Name']);		//分店名称
	$strchainaddress = trim($row['Chain_Address']);	//分店地址
	$strchaintelno = trim($row['Chain_Tel']);		//分店电话
	$strcheckinday = $row['checkintime'];			//入住时间
	$strcheckoutday = $row['checkouttime'];			//离店日期
	$intcheckdays = $row['CheckDays'];				//住房天数
	$strwilltime = $row['willtime'];				//保留时间
	$strroomtype = $row['Room_Type'];				//房型
	$introomcount = $row['Room_Count'];				//订房数
	$fltroomprice = $row['RoomPrice'];				//房价
	$strmanname = $row['Custom_Name'];				//联系人
	$strmantelno = $row['Book_LinkTel'];			//联系电话
	$intweekday1 = $row['weekday1'];
	$intweekday2 = $row['weekday2'];
	$strremarks = $row['Remarks'];
	$intorderstate = $row['Order_State'];		//预订0,入住1,取消2,完成3
	
	$fltallval=$introomcount * $fltroomprice * $intcheckdays;
	
	//释放数据库
	freeResult($result);	
	
	$strorderstate="预订单";
	if($intorderstate==1)
		$strorderstate="已入住";
	elseif($intorderstate==2)
		$strorderstate="已取消";
	elseif($intorderstate==3)
		$strorderstate="已完成";
	
	$strweekday1="";
	$strweekday2="";
	//------------------------------------//
	if($intweekday1==1)
		$strweekday1="星期日";
	elseif($intweekday1==2)
		$strweekday1="星期一";
	elseif($intweekday1==3)
		$strweekday1="星期二";
	elseif($intweekday1==4)
		$strweekday1="星期三";
	elseif($intweekday1==5)
		$strweekday1="星期四";
	elseif($intweekday1==6)
		$strweekday1="星期五";
	elseif($intweekday1==7)
		$strweekday1="星期六";
	
	if($intweekday2==1)
		$strweekday2="星期日";
	elseif($intweekday2==2)
		$strweekday2="星期一";
	elseif($intweekday2==3)
		$strweekday2="星期二";
	elseif($intweekday2==4)
		$strweekday2="星期三";
	elseif($intweekday2==5)
		$strweekday2="星期四";
	elseif($intweekday2==6)
		$strweekday2="星期五";
	elseif($intweekday2==7)
		$strweekday2="星期六";
	
	//3.获取友情提醒信息
	$strrembertext1="";
	$strrembertext2="";
	$strSelRoomText='';	//选房后的友情提醒信息
	$intCanSelRoom=0;	//是否可以选房
	$intCanCheckIn=0;	//是否可以自主入住
	
	$sql=sprintf("SELECT Notice,RemindText,intCanSelRoom,intCanCheckIn,SelRoomText FROM TR_MobileParam;");
	$result = querySql($sql);
	if($row = fetch_array($result))
	{
		$strrembertext1 = $row['Notice'];
		$strrembertext2 = $row['RemindText'];
		
		$intCanSelRoom = $row['intCanSelRoom'];
		$intCanCheckIn = $row['intCanCheckIn'];
		$strSelRoomText = trim($row['SelRoomText']);
	}
	$strrembertext1=trim($strrembertext1);
	$strrembertext2=trim($strrembertext2);
	//释放数据库
	freeResult($result);	
		
	//判断是否已经支付过
	$sql = sprintf("SELECT Sum(PayFor_Value)AS SumPayFor FROM TR_Consume_List WHERE order_no='%s'",$strorderno);
	$result = querySql($sql);
	$row = fetch_array($result);
	$havepayfor = trim($row['SumPayFor']); //预订房型
	
	freeResult($result);

	//得到已选房数量	
	$introomselcount=0;	//已选房数量
	$sql=sprintf("SELECT COUNT(ListNo)AS SelCount FROM TR_Order_Room_List WHERE Order_No='%s'",$strorderno);
	$result = querySql($sql);
	$row = fetch_array($result);
	$introomselcount = trim($row['SelCount']);
	
	freeResult($result);
						
	//关闭数据库
	closeDb();	
?>

<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">
<!--第一个页面的内容实现---------------------------->
<section data-role="page" id="hispage1">
	<header data-role="header" data-position="fixed" data-tap-toggle="false" style="border-top-width:0px;border-bottom-width:0px;">
        <table width="100%" height="45" border="0" cellpadding="0" cellspacing="0" bgcolor="<?php echo WxMainConfig::colHeadBkColorBook;?>">
		   	<tr>
				<td height="45" width="30" align="center"></td>
				<td height="45" align="center" valign="middle">
	                <span id="MsgTxt" style="color:<?php echo WxMainConfig::colHeadTextColorBook;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:19px;text-shadow:none;">订单信息 - <?php echo $strorderstate;?></span>
               	</td>
				<td height="45" width="30" valign="middle"></td>
		  	</tr>
		</table>
	</header>
	
	<article data-role="none">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
			<?php if(strlen($strrembertext1)>0) {?>
				<tr>
					<td height="4" width="15"></td>
					<td height="4" align="left"></td>
					<td height="4" width="15"></td>
				</tr>
			
				<tr>
					<td height="20" width="15"></td>
					<td height="20" align="left">
						<span style="color: #999999;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:12px;"><?php echo $strrembertext1;?></span>
					</td>
					<td height="20" width="15"></td>
				</tr>
				
				<tr>
					<td height="5" width="15"></td>
					<td height="5" align="left"></td>
					<td height="5" width="15"></td>
				</tr>
				
				<tr>
					<td height="1" width="15" bgcolor="#F2E2E2"></td>
					<td height="1" align="left" bgcolor="#F2E2E2"></td>
					<td height="1" width="15" bgcolor="#F2E2E2"></td>
				</tr>
			<?php } ?>
			
			<tr>
				<td height="6" width="15"></td>
				<td height="6" align="left"></td>
				<td height="6" width="15"></td>
			</tr>
				
			<tr>
				<td height="30" width="15"></td>
				<td height="30" align="left">
					<span style="color: #000000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:20px;"><?php echo $strchainname;?></span>
				</td>
				<td height="30" width="15"></td>
			</tr>
			
			<tr>
					<td height="4" width="15"></td>
					<td height="4" align="left"></td>
					<td height="4" width="15"></td>
				</tr>
				
			<tr>
				<td height="20" width="15"></td>
				<td height="20" align="left">
					<span style="color: #999999;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;">电话:&nbsp;<?php echo $strchaintelno; ?></span>
				</td>
				<td height="20" width="15"></td>
			</tr>
			
			<tr>
				<td height="20" width="15"></td>
				<td height="20" align="left">
					<span style="color: #999999;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:14px;"><?php echo $strchainaddress;?></span>
				</td>
				<td height="20" width="15"></td>
			</tr>
			
			<tr>
				<td height="5" width="15"></td>
				<td height="5" align="left"></td>
				<td height="5" width="15"></td>
			</tr>
			
			<tr>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
				<td height="1" align="left" bgcolor="#F2E2E2"></td>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
			</tr>
			
			<tr>
				<td height="5" width="15" bgcolor="#66FFFF"></td>
				<td height="5" align="left" bgcolor="#66FFFF"></td>
				<td height="5" width="15" bgcolor="#66FFFF"></td>
			</tr>
			
			<tr>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
				<td height="1" align="left" bgcolor="#F2E2E2"></td>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
			</tr>
			
			
			<tr>
				<td height="5" width="15"></td>
				<td height="5" align="left"></td>
				<td height="5" width="15"></td>
			</tr>
			
			<tr>
				<td height="5" width="15"></td>
				<td height="15" align="left">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td height="35" width="50">
								<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;">入住</span>
							</td>
							<td height="35">
								<span style="color: #570057;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;"><?php echo $strcheckinday;?></span>
								<span style="color: #570057;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;">&nbsp;&nbsp;<?php echo $strweekday1;?></span>
							</td>
							<td height="35" width="50" rowspan="2">
								<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:18px;"><?php echo $intcheckdays;?>晚</span>
							</td>
						</tr>
						
						<tr>
							<td height="35" width="50">
								<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;">离店</span>
							</td>
							<td height="35">
								<span style="color: #570057;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;"><?php echo $strcheckoutday;?></span>
								<span style="color: #570057;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;">&nbsp;&nbsp;<?php echo $strweekday2;?></span>
							</td>
						</tr>
						
						<tr>
							<td height="35" width="50">
								<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;">保留</span>
							</td>
							<td height="35">
								<span style="color: #570057;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;"><?php echo $strwilltime;?></span>
							</td>
							<td height="35" width="50"></td>
						</tr>	
					</table>
				</td>
				<td height="5" width="15"></td>
			</tr>
			
			<tr>
				<td height="5" width="15"></td>
				<td height="5" align="left"></td>
				<td height="5" width="15"></td>
			</tr>
			
			<tr>
				<td height="1" width="15"></td>
				<td height="1" align="left" bgcolor="#F2E2E2"></td>
				<td height="1" width="15"></td>
			</tr>
			
			<tr>
				<td height="5" width="15"></td>
				<td height="5" align="left"></td>
				<td height="5" width="15"></td>
			</tr>
			
			<tr>
				<td height="5" width="15"></td>
				<td height="15" align="left">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td height="35" width="50">
								<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;">房型</span>
							</td>
							<td height="35">
								<span style="color: #570057;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;"><?php echo $strroomtype;?></span>
							</td>
							<td height="35" width="50">
								<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;">
									<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:18px;"><?php echo number_format($introomcount).'间';?></span>
								</span>
							</td>
						</tr>
						
						<tr>
							<td height="35" width="50">
								<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;">房价</span>
							</td>
							<td height="35" colspan="2">
								<span style="color: #570057;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:18px;"><?php echo "  ￥".number_format($fltroomprice);?></span>
								<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:14px;">&nbsp;&nbsp;&nbsp;每晚房价</span>
							</td>
						</tr>
											
					</table>
				</td>
				<td height="5" width="15"></td>
			</tr>
			
			<tr>
				<td height="1" width="15"></td>
				<td height="1" align="left" bgcolor="#F2E2E2"></td>
				<td height="1" width="15"></td>
			</tr>
			
			<tr>
				<td height="5" width="15"></td>
				<td height="5" align="left"></td>
				<td height="5" width="15"></td>
			</tr>
			
			<tr>
				<td height="40" width="15"></td>
				<td height="40" align="left">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td height="35" width="50">
								<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;">姓名</span>
							</td>
							<td height="35">
								<span style="color: #570057;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;"><?php echo $strmanname;?></span>
							</td>
						</tr>
						
						<tr>
							<td height="35" width="50">
								<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;">手机</span>
							</td>
							<td height="35" colspan="2">
								<span style="color: #570057;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;"><?php echo $strmantelno;?></span>
							</td>
						</tr>
						
						<tr>
							<td height="35" width="50">
								<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;">要求</span>
							</td>
							<td height="35" colspan="2">
								<span style="color: #570057;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:16px;"><?php echo $strremarks;?></span>
							</td>
						</tr>
						
					</table>
				</td>
				<td height="40" width="15"></td>
			</tr>
						
			<tr>
				<td height="5" width="15"></td>
				<td height="5" align="left"></td>
				<td height="5" width="15"></td>
			</tr>
			
			<tr>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
				<td height="1" align="left" bgcolor="#F2E2E2"></td>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
			</tr>
			
			<tr>
				<td height="5" width="15" bgcolor="#66FFFF"></td>
				<td height="5" align="left" bgcolor="#66FFFF"></td>
				<td height="5" width="15" bgcolor="#66FFFF"></td>
			</tr>
			
			<tr>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
				<td height="1" align="left" bgcolor="#F2E2E2"></td>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
			</tr>
			
			<!--显示温馨提示内容-->
			<?php if(strlen($strrembertext2)>0) { ?>
				<tr>
					<td height="5" width="15"></td>
					<td height="5" align="left"></td>
					<td height="5" width="15"></td>
				</tr>
				
				<tr>
					<td height="15" width="15"></td>
					<td height="15" align="left">
						<span style="color: #000000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:12px;">温馨提示:</span>
					</td>
					<td height="15" width="15"></td>
				</tr>
				
				<tr>
					<td height="15" width="15"></td>
					<td height="15" align="left">
						<span style="color: #999999;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:12px;"><?php echo $strrembertext2;?></span>
					</td>
					<td height="15" width="15"></td>
				</tr>
				
				<tr>
					<td height="10" width="15"></td>
					<td height="10" align="left"></td>
					<td height="10" width="15"></td>
				</tr>

				<tr>
					<td height="1" width="15" bgcolor="#F2E2E2"></td>
					<td height="1" align="left" bgcolor="#F2E2E2"></td>
					<td height="1" width="15" bgcolor="#F2E2E2"></td>
				</tr>
			<?php } ?>

			<!---显示订单金额信息--->			
			<tr>
				<td height="40" width="15"></td>
				<td height="40" align="left">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td width="55%">
								<span style="color: #000000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:15px;">订单金额:&nbsp;</span>
								<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:18px;"><?php echo "￥".number_format($fltallval);?></span>
							</td>
							<td width="45%">
								<?php if($intorderstate<1) 
									{
										if($havepayfor<=0)
										{
								?>																						
                                            	<div onClick="window.location = 'paysel.php?price=<?php echo $fltallval;?>&orderno=<?php echo $strorderno;?>';" style="border-radius:5px;width:100%; height:40px; 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:14px;text-shadow:none;">去支付</span>                            	
                                                        </td></tr>
                                                    </table>
                                                </div>				
                              
								<?php 
										}
									}
								?>
							</td>
						</tr>
					</table>
				</td>
				<td height="40" width="15"></td>
			</tr>
			
			<tr>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
				<td height="1" align="left" bgcolor="#F2E2E2"></td>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
			</tr>
			
			<?php if($intorderstate<1) {?>
				<tr>
					<td height="5" width="15" bgcolor="#66FFFF"></td>
					<td height="5" align="left" bgcolor="#66FFFF"></td>
					<td height="5" width="15" bgcolor="#66FFFF"></td>
				</tr>
				
				<tr>
					<td height="1" width="15" bgcolor="#F2E2E2"></td>
					<td height="1" align="left" bgcolor="#F2E2E2"></td>
					<td height="1" width="15" bgcolor="#F2E2E2"></td>
				</tr>
			<?php }?>
						
            <!--用来显示已选房的信息-->

            <tr>
				<td height="40" width="15"></td>
				<td height="40" align="left">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td  height="35" width="100%">
								<span style="color: #000000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:15px;">已选房&nbsp;</span>
								<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:12px;">共<?php echo $introomcount;?>间/已选<?php echo $introomselcount;?>间</span>
							</td>
						</tr>
                        
                        <!--以下显示已选房的列表-->
                        <?php     
						    $strRoomNo='';
							$intBillState=0;
							$strBListNo='';
							$strBillState='';
							$intRoomIndex=0;
							//Room_Type,RoomPrice
                        	$sql=sprintf("SELECT ListNo,Room_No,Room_BillState FROM TR_Order_Room_List WHERE Order_No='%s'",$strorderno);

							$result = querySql($sql);
											
							while($row = fetch_array($result))
							{
								$strRoomNo = $row['Room_No'];
								$intBillState = $row['Room_BillState'];
								$strBListNo = $row['ListNo'];
								//单据客房状态:0预排,1预订,2入住,3退房,4取消
								switch($intBillState)
								{
									case 0:
										$strBillState='已选房';
										break;
									case 1:
										$strBillState='待入住';
										break;
									case 2:
										$strBillState='已入住';
										break;
									case 3:
										$strBillState='已退房';
										break;
									case 4:
										$strBillState='已取消';
										break;
								}
								
								if($intRoomIndex<1)
								{
                    	?>
						<tr><td height="1" width="100%" bgcolor="#F2E2E2"></td></tr>
                        <?php 
								}
						?>
                    	<tr>
							<td height="35" width="100%">
                            	<table width="100%" border="0" cellpadding="0" cellspacing="0">
                                	<tr>
                                    	<td height="35" width="10"></td>
                                        <td height="35">
                                        	<span style="color: #000000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:15px;"><?php echo $strRoomNo;?></span>
                                        </td>
                                       	<td height="35" width="80" align="left">
                                        	<span style="color: #000000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:15px;"><?php echo $strBillState;?></span>
                                        </td>
                                    </tr>
                                </table>
							</td>
						</tr>
                    
                    	<?php 
								$intRoomIndex = $intRoomIndex + 1;
							}
							//释放数据库
							freeResult($result);
							closeDb();
								
							if($intRoomIndex>0 && strlen($strSelRoomText)>0)
							{
								//如果有已选房信息，则提示选房后的友情提醒内容
						?>
                        <tr><td height="1" width="100%" bgcolor="#F2E2E2"></td></tr>
                        <tr>
							<td height="35" width="100%">
                            	<span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:12px;"><?php echo $strSelRoomText;?></span>
							</td>
						</tr>
                        <?php 
							}
						?>
                        
					</table>
				</td>
				<td height="40" width="15"></td>
			</tr>
            
            <tr>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
				<td height="1" align="left" bgcolor="#F2E2E2"></td>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
			</tr>
            
            <tr>
				<td height="5" width="15" bgcolor="#66FFFF"></td>
				<td height="5" align="left" bgcolor="#66FFFF"></td>
				<td height="5" width="15" bgcolor="#66FFFF"></td>
			</tr>
				
			<tr>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
				<td height="1" align="left" bgcolor="#F2E2E2"></td>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
			</tr>
                
            <tr>
				<td height="10" width="15"></td>
				<td height="10" align="left"></td>
				<td height="10" width="15"></td>
			</tr>
            
            <!--用来显示下方操作按钮部分-->
            <?php 
				//判断是否有两个按钮
				$intHaveTowButtom = 0;
				
				if($intorderstate<1)
				{
					if($havepayfor<=0)
					{
						//如果没有支付，则可以取消订单
						$intHaveTowButtom = 1;
					}
					else
					{
						//如果已经支付过，显示允许选房按钮
						if($introomselcount<$introomcount)
						{
							//显示选房按钮
							if($intCanSelRoom>0)
							{
								$intHaveTowButtom = 2;
							}
						}
						else
						{
							//显示我要住房按钮
							if($intCanCheckIn>0)
							{
								$intHaveTowButtom = 3;
							}
						}
					}
				}
			?>
            
            <tr>
				<td height="20" width="15"></td>
				<td height="20" align="left">
                	<?php
						if($strdoid=='1')
						{
							$strbackurl="hisorder1.php";
						}
						elseif($strdoid=='2')
						{
						 	$strbackurl="hisorder2.php";
						}
						else
						{
							$strbackurl="orderlist.php";
						}
						
							
						if($intHaveTowButtom>0)
						{
							//显示,返回按钮 和 取消订单按钮
							$strbut2rul="";
							$strbut2text="";
							
							if($intorderstate<1) 
							{
								if($havepayfor<=0)
								{
									$strbut2rul="orderqxqr.php?tbno=".$strorderno."&doid=".$strdoid;
									$strbut2text="取消订单";
								} 
								else 
								{	
									//已付款，显示允许选房按钮
									if($introomselcount<$introomcount)
									{
										$strbut2rul="orderselroom.php?tbno=".$strorderno."&doid=".$strdoid;
										$strbut2text="去选房";
									}
									else
									{
										$strbut2rul="orderroomcheckin.php?tbno=".$strorderno;
										$strbut2text="我要入住";
									}
								}	
					?>
                    			<table width="100%" border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td width="48%">
                                                <div onClick="window.location = '<?php echo $strbackurl;?>';" style="border-radius:5px;width:100%; height:45px; background-color:#D7AA28;">
                                                    <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                                                        <tr><td width="100%" height="100%" align="center">
                                                            <span style="color:#fff ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-shadow:none;">返回</span>                            	
                                                        </td></tr>
                                                    </table>
                                                </div>				
                                        </td>
                                        <td width="4%"></td>
                                        <td width="48%">
                                                <div onClick="window.location = '<?php echo $strbut2rul;?>';" style="border-radius:5px;width:100%; height:45px; 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:16px;text-shadow:none;"><?php echo $strbut2text;?></span>                            	
                                                        </td></tr>
                                                    </table>
                                                </div>				
                                        </td>
                                    </tr>
                                </table>
                    <?php
							}
							else
							{
								//不是预定单，只显示一个返回按钮
					?>
                                    <div onClick="window.location = '<?php echo $strbackurl;?>';" style="border-radius:5px;width:100%; height:45px; background-color:#D7AA28;">
                                        <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                                            <tr><td width="100%" height="100%" align="center">
                                                <span style="color:#fff ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-shadow:none;">返回</span>                            	
                                            </td></tr>
                                        </table>
                                    </div>				
                    <?php
							}
						}
						else
						{
							//只显示返回按钮
							
					?>
								<div onClick="window.location = '<?php echo $strbackurl;?>';" style="border-radius:5px;width:100%; height:45px; background-color:#D7AA28;">
                                	<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                                    	<tr><td width="100%" height="100%" align="center">
                                        	<span style="color:#fff ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-shadow:none;">返回</span>                            	
                                        </td></tr>
                                  	</table>
                              	</div>				
                      
                    <?php
						}
						
                    ?>
				</td>
				<td height="20" width="15"></td>
			</tr>
            
            			
			<tr>
				<td height="10" width="15"></td>
				<td height="10" align="left"></td>
				<td height="10" width="15"></td>
			</tr>
			
			<tr>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
				<td height="1" align="left" bgcolor="#F2E2E2"></td>
				<td height="1" width="15" bgcolor="#F2E2E2"></td>
			</tr>
		</table>
			
	</article>
</section>

</body>
	
</html>