📄 showroom.php
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查看房间</title>
<style type="text/css">
<!--
.style1 {color: #993333}
body {
background-image: url(bg.gif);
}
.style3 {color: #FFFF00}
-->
</style>
</head>
<body>
<h1 align="center" class="style1 style1">房间信息列表</h1>
<form valign="middle" method="post" action="book.php">
<table border="1" cellpadding="0" cellspacing="0" width="100%" bordercolorlight="#416327" bordercolordark="#DEEBD6" height="13">
<tr bgcolor="#398A00">
<td width="8%" align="center"><span class="style3">预订</span></td>
<td width="8%" align="center"><span class="style3">客房号</span></td>
<td width="8%" align="center"><span class="style3">床位数</span></td>
<td width="7%" align="center"><span class="style3">空调</span></td>
<td width="7%" align="center"><span class="style3">电视</span></td>
<td width="11%" align="center"><span class="style3">价格(元/天)</span></td>
<td width="10%" align="center"><span class="style3">房间状态</span></td>
<td width="41%" align="center"><span class="style3">备注</span></td>
</tr>
<?
mysql_connect("222.20.57.135","root","");
$result = mysql_db_query("bs","select * from room order by roomno");
while($row = mysql_fetch_array($result)) {
echo "<tr valign=\"middle\" height=\"20\">";
if($row["state"]!=2)
echo "<td valign=\"middle\" align=\"center\" nowrap=\"nowrap\">"."<input type=\"checkbox\" name=".$row["roomno"]."></td>\n";
else echo "<td align=\"center\" nowrap=\"nowrap\"> </td>";
echo "<td align=\"center\" nowrap=\"nowrap\">".$row["roomno"]."</td>";
echo "<td align=\"center\" nowrap=\"nowrap\">".$row["bednum"]."</td>";
echo "<td align=\"center\" nowrap=\"nowrap\">";
if($row["aircondition"]==1)
echo "有空调";
else
echo "无";
echo "</td>";
echo "<td align=\"center\" nowrap=\"nowrap\">";
if($row["television"]==1)
echo "有电视";
else
echo "无";
echo "</td>";
echo "<td align=\"center\" nowrap=\"nowrap\">".$row["price"]."</td>";
echo "<td align=\"center\" nowrap=\"nowrap\">";
switch($row["state"])
{
case 1:echo "<font color=\"33ff66\" ><strong>空房可用</strong></font>";break;
case 2:echo "<font color=\"red\" >空房待修</font>";break;
case 3:echo "预订占用";break;
case 4:echo "正在占用";break;
}
echo "</td>";
echo "<td align=\"center\" nowrap=\"nowrap\"> ".$row["discription"]."</td>";
}
mysql_free_result($result);
?>
</table>
<div align="center">
<p> </p>
<table height="13" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#416327" bordercolordark="#DEEBD6" >
<tr>
<td colspan="2"><div align="center">请选择要预订的房间,填写下面的表格,然后点“提交”按钮</div></td>
</tr>
<tr>
<td width="166"><div align="center"></div></td>
<td width="328"><div align="center"></div></td>
</tr>
<tr>
<td height="23"><div align="center">姓名:</div></td>
<td>
<div align="left">
<input name="name" type="text" id="name" size="12" maxlength="8">
</div></td>
</tr>
<tr>
<td height="23"><div align="center">身份证号:</div></td>
<td><div align="left">
<input name="idcard" type="text" id="idcard" size="20" maxlength="18">
</div></td>
</tr>
<tr>
<td height="24"><div align="center">入住开始时间:</div></td>
<td>
<div align="left">
<input name="from" type="text" id="from" size="12" maxlength="10">
(时间格式:1949-10-01)
</div></td>
</tr>
<tr>
<td height="23"><div align="center">入住截止时间:</div></td>
<td><div align="left">
<input name="to" type="text" id="to" size="12" maxlength="10">
</div></td>
</tr>
<tr>
<td height="23"><div align="center">入住人数:</div></td>
<td><div align="left">
<input name="guestnum" type="text" id="guestnum" size="12" maxlength="3">
</div></td>
</tr>
<tr>
<td><div align="center"></div></td>
<td><div align="center"></div></td>
</tr>
</table>
<p>
<input type="submit" value="提 交">
</p>
<p>注:被占用的房间在<strong>入住时间不冲突</strong>的情况下也可以预订<br>
如果预订成功,请于
<?php
mysql_connect("222.20.57.135",root,"");
$result=mysql_db_query("bs","select bookLimit from config");
$row=mysql_fetch_array($result);
echo $row["bookLimit"];
mysql_free_result($result);
?>
小时内到本旅馆办理入住登记手续,否则预订被撤销<br>
本旅馆地址:......</p>
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -