<?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">
	
	<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");
	
	//得到默认日期
	$strroomtypeid=$_REQUEST['romtype'];
	$strroomprice=trim($_REQUEST['rompric']);
	if($strroomtypeid=="")
		$strroomtypeid="0";
		
	$strroomtype="";
	$strroomtypetext="";
	$fltroomprice=0;
	$introombed=0;
	$strbedtype="";
	$strfloor="";
	$strchainno=$_SESSION["main_order_chainno"];
		
	$selroomtypeimg="";
	
	if($strroomtypeid!="")
	{
		//重新获得新分店信息
		$sql=sprintf("SELECT Room_Type,Remarks2,Room_PriceS,Room_Img,BedType,Bed_Count,FloorText FROM TR_Room_Type WHERE ListNo=%s;",$strroomtypeid);

		$result = querySql($sql);
		$row = fetch_array($result);
		$strroomtype = $row['Room_Type'];
		$strroomtypetext = trim($row['Remarks2']);
		$fltroomprice = $row['Room_PriceS'];
		$strtypeimg=trim($row['Room_Img']);
		$introombed = $row['Bed_Count'];
		$strbedtype = $row['BedType'];
		$strfloor = $row['FloorText'];
		if(strlen($strtypeimg)>0)
			$selroomtypeimg='images/hotel_images/'.$strchainno."/".$strtypeimg;
		else
			$selroomtypeimg="images/hotel_images/".$strchainno."/".$strroomtype.".jpg";
	}
	
	if(strlen($strroomprice)>0)
	{
		$fltroomprice=$strroomprice;
	}
	//释放数据库
	freeResult($result);	
	//关闭数据库
	//closeDb();
?>

<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">
<!--第一个页面的内容实现---------------------------->
<section data-role="page" id="pageh1">
<!--	<header data-role="header" data-position="fixed" data-tap-toggle="false">
		<table width="100%" height="45" border="0" cellpadding="0" cellspacing="0" bgcolor="#FAFAFA">
			<tr>
				<td height="45" width="10"></td>
				<td height="45" align="center">
					<span style="color: #000000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-weight:bold; font-size:15px;"><?php echo $strroomtype;?></span>
				</td>
			</tr>
		</table>
	</header>
