<!--#include file="inc/config.asp"-->
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/route_func.asp"-->
<%
const recpage=8
dim id,ctitle,key
if(request.QueryString("id")<>"") then
	id=Clng(request.QueryString("id"))
else
	id=0
end if
key=request.QueryString("key")
if(key<>"") then
	key=replace(key,"'","")
	key=replace(key,"0x","")
end if
if not isempty(request.QueryString("page")) then 
currentpage=Clng(trim(request.QueryString("page")))
else currentpage=1
end if
Title="酒店搜索"
%>
<!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%>-<%=SiteName%></title>
<meta name="description" content="description" />
<meta name="keywords" content="keywords" />
<link href="style/global.css" rel="stylesheet" type="text/css" />
<link href="style/show.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/marquee.js"></script>
<script language="javascript">
function goto(frm)
{
	var gourl ="?id=<%=id%>&key=<%=key%>&";
	gourl += "page=" + (frm.page.value);
     var hid=parseInt(frm.hid.value);
	 if(parseInt(frm.page.value)>hid||frm.page.value<=0){
	 alert("错误！请确定你输入的数字在1-"+hid+"之间");
	 return false;
	 }
	window.location.href(gourl);
}</script>
<style type="text/css">
<!--
.STYLE22 {color: #9900FF}
-->
</style>
</head>

<body>
<!--#include file="templet/head.htm"-->
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td class="postion">现在位置：<a href="/">首页</a> -&gt; <a href="hotel.asp">旅游酒店</a> -&gt;<%=Title%></td>
  </tr>
</table>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="228" valign="top">
    	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="border_yellow">
      <tr>
        <td width="88%" class="topic">酒店分类</td>
      </tr>
      <tr>
        <td bgcolor="#FFFFFF" class="pad5">
        <div class="routes_txt">
        	<ul>
						<%
            set rs=conn.execute("select id,title from t_hotel_catalog")
            while not rs.eof
            %>
            <li><a href="hotel.asp?id=<%=rs(0)%>"><%=rs(1)%></a></li>
            <%
              rs.movenext
            wend 
            rs.close
            set rs=nothing
            %>
          </ul>
          </div>
        </td>
      </tr>
    </table>
      <div class="br"></div>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="7"><img src="images/topic_l.gif" width="7" height="32" /></td>
          <td width="213" background="images/topic2_bg.gif"><div class="right"><a href="/routes.asp"><img src="images/more.gif" width="49" height="13" border="0" /></a></div>
            <div class="bar_text3">热门线路</div></td>
          <td width="7"><img src="images/topic_r.gif" width="7" height="32" /></td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td style="border-left:1px solid #B8D5E3; border-right:1px solid #B8D5E3;"><div class="routes_txt">
            <ul>
              <%
							set rs=conn.execute("select top 6 id,Title,Price,Hits from t_route where IsRem=1")
							while not rs.eof
							%>
              <li><a href="/routes_show.asp?id=<%=rs(0)%>" class="STYLE20"><%=rs(1)%></a><span class="STYLE1"> ￥<%=rs(2)%>元/人</span></li>
              <%
								rs.movenext
							wend 
							rs.close
							set rs=nothing
							%>
            </ul>
          </div></td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="7"><img src="images/b_l.gif" width="7" height="6" /></td>
          <td background="images/b_bg.gif"></td>
          <td width="7"><img src="images/b_r.gif" width="7" height="6" /></td>
        </tr>
      </table>
      <div class="br"></div>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="7"><img src="images/topic_l.gif" width="7" height="32" /></td>
          <td width="213" background="images/topic2_bg.gif"><div class="right"><a href="/hotel.asp"><img src="images/more.gif" width="49" height="13" border="0" /></a></div>
            <div class="bar_text3">推荐酒店</div></td>
          <td width="7"><img src="images/topic_r.gif" width="7" height="32" /></td>
        </tr>
        <tr>
          <td colspan="3" style="border-left:1px solid #B8D5E3; border-right:1px solid #B8D5E3;"><div class="routes_txt">
            <ul>
              <%
							set rs=conn.execute("select top 6 id,Title,MinPrice from t_hotel where IsRem=1")
							while not rs.eof
							%>
              <li><a href="/hotel_show.asp?id=<%=rs(0)%>" class="STYLE20"><%=rs(1)%></a><span class="STYLE1"> ￥<%=rs(2)%>元</span></li>
              <%
								rs.movenext
							wend 
							rs.close
							set rs=nothing
							%>
            </ul>
          </div></td>
        </tr>
        <tr>
          <td width="7"><img src="images/b_l.gif" width="7" height="6" /></td>
          <td background="images/b_bg.gif"></td>
          <td width="7"><img src="images/b_r.gif" width="7" height="6" /></td>
        </tr>
    </table></td>
    <td width="10">&nbsp;</td>
    <td valign="top" class="show_brd">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td class="show_topic"><div class="show_txt">酒店搜索</div></td>
        </tr>
      </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="35" align="center" background="image/s_bj.gif"><form id="form2" name="form2" method="get" action="hotel_search.asp">
酒店名称：
<input name="key" type="text" id="key" value="<%=key%>" />
<input type="submit" name="button2" id="button2" value="搜索酒店" />
<span class="STYLE4">您还可以输入“张家界、武陵源、凤凰古城”来查找您需要的酒店</span>
</form></td>
</tr>
</table>
<%
					sql="select count(*) from t_hotel where 1=1"
					if(id>0) then
						sql=sql&" and ClassId="&id
					end if
					if(key<>"") then
						sql=sql&" and Title like '%"&key&"%'"
					end if
					set rs=server.createobject("adodb.recordset")
					rs.open sql,conn,3,1
					allrec=rs(0)
					totalpage=int((allrec+recpage-1)/recpage)
					rs.close
					set rs=nothing
					set rs=server.createobject("adodb.recordset")
					sql="select top "&recpage&" id,Title,Photo,MinPrice,MaxPrice,Stars,JianJie,Zbjd,Address from t_hotel where id <=(select min(id) from (select top "&(recpage*(currentpage-1)+1)&" id from t_hotel where 1=1"
					if(id>0) then
						sql=sql&" and ClassId="&id
					end if
					if(key<>"") then
						sql=sql&" and Title like '%"&key&"%'"
					end if
					sql=sql&" order by id desc) as t)"
					if(id>0) then
						sql=sql&" and ClassId="&id
					end if
					if(key<>"") then
						sql=sql&" and Title like '%"&key&"%'"
					end if
					sql=sql&" order by id desc "
					rs.open sql,conn,3,1		
					while not rs.eof
					%>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="26%"><div class="img_brd"><a href="hotel_show.asp?id=<%=rs(0)%>"><img src="<%=rs(2)%>" alt=" " width="170" height="118" border="0" /></a></div></td>
<td width="2%" valign="top">　</td>
<td width="72%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="26" colspan="2"><a href="hotel_show.asp?id=<%=rs(0)%>"><span class="hotel_title"><%=rs(1)%></span></a> <img src="/images/star<%=rs(5)%>.gif" alt=" " /></td>
</tr>
<tr>
<td height="4" colspan="2"></td>
</tr>
<tr>
<td width="16%">酒店简介：</td>
<td width="84%" class="hotel_desc"><%=left(rs(6),150)%></td>
</tr>
<tr>
<td height="22">酒店地址：</td>
<td><%=rs(8)%></td>
</tr>
<tr>
<td height="22">周围景观：</td>
<td><%=rs(7)%></td>
</tr>
</table></td>
</tr>
</table>
<div class="br STYLE2">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5" background="image/bj_xt.gif"></td>
</tr>
</table>
</div>
<%
						rs.movenext
					wend 
					rs.close
					set rs=nothing
					%>          
</div>
        
<div align="center">
<form name="form1" method="post" action="" style="margin:0 0 0 0">
<%
        dim n,p
        n=currentpage+1
        p=currentpage-1
        if p>0then
        response.write("["&"<a href='?id="&id&"&page="&cstr(p)&"'>上一页</a>]&nbsp;&nbsp;&nbsp;")
        else response.write("上一页&nbsp;&nbsp;&nbsp;")
        end if 
        if (n-1)*recpage>=allrec then 
        response.write("下一页" )
        else
        response.Write("["&"<a href='?id="&id&"&page="&cstr(n)&"'>下一页</a>]")
        end if
        response.write("&nbsp;共"&allrec&"条&nbsp;")
        response.Write("&nbsp;共"&totalpage&"页&nbsp;")
        response.Write("&nbsp;第"&currentpage&"页&nbsp;")
        %>
<input type="hidden" name="hid" value="<%=totalpage%>">
&nbsp;&nbsp;跳至
<input name="page" type="text" size="5" onChange="goto(this.form)" style="border:1px solid #000000;height:14px ">
页
<input type="button" name="Button22" value="Go->" style="font-size:12px ;border:1px solid #000000;height:18px ">
</form>
</div>
</td>
  </tr>
</table>
<!--#include file="templet/root.htm"-->
</body>
</html>
<%
conn.execute("update t_hotel set Hits=Hits+1 where id="&id)
call connclose()
%>