⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 room.php

📁 酒店管理系统
💻 PHP
字号:
<?
include('include/admin_or_user.php');
?>
<?
require_once('include/connection.php'); 

if(isset($_POST['s1']))
$selectsql="select distinct  room.room_number,room.room_person,roomlevel.room_level,roomlevel.room_prise,roomlevel.room_introduction,room_state from room,roomlevel where room.room_level=roomlevel.room_level and room.room_number like '%".$_POST['room_number']."%' and  room.room_level like '%".$_POST['xj']."%' and room.room_person like '%".$_POST['person']."%' and roomlevel.room_prise*room.room_person like '". $_POST['room_prise']."%' order by  room.room_number,roomlevel.room_level,room.room_person,roomlevel.room_prise ,room_state asc";

if(isset($_POST['selectall']))
$selectsql="select distinct    room.room_number,room.room_person,roomlevel.room_level,roomlevel.room_prise,roomlevel.room_introduction,room_state from room,roomlevel where room.room_level=roomlevel.room_level order by   room.room_number,roomlevel.room_level,room.room_person,roomlevel.room_prise ,room_state asc";


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="../css/hotel.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	margin-left: 36px;
	margin-right: 36px;
}
.STYLE1 {font-size: 12px}
.STYLE2 {color: #FF0000}
-->
</style>
<link href="css/hotel.css" rel="stylesheet" type="text/css" />
</head>

<body>

<form id="form1" name="form1" method="post" action="">
<span class="greenclore">房间信息</span> 
<table width="800" border="0">   
    <tr>
      <td width="119"><div align="left"><span class="STYLE4 STYLE1">房间号:
        
        
        
        
        <input name="room_number" type="text" id="room_number" size="9" maxlength="9" />
        
        
      </span> </div></td>
      <td width="105" class="STYLE4 STYLE1"> &nbsp;&nbsp; 星级:
        
          <label>
          <input name="xj" type="text" id="xj" size="2" maxlength="3" />
          </label>
          星级
      </td>
      <td width="143" class="STYLE4 STYLE1">房间价格:<span class="STYLE2">&yen;</span>
        <input name="room_prise" type="text" id="room_prise" size="6" maxlength="6" />
/天 </td>
      <td width="115" class="STYLE4 STYLE1"><div align="center">可入住人数:
          <input name="person" type="text" id="person" size="2" maxlength="3" />
      </div></td>
      <td width="287"><div align="right" class="STYLE4 STYLE1">
        <div align="center">
          <input name="s22" type="reset" id="s22" value="重置" />
          &nbsp;	
          <input name="s1" type="submit" id="s1" value="查询" />
          &nbsp;  
          <input name="selectall" type="submit" id="selectall" onclick="" value="查询所有"/>
        </div>
      </div></td>
    </tr>
  </table>
</form>
<? 
if(isset($_POST['s1']) or isset($_POST['selectall'])) { 
 $result=odbc_exec($conn,$selectsql);

?>

<table width="100%" border="1" cellpadding="0" cellspacing="1">
  <tr>
    <td width="6%"><div align="center">状态</div></td>
	<td width="6%"><div align="center">房间号</div></td>
    <td width="8%"><div align="center">房间星级</div></td>
	<td width="10%"><div align="center">可入住人数</div></td>
    <td width="15%"><div align="center">房间价格/天</div></td>
	
    <td width="56%"><div align="center">房间介绍</div></td>
  </tr>
  <? while(odbc_fetch_row($result)){?>
  <tr>
    <td><div align="center"><? switch(odbc_result($result,'room_state'))
	                           {case -1 : echo "空房";break;
								case 0 : echo "预定" ;break;
								case 1 : echo "入住" ;break;
								}
								
								?></div></td>
    <td><div align="center"><? echo odbc_result($result,'room_number');?></div></td>
    <td><div align="center"><? echo odbc_result($result,'room_level');?>星级</div></td>
	<td><div align="center"><? echo odbc_result($result,'room_person');?>人房</div></td>
    <td><div align="center"><span class="STYLE2">&yen;</span><? echo odbc_result($result,'room_prise')*odbc_result($result,'room_person');?>&nbsp;/天</div></td>
	
    <td>&nbsp;&nbsp;<? echo odbc_result($result,'room_introduction');?></td>
  </tr>
  <? }?>
</table>
<? } ?>
<br />
<p><a href="#" onclick="fun()"></a></p>
 <script src="copyright.inc">
</script>
</body>
</html>
<? odbc_close($conn);
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -