📄 roomined.php
字号:
<?
require_once('include/connection.php');
include('include/admin_or_user.php');
require_once('include/sqlfuns.php');
?>
<?
$month=date("m");
if(isset($_POST['s1']))
{
$selectsql = sprintf("select * from coustom where room_number like %s and name like %s and in_time like %s and days like %s and person like %s order by in_time",
GetSQLValueString("%".str_replace("#", "_",$_POST['room_number'])."%", "text"),
GetSQLValueString("%".$_POST['name']."%", "text"),
GetSQLValueString("%".$_POST['bookmonth']."-".$_POST['bookday']."%", "text"),
GetSQLValueString("%".$_POST['day']."%", "text"),
GetSQLValueString("%".$_POST['person']."%", "text"));
$result=odbc_exec($conn,$selectsql);
}
if(isset($_POST['sellectall']))
{
$selectsql = sprintf("select * from coustom order by in_time");
$result=odbc_exec($conn,$selectsql);
}
?>
<!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">
<!--
.STYLE1 {color: #FF0000}
body {
margin-left: 36px;
margin-right: 36px;
}
.STYLE3 {font-size: 12px}
-->
</style>
<link href="css/hotel.css" rel="stylesheet" type="text/css" />
</head>
<body>
<? if(!isset($_POST['s1'])&&!isset($_GET['id'])&&!isset($_POST['sellectall']))
{ ?>
<form id="form1" name="form1" method="post" action="roomined.php">
<div align="left"><span class="greenclore">入住房查询</span></div>
<table width="890" border="0">
<tr>
<td width="196"><span class="STYLE3">入住日期:
<select name="bookmonth" id="bookmonth">
<option value="">请选择</option>
<option value="<? echo $month-1;?>"><? echo ($month-1)."月";?></option>
<option value="<? echo $month;?>"><? echo ($month*1)."月";?></option>
</select>
<label>
<select name="bookday" id="select2">
<option value="">请选择</option>
<? $i=1;
while($i<=31)
{
if($i<10)
echo "<option value='0".$i."'>".$i."日</option>";
else
echo "<option value='".$i."'>".$i."日</option>";
$i++;
}
?>
</select>
</label>
</span></td>
<td width="112"><span class="STYLE3">房间号:
<input name="room_number" type="text" id="room_number" size="8" maxlength="13" />
</span></td>
<td width="139"><span class="STYLE3">客人称谓:
<input name="name" type="text" id="name" size="10" maxlength="20" />
</span></td>
<td width="110"><span class="STYLE3">入住天数:
<input name="day" type="text" id="day" size="3" />
天 </span></td>
<td width="90"><span class="STYLE3">人数:
<input name="person" type="text" id="person" size="3" />
人
</span></td>
<td width="180"><div align="right"><span class="STYLE3">
<input name="s22" type="reset" id="s22" value="重置" />
<input name="s1" type="submit" id="s1" value="查询" />
<input name="sellectall" type="submit" id="sellectall" onclick="" value="查询所有"/>
</span></div></td>
</tr>
</table>
<p> </p>
</form>
<p>
<? } ?>
</p>
<? if(isset($_POST['s1'])||isset($_POST['sellectall']))
{
?>
<form id="form1" name="form1" method="post" action="">
<div align="left"><span class="greenclore">入住房查询</span></div>
<table width="890" border="0">
<tr>
<td width="196"><span class="STYLE3">入住日期:
<select name="bookmonth" id="bookmonth">
<option value="">请选择</option>
<option value="<? echo $month-1;?>"><? echo ($month-1)."月";?></option>
<option value="<? echo $month;?>"><? echo ($month*1)."月";?></option>
</select>
<label>
<select name="bookday" id="select2">
<option value="">请选择</option>
<? $i=1;
while($i<=31)
{
if($i<10)
echo "<option value='0".$i."'>".$i."日</option>";
else
echo "<option value='".$i."'>".$i."日</option>";
$i++;
}
?>
</select>
</label>
</span></td>
<td width="112"><span class="STYLE3">房间号:
<input name="room_number" type="text" id="room_number" size="8" maxlength="13" />
</span></td>
<td width="139"><span class="STYLE3">客人称谓:
<input name="name" type="text" id="name" size="10" maxlength="20" />
</span></td>
<td width="110"><span class="STYLE3">入住天数:
<input name="day" type="text" id="day" size="3" />
天 </span></td>
<td width="90"><span class="STYLE3">人数:
<input name="person" type="text" id="person" size="3" />
人
</span></td>
<td width="180"><div align="right"><span class="STYLE3">
<input name="s22" type="reset" id="s22" value="重置" />
<input name="s1" type="submit" id="s1" value="查询" />
<input name="sellectall" type="submit" id="sellectall" onclick="" value="查询所有"/>
</span></div></td>
</tr>
</table>
<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>
<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>
<td><div align="center">操作</div></td>
</tr>
<?
$i=0;
while(odbc_fetch_row($result))
{ $i++;?>
<tr>
<td><div align="center"><? echo $i;?></div></td>
<td> <? echo odbc_result($result,'name');?></td>
<td> <? echo odbc_result($result,'room_number');?></td>
<td> <? echo odbc_result($result,'in_time');?></td>
<td><div align="center"><? echo odbc_result($result,'days');?></div></td>
<td><div align="center"><? echo odbc_result($result,'person');?></div></td>
<td><div align="center"><span class="STYLE1">¥</span><? echo odbc_result($result,'paiedmoney');?></div></td>
<td><div align="center"><span class="STYLE1">¥</span><? echo odbc_result($result,'dieing_prise');?></div></td>
<td><div align="center"><span class="STYLE1">¥</span><? echo odbc_result($result,'other_prise');?></div></td>
<td><div align="center"><a href="?room_number=<? echo base64_encode(odbc_result($result,'room_number'));?>">修改</a></div></td>
<td><div align="center"><a href="charge.php?room_number=<? echo base64_encode(odbc_result($result,'room_number'));?>">结帐</a></div></td>
</tr>
<? } if($i==0)
echo "
<tr>
<td colspan='11'>
<p align='center' class='STYLE1'>暂无记录</p>
</td>
</tr>";
?>
</table>
</form>
<p align="center"><a href="roomined.php">返回</a></p>
<p>
<? }?>
</p>
<? if(isset($_GET['room_number']))
{
$room_number=base64_decode($_GET['room_number']);
$selectsql = "select * from coustom where room_number='".$room_number."'";
$rs=odbc_exec($conn,$selectsql);
?>
<script>
function fun3()
{ div9.innerHTML="<div align='center'><iframe id='room' src='mbook1.php' frameborder='0' scrolling='auto' width='587' height='533'></iframe></div>";
}
</script>
<form id="form2" name="form2" method="post" action="modefiy_roomin.php">
<table width="100%" border="0">
<tr>
<td valign="top" width="43%"><table width="100%" border="1" align="center">
<tr>
<td>客人称谓:</td>
<td> <? echo odbc_result($rs,'name');?></td>
</tr>
<tr>
<td>房间号:</td>
<td><label>
<input name="room_number" type="text" id="room_number" size="9" maxlength="10" value="<? echo odbc_result($rs,'room_number');?>" />
<input name="s1" type="button" id="s1" value="更改房间" onclick="fun3()"/>
</label></td>
</tr>
<tr>
<td>人 数:</td>
<td><label>
<input name="person" type="text" id="person" size="2" maxlength="3" value="<? echo odbc_result($rs,'person');?>"/>
人
</label></td>
</tr>
<tr>
<td>入住天数:</td>
<td><label>
<input name="days" type="text" id="days" size="2" maxlength="3" value="<? echo odbc_result($rs,'days');?>"/>
天</label></td>
</tr>
<tr>
<td>饮食消费:</td>
<td><label>
<span class="STYLE1">¥</span>
<input name="dieing_prise" type="text" id="dieing_prise" size="6" maxlength="9" value="<? echo odbc_result($rs,'dieing_prise');?>"/>
</label></td>
</tr>
<tr>
<td>其他费用:</td>
<td><label>
<span class="STYLE1">¥</span>
<input name="other_prise" type="text" id="other_prise" size="6" maxlength="10" value="<? echo odbc_result($rs,'other_prise');?>"/>
</label></td>
</tr>
<tr>
<td>已付讨金:</td>
<td><label>
<span class="STYLE1">¥</span>
<input name="paied_money" type="text" id="paied_money" size="4" maxlength="6" value="<? echo odbc_result($rs,'paiedmoney');?>" />
</label></td>
</tr>
</table>
<p align="center">
<label>
<input name="s2" type="submit" id="s2" value="提交" />
</label>
<label>
<input type="reset" name="Submit" value="重置" />
</label>
</p>
<p align="center"><a href="roomined.php" onclick='window.history.back();'>返回</a>
<input name="old_roomnumber" type="hidden" id="old_roomnumber" value="<? echo odbc_result($rs,'room_number');?>" />
</p>
</td>
<td> <div id="div9" align="left" >
</div></td>
</tr>
</table>
<p align="center"> </p>
</form>
<? } ?>
<p><a href="#" onclick="fun()"></a></p>
<script src="copyright.inc">
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -