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

📄 search.asp

📁 asp酒店房间预约系统设计+论文 本酒店房间预约系统按照用户部分和管理员部分划分了两块
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="hotel.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>房间查询</title>
<style type="text/css">
<!--
@import url("style.css");
-->
</style>
</head>
<%
set_room=request.Form("set_room")
set_cost=request.Form("set_cost")
%>

<body>

<div align="center">
  <table width="706" height="281" border="0" class="table_big"> 
    <tr>
      <td valign="top"><div align="center">   
	  <!--#include file="include/head.asp" -->
	  <br>
          <form name="form1" method="post" action="">
            <table width="533" border="0" class="table_small">
              <tr>
                <td colspan="2">&nbsp;</td>
              </tr>
              <tr>
                <td colspan="2" class="text_title"><div align="left">请给出查询条件:</div></td>
              </tr>
              <tr>
                <td colspan="2" class="table_title">&nbsp;</td>
              </tr>
              <tr>
                <td colspan="2" class="text"><div align="left">
                  <p>查看所有费用上限
                    <select name="set_cost" class="select_filed2" id="set_cost">
                      <option selected>不作要求</option>
                      <option>50元</option>
                      <option>200元</option>
                      <option>400元</option>
                      <option>600元</option>
                      <option>600元以上</option>
                    </select>
                    <select name="set_room" class="select_filed2" id="set_room">
                        <option selected>所有</option>
                    <option >总统套房</option>
                    <option>观光二人间</option>
                    <option>标准间</option>
                    <option>普通二人间</option>
                    <option>单人间</option>
                    <option>普通四人间</option>
                    <option>其他</option>
                    </select>
                    房间</p>
                  </div></td>
              </tr>
              <tr>
                <td width="341" class="text">&nbsp;</td>
                <td width="121" class="text"><div align="center">
                  <input name="search" type="submit" class="button_" id="search" value="查询">
                </div></td>
              </tr>
            </table>
          </form>
          <%
		  	if set_room="" and set_cost="" then 
				response.End()
			else
		  %>
		  <%
		  	set rs_search=server.CreateObject("adodb.recordset")
			sql = "select * from room "
			'如果输入查询条件,构造where结构-----------
			if not (set_cost = "不作要求" and set_room = "所有" )then
				sql = sql & "where "
			end if
			
			if set_room <> "所有" then
				sql = sql & "type = '" & set_room& "'"
			end if
			if set_cost <> "不作要求" and set_room <> "所有" then
				sql = sql & " and "
			end if 
			if set_cost = "50元" then 
				sql = sql & "cost <= 50"
			elseif set_cost = "200元" then 
				sql = sql & "cost <= 200"
			elseif set_cost = "400元" then
				sql = sql & "cost <=400" 
			elseif set_cost = "600元" then
				sql = sql & "cost <= 600" 
			elseif set_cost = "600元以上" then
				sql = sql & "cost > 600"
			end if
			'调试时加入的语句用来查看生成的sql命令---------------
			'response.Write(sql)
			'打开房间数据库---------------
			rs_search.open sql,hotel_conn,3,2
			if rs_search.eof or rs_search.bof then 
				searchok=0
			else 
				searchok=1
			end if
		  %>
		  <table width="533" border="0" class="table_small">
            <tr>
              <td colspan="4">&nbsp;</td>
            </tr>
            <tr>
              <td colspan="4" class="text_title"><div align="left">查询结果:
			  <%
			  	if searchok=1 then
					response.Write("查看所有开放于"& set_time &"的"& set_room &"房间,费用上限"& set_cost)
				end if
			  %>
			  </div></td>
            </tr>
            <tr>
              <td colspan="4" class="table_title">&nbsp;</td>
            </tr>
			<% If searchok=0 Then %>
            <tr>
              <td colspan="4" class="text_error"><div align="left">●没有找到符合要求的房间</div></td>			  
            </tr>
			<% Else %>
            <tr class="text_title">
              <td width="145"><div align="left">房间名称</div></td>
              <td width="112"><div align="left">房间类型</a></div></td>
              <td width="136"><div align="left">费用(元/小时)</div></td>
              <td width="118"><div align="left">使用时间</div></td>
            </tr>
			<%
				rs_search.movefirst
				while (not rs_search.eof)
			%>
            <tr class="text">
				<% urltext="preengage.asp?room_id="& rs_search("room_id") %>
              <td><div align="left"><a href="<%= urltext %>"><%= rs_search("name") %></a></div></td>
              <td><div align="left"><%= rs_search("type") %></div></td>
              <td><div align="left"><%= rs_search("cost") %></div></td>
              <td><div align="left">24小时</div></td>
            </tr>
			<%
				rs_search.movenext
				Wend
			%>
			<tr>
			  <td colspan="4" class="text">&nbsp;</td>
		    </tr>
			<tr>
              <td colspan="4" class="text"><div align="left">●点击房间名称可以直接预约该房间<br>
              </div></td>
            </tr>
			<% End If %>
            <tr>
              <td colspan="4">&nbsp;</td>
            </tr>
          </table>
		  <br>
		  <!--#include file="include/foot.asp" -->
		  <br>
      </div></td>
    </tr>
  </table>
</div>
<% End If %>
</body>
</html>

⌨️ 快捷键说明

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