-->	
	<article data-role="none">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
			<tr><td width="100%" height="180"><IMG src="<?php echo $selroomtypeimg; ?>" width="100%" height="180" border="0"></td></tr>
		</table>
			
		<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
			<tr>
				<td height="3" width="15"></td>
				<td height="3" align="left"></td>
				<td height="3" width="15"></td>
			</tr>
			
			<tr>
				<td height="30" width="15"></td>
				<td height="30" align="left">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td width="30"><IMG src="images/floor.png" style="padding-top:5px;" border=0></td>
							<td><span style="color: #999999;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;">楼层&nbsp;&nbsp;&nbsp;</span><span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;"><?php echo $strfloor;?></span></td>
						</tr>
					</table>
				</td>
				<td height="30" 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="3" width="15"></td>
				<td height="3" align="left"></td>
				<td height="3" width="15"></td>
			</tr>
			
			<tr>
				<td height="30" width="15"></td>
				<td height="30" align="left">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td width="30"><IMG src="images/bed.png" style="padding-top:5px;" border=0></td>
							<td><span style="color: #999999;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;">可住&nbsp;&nbsp;&nbsp;</span><span style="color: #000000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;"><?php echo $introombed;?>人</span></td>
						</tr>
					</table>
				</td>
				<td height="30" 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="3" width="15"></td>
				<td height="3" align="left"></td>
				<td height="3" width="15"></td>
			</tr>
			
			<tr>
				<td height="30" width="15"></td>
				<td height="30" align="left">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td width="30"><IMG src="images/type.png" style="padding-top:5px;" border=0></td>
							<td><span style="color: #999999;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;">床型&nbsp;&nbsp;&nbsp;</span><span style="color: #000000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;"><?php echo $strbedtype;?></span></td>
						</tr>
					</table>
				</td>
				<td height="30" 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="8" width="15"></td>
				<td height="8" align="left"></td>
				<td height="8" width="15"></td>
			</tr>			
			
			<?php
				if(strlen($strroomtypetext)<2)
				{
			?>				
				<tr>
					<td height="8" width="15"></td>
					<td height="8" align="left"></td>
					<td height="8" width="15"></td>
				</tr>
			<?php
				}
				else
				{
			?>
				<tr>
					<td height="30" width="15"></td>
					<td height="30" align="left">
						<span style="color: #999999;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $strroomtypetext; ?></span>
					</td>
					<td height="30" width="15"></td>
				</tr>
				
				<tr>
					<td height="8" width="15"></td>
					<td height="8" align="left"></td>
					<td height="8" width="15"></td>
				</tr>
			<?php
				}
			?>
					
			<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="45" width="15"></td>
				<td height="45" align="left">
					<table width="100%" height="45" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
						<tr height="100%" valign="top">
							<td width="50%" valign="middle">
								<span style="color: #FF3535;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:18px;"><?php echo "￥".number_format($fltroomprice,0);?></span>
								<span style="color : #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:12px;">&nbsp;&nbsp;&nbsp;每晚房价</span>
							</td>
							<td width="50%" height="45" valign="middle">
									<div onClick="window.location = 'ordernew.php?romtype=<?php echo $strroomtypeid;?>';" style="border-radius:3px;width:100%; height:35px; 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>
						</tr>
					</table>			
				</td>
				<td height="45" 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 
				$intRowCount=0;
				$sql=sprintf("SELECT COUNT(ListNo)AS MyCount FROM TR_Room_Type_Image WHERE TypeListNo=%s",$strroomtypeid);
				$result = querySql($sql);
				$row = fetch_array($result);
				$intRowCount=$row['MyCount'];
				freeResult($result);
				
				if($intRowCount>0)
				{
				?>
				<tr>
					<td height="10" width="15"></td>
					<td height="10" align="left"></td>
					<td height="10" width="15"></td>
				</tr>
				<?php
					$strImgFile="";
					$strRemarks="";
					$strRoomImg="";
					
					$sql=sprintf("SELECT ImageName,Remarks FROM TR_Room_Type_Image WHERE TypeListNo=%s Order By ListNo ASC",$strroomtypeid);
					$result = querySql($sql);
									
					while($row = fetch_array($result))
					{
						$strImgFile=trim($row['ImageName']);	
						$strRemarks=trim($row['Remarks']);
						
						if(strlen($strImgFile)>0)
						{
							$strRoomImg="images/hotel_images/".$strchainno."/".$strImgFile;				
				
			?>
			<tr>
				<td height="1" width="15" ></td>
				<td height="1" align="left">
					<IMG style="border-radius:3px;" src="<?php echo $strRoomImg; ?>" width="100%" height="175" border="0">
					<?php echo $introws;?>
				</td>
				<td height="1" width="15"></td>
			</tr>
			<?php
					}
					
					if(strlen($strRemarks)>0)
					{
			?>
			<tr>
				<td height="1" width="15" ></td>
				<td height="1" align="left">
					<span style="color: #999999;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;"><?php echo $strRemarks; ?></span>
				</td>
				<td height="1" width="15"></td>
			</tr>	
			<?php
						}
					}
					//释放数据库
					freeResult($result);
				}
				//关闭数据库
				closeDb();
			?>
			<tr>
				<td height="5" width="15" ></td>
				<td height="5" align="left" ></td>
				<td height="5" width="15"></td>
			</tr>
		</table>
	</article>
	
	<footer data-role="footer" data-position="fixed" data-tap-toggle="false" style="border-top:0px solid #F2E2E2;border-bottom:1px solid #F2E2E2;border-left:1px solid #F2E2E2;border-right:1px solid #F2E2E2;">
		<table width="100%" height="10" border="0" cellpadding="0" cellspacing="0">
			<tr height="100%" valign="top">
				<td width="25%">					
					<a class="ui-btn ui-icon-home ui-btn-icon-top" data-transition="slide" target="_blank" href="index2.php" data-direction="reverse" style="width:100%;height:10px;margin:0px auto 0px auto;color:#666666">主页</a>
				</td>
				<td width="25%">					
					<a class="ui-btn ui-icon-navigation ui-btn-icon-top" data-transition="slide" target="_blank" href="hotelsel.php?chidno=<?php echo $_SESSION["main_selhotelcode"];?>&chsel=<?php echo $_SESSION["main_defhotelsel"];?>" data-direction="reverse" style="width:100%;height:10px;margin:0px auto 0px auto;color:#666666">酒店预订</a>
				</td>
				<td width="25%">
					<a class="ui-btn ui-icon-bullets ui-btn-icon-top" data-transition="slide" target="_blank" href="orderlist.php" style="width:100%;height:10px;margin:0px auto 0px auto;color:#666666">我的订单</a>
				</td>
				<td width="25%">
					<a class="ui-btn ui-icon-tag ui-btn-icon-top" data-transition="slide" target="_blank" href="roomlist.php" style="width:100%;height:10px;margin:0px auto 0px auto;color:#666666">我的住房</a>
				</td>
			</tr>
		</table>						
	</footer>
</section>

</body>
	
</html>