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

📄 searchbar.php

📁 SetCursor CWnd LoadCursor DestroyWindow CDialog GetClientRect C Button GetStockObject CFont GetWindo
💻 PHP
字号:
<? 
 require_once('include/connection.php'); 
 include('include/admin_or_user.php');
 require_once('include/sqlfuns.php');

 ?>
 <?
 if(isset($_POST['search'])) 
 $keyword=$_POST['search'];

 
  $sql1 = sprintf("select * from book where (name like %s or booktime like %s or room_number like %s or phone like %s) order by booktime",
	                   GetSQLValueString("%".$keyword."%", "text"),
                       GetSQLValueString("%".$keyword."%", "text"),
                      
					   GetSQLValueString("%".$keyword."%", "text"),
					   GetSQLValueString("%".$keyword."%", "text"));

  $result=odbc_exec($conn,$sql1);
  
   $sql2 = sprintf("select * from coustom where (name like %s or in_time like %s  or room_number like %s or paiedmoney*1.0=%s) order by in_time",
	                   GetSQLValueString("%".$keyword."%", "text"),
                       GetSQLValueString("%".$keyword."%", "text"),
                      
					   GetSQLValueString("%".$keyword."%", "text"),
					   GetSQLValueString($keyword, "double"));

  $result2=odbc_exec($conn,$sql2);	
  
  $sql3="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 '%".$keyword."%' or roomlevel.room_prise*room.room_person = ".GetSQLValueString($keyword, 'double').") order by  room.room_number,roomlevel.room_level,room.room_person,roomlevel.room_prise ,room_state asc";				   $result3=odbc_exec($conn,$sql3); 					   
 ?>

<!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}
.STYLE2 {color: #33CC00}

.STYLE3 {color: #669933}
-->
</style>
<link href="css/hotel.css" rel="stylesheet" type="text/css" />
</head>
<script>
function conform()
{
 if(!window.confirm("确认注销此预订房间?"))
return false;
else return true;
}
</script>

<body>
<? if(odbc_fetch_row($result,"1"))
  {
  ?>
  <span class="STYLE3">预订房</span>
<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>
  <? 
  odbc_fetch_row($result,"0");
  $i=0;
   while(odbc_fetch_row($result))
    { $i++; ?>
  <tr>
    <td><div align="center"><? echo odbc_result($result,'id');?></div></td>
    <td><div align="center"><? echo odbc_result($result,'name');?></div></td>
	<td><div align="center">&nbsp;<? echo odbc_result($result,'phone');?></div></td>
    <td>&nbsp;<? echo str_replace("@", "  ",odbc_result($result,'room_number'));?></td>
    <td>&nbsp;&nbsp;<? echo odbc_result($result,'booktime');?></td>
    <td><div align="center"><? echo odbc_result($result,'longintime');?></div></td>
    <td><div align="center"><? echo odbc_result($result,'bookdays');?></div></td>
    <td><div align="center"><? echo odbc_result($result,'person');?></div></td>
	<td><div align="center"><a href="bookin.php?id=<? echo odbc_result($result,'id');?>&name=<? echo base64_encode(odbc_result($result,'name'));?>&room=<? echo base64_encode(str_replace("@", "  ",odbc_result($result,'room_number')));?>&person=<? echo odbc_result($result,'person');?>&days=<? echo odbc_result($result,'bookdays');?>">登记</a></div></td>
	<td><div align="center"><a href="bookin.php?id=<? echo odbc_result($result,'id');?>&name=<? echo base64_encode(odbc_result($result,'name'));?>&room=<? echo base64_encode(str_replace("@", "  ",odbc_result($result,'room_number')));?>&person=<? echo odbc_result($result,'person');?>&days=<? echo odbc_result($result,'bookdays');?>&action=modefiy&phone=<? echo odbc_result($result,'phone');?> &in_time=<? echo odbc_result($result,'longintime');?>">修改</a></div></td>
		<td><div align="center"><a href="removebookroom.php?bookid=<? echo odbc_result($result,'id');?> &room=<? echo base64_encode(str_replace("@", "  ",odbc_result($result,'room_number')));?> " onclick="return conform()">注销</a></div></td>
  </tr>
 <? } if($i==0)
   echo "
   <tr>
     <td colspan='11'>
   <p align='center' class='STYLE1'>暂无记录</p>
   </td>
   </tr>";
   ?>
</table>
<? }?>

<? if(odbc_fetch_row($result2,"1"))
  {
  ?>
  <span class="STYLE3">入住房</span>
  <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>
  <? 
   odbc_fetch_row($result2,"0");
  $i=0;
  while(odbc_fetch_row($result2))
    {  $i++;?>
  <tr>
    <td><div align="center"><? echo $i;?></div></td>
    <td>&nbsp;&nbsp;<? echo odbc_result($result2,'name');?></td>
    <td>&nbsp;<? echo odbc_result($result2,'room_number');?></td>
    <td>&nbsp;&nbsp;<? echo odbc_result($result2,'in_time');?></td>
	  <td><div align="center"><? echo odbc_result($result2,'days');?></div></td>
   <td><div align="center"><? echo odbc_result($result2,'person');?></div></td>
   <td><div align="center"><span class="STYLE1">&yen;</span><? echo odbc_result($result2,'paiedmoney');?></div></td>
   <td><div align="center"><span class="STYLE1">&yen;</span><? echo odbc_result($result2,'dieing_prise');?></div></td>
   <td><div align="center"><span class="STYLE1">&yen;</span><? echo odbc_result($result2,'other_prise');?></div></td>
      <td><div align="center"><a href="roomined.php?room_number=<? echo base64_encode(odbc_result($result2,'room_number'));?>">修改</a></div></td>
	        <td><div align="center"><a href="charge.php?room_number=<? echo base64_encode(odbc_result($result2,'room_number'));?>">结帐</a></div></td>
  </tr>
  <? } if($i==0)
   echo "
   <tr>
     <td colspan='11'>
   <p align='center' class='STYLE1'>暂无记录</p>
   </td>
   </tr>";
   ?>
</table>
<? }?>

<? if(odbc_fetch_row($result3,"1"))
  {
  ?>
  <span class="STYLE3">房间信息</span>
<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>
  <? 
  odbc_fetch_row($result3,"0");
  while(odbc_fetch_row($result3))
  {?>
  <tr>
    <td><div align="center"><? switch(odbc_result($result3,'room_state'))
	                           {case -1 : echo "空房";break;
								case 0 : echo "预定" ;break;
								case 1 : echo "入住" ;break;
								}
								
								?></div></td>
    <td><div align="center"><? echo odbc_result($result3,'room_number');?></div></td>
    <td><div align="center"><? echo odbc_result($result3,'room_level');?>星级</div></td>
	<td><div align="center"><? echo odbc_result($result3,'room_person');?>人房</div></td>
    <td><div align="center"><span class="STYLE1">&yen;</span><? echo odbc_result($result3,'room_prise')*odbc_result($result3,'room_person');?>&nbsp;/天</div></td>
	
    <td>&nbsp;&nbsp;<? echo odbc_result($result3,'room_introduction');?></td>
  </tr>
  <? }?>
</table>
<? }?>
</body>
</html>
<? odbc_close($conn);?>

⌨️ 快捷键说明

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