📄 emptyroom.php
字号:
<?
header("Pragma: no-cache");
require_once('include/connection.php');
include('include/admin_or_user.php');
include('include/monthdays.php');
?>
<?
header("Refresh:600");
$selectsql="select distinct room.room_number,room.room_state,room.room_person,roomlevel.room_level,roomlevel.room_prise from room,roomlevel where room.room_level=roomlevel.room_level and (room.room_state=-1 or room.room_state=0) order by roomlevel.room_level,room.room_number,room.room_person,roomlevel.room_prise asc";
$result=odbc_exec($conn,$selectsql);
$month=date("m");
$day=date("d");
?>
<!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>
<style type="text/css">
<!--
body {
margin-left: 36px;
margin-right: 36px;
}
.STYLE1 {color: #FF0000}
-->
</style>
<link href="css/hotel.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div align="center" class="greenclore">
<div align="left">空房查询</div>
</div>
<table width="100%" border="1">
<tr>
<td><div align="center">房间号</div></td>
<td><div align="center">房间星级</div></td>
<td><div align="center">房间价格</div></td>
<td><div align="center">可入住人数</div></td>
<td>
<div align="center">可入住天数</div></td></tr>
<? while (odbc_fetch_row($result)) {
?>
<tr>
<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"><span class="STYLE1">¥</span><? echo odbc_result($result,'room_prise')*odbc_result($result,'room_person');?> /天</div></td>
<td><div align="center"><? echo odbc_result($result,'room_person');?> 人 </div></td>
<td>
<div align="center">
<? if(odbc_result($result,'room_state')==-1) echo "长期";
else
{
$stimesql="select longintime from book where room_number like '%".odbc_result($result,'room_number')."%' and id=(select max(id) as mid from (select * from book where room_number like '%".odbc_result($result,'room_number')."%'))";
$stimeresult=odbc_exec($conn,$stimesql);
$statetime=odbc_result($stimeresult,'longintime');
$stimearray=explode("-",$statetime);
$m1=$stimearray[0];
$d1=$stimearray[1];
$logintime_to_days=countday($m1,$d1);
$nowtime_to_days=countday($month,$day);
$emptydays=$logintime_to_days-$nowtime_to_days;
if($emptydays==0)
$emptydays.=" (今天入住)";
else
$emptydays.=" 天";
echo $emptydays;
}
?>
</div></td>
</tr>
<? }?>
</table>
<p><a href="#" onclick="fun()"></a></p>
<script src="copyright.inc">
</script><strong></strong>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -