| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 350 人关注过本帖
标题:请教分页问题
只看楼主 加入收藏
swalia
Rank: 1
等 级:新手上路
帖 子:108
专家分:0
注 册:2006-4-16
收藏
 问题点数:0 回复次数:1 
请教分页问题

<!--#include file="Inc/head.asp"-->
<!--#include file="Inc/syscode.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
session("DepDate")=request("deptime")
session("StartDate")=request("starttime")
DepDate=session("DepDate")
StartDate=session("StartDate")
time1=cdate(session("StartDate"))
time2=cdate(session("DepDate"))
days=time2-time1
shucity=request.form("city")
Session("csort_name")=request.form("city")
hotelname=request.form("h_hotelname")
jiage=request.form("jiage")
set rshotel=server.createobject("adodb.recordset")
if request.form("en")<>1 then
sqltext="select top 12 * from hotelb where 市 like '%"&shucity&"%' and 宾馆 like '%"&hotelname&"%'"
else
sqltext="select top 12 * from hotelb where 市 like '%"&shucity&"%' and 英文名 like '%"&hotelname&"%'"
end if
if star="all" then
else
sqltext=sqltext &"and ( "
if request.form("star0")=0 then
sqltext=sqltext &" 星级='无标准' or"
end if
if request.form("star1")=1 then
sqltext=sqltext &" 星级='一星级' or 星级='准一星级' or"
end if
if request.form("star2")=2 then
sqltext=sqltext &" 星级='二星级' or 星级='准二星级' or"
end if
if request.form("star3")=3 then
sqltext=sqltext &" 星级='三星级' or 星级='准三星级' or"
end if
if request.form("star4")=4 then
sqltext=sqltext &" 星级='四星级' or 星级='准四星级' or"
end if
if request.form("star5")=5 then
sqltext=sqltext &" 星级='五星级' or 星级='准五星级' or"
end if
sqltext=sqltext & " 星级='其他')"
end if

sqltext=sqltext & "order by id desc"
rshotel.open sqltext,conn,1,1
%>

<link href="CSS/style.css" type="text/css" rel="stylesheet">
<BODY leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<SCRIPT language=javascript src="js/calendar.js"></SCRIPT>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="609" height="26" background="IMG/ad_dh.jpg"><table width="609" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="39"><img src="IMG/ad_dh01.jpg" width="40" height="26"></td>
<td width="570" background="IMG/ad_dh05.jpg">您现在的位置:<a href="index.asp">灿鑫商旅网</a> &gt;&gt; 酒店预订</td>
</tr>
</table></td>
<td width="26" background="IMG/ad_dh02.jpg">&nbsp;</td>
<td width="125" align="center" background="IMG/ad_dh03.jpg"><a href="ad_dh.asp"><font color="#FFFFFF">活动快讯</font></a></td>
</tr>
</table></td>
</tr>
<tr>
<TD bgColor=#418BE0 height=1></TD>
<TD bgColor=#418BE0 height=1></TD>
</tr>
<tr>
<td width="200" valign="top" background="ImaGes/focat01.jpg">&nbsp;</td>
<td width="560" valign="top" background="IMG/up_05.jpg"><table width="547" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="8"></td>
</tr>
<tr>
<td height="30" background="ImaGes/hotel_go.jpg"><table width="546" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40">&nbsp;</td>
<td width="124"><span style="font-size: 18px; font-weight: bold; color: #0033FF;"><%=rshotel("市")%>&nbsp;酒店列表</span></td>
<td width="382">&nbsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td height="6"></td>
</tr>
<tr>
<td height="26" background="ImaGes/hotel_s.jpg"><table width="546" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="25">&nbsp;</td>
<td width="412">入住日期:<%=startdate%> 至 <%=depdate%> &nbsp;&nbsp;共 <font color=red><%=days%> </font>晚 </td>
<td width="109"><a href=# onClick="javascript:window.open('http://channel.mapbar.com/service/sub_commonmapright/?citycode=<%=rshotel("代码")%>&color=imgblue&title=test','','width=800,height=620,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"><%=rshotel("市")%>电子地图</a></td>
</tr>
</table></td>
</tr>
<tr>
<td width="547"><br>
   如果您想采用前台现付或网上支付方式预订某宾馆的房间,请单击查询结果表中该酒店的房型所在行中相应支付方式的房价后的“ 预订 ”字样。在预订客房之前,请阅读我们的 <a href=# onClick="javascript:window.open('/spern/Hotel.asp','','width=600,height=280,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"><font color="red">预订须知</font></a>。 </td>
</tr>
</table>
<table width="540" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<%
if rshotel.eof then
response.write "<script language=JavaScript>{window.alert('没有找到符合条件的宾馆信息,返回重新查找!');window.history.go(-1);}</script>"
response.end
end if
if not rshotel.eof then

do while not rshotel.eof

c_name=rshotel("宾馆")
set rsroom=server.createobject("adodb.recordset")
sql="select top 3 * from roomb where 宾馆='"&c_name&"'"
rsroom.open sql,conn,1,2

if not rsroom.eof then
%>
<table width="546" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="29" background="ImaGes/hotelHi01.jpg"><table width="536" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><a href="HotelRoomAl.asp?hotel=<%=rshotel("id")%>&hotel_name=<%=rshotel("宾馆")%>&StartDate=<%=StartDate%>&DepDate=<%=DepDate%>"><span style="font-size: 16px; font-weight: bold; color: #0000FF;"><%=rshotel("宾馆")%>&nbsp;<%=rshotel("英文名")%></span></a><a href="HotelRoomAl.asp?hotel=1&hotel_name=&#21335;&#27915;&#38271;&#32988;&#22823;&#37202;&#24215;&StartDate=2006-9-24&DepDate=2006-9-25"></a>&nbsp;&nbsp;
<%if rshotel("星级")="无标准" then
response.write "无标准"
elseif rshotel("星级")="一星级" then
response.write "<img src=img/1x.gif>"
elseif rshotel("星级")="准一星级" then
response.write "<img src=img/1x.gif>"
response.write"<img src=img/zhun.gif>"
elseif rshotel("星级")="二星级" then
response.write "<img src=img/2x.gif>"
elseif rshotel("星级")="准二星级" then
response.write "<img src=img/2x.gif>"
response.write"<img src=img/zhun.gif>"
elseif rshotel("星级")="三星级" then
response.write "<img src=img/3x.gif>"
elseif rshotel("星级")="准三星级" then
response.write "<img src=img/3x.gif>"
response.write"<img src=img/zhun.gif>"
elseif rshotel("星级")="四星级" then
response.write "<img src=img/4x.gif>"
elseif rshotel("星级")="准四星级" then
response.write "<img src=img/4x.gif>"
response.write"<img src=img/zhun.gif>"
elseif rshotel("星级")="五星级" then
response.write "<img src=img/5x.gif>"
elseif rshotel("星级")="准五星级" then
response.write "<img src=img/5x.gif>"
response.write"<img src=img/zhun.gif>"
end if
%></td>
</tr>
</table></td>
</tr>
<tr>
<td background="ImaGes/hotelHi02.jpg"><table width="540" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="77" height="25" align="center"><a href="hotelpin.asp?hotelid=<%=rshotel("宾馆")%>" target="_blank">用户评论</a></td>
<td width="291">&nbsp;&nbsp;酒店地址:<font color="#FF0000"><%=rshotel("酒店地址")%></font> </td>
<td width="172">电话:<font color="#FF0000"><%=rshotel("前台总机")%></font></td>
</tr>
<tr>
<td align="center"><a href="HotelRoomAl.asp?hotel=<%=rshotel("id")%>&hotel_name=<%=rshotel("宾馆")%>&StartDate=<%=StartDate%>&DepDate=<%=DepDate%>"><img src="<%=rshotel("图片地址1")%>" width="65" height="65" border="0" align="absmiddle"></a></td>
<td colspan="2" valign="top"><%
intro=rshotel("酒店介绍")
if len(intro)>188 then intro=left(intro,188)&"……"
intro=replace(intro,"<p>","")
response.write intro%></td>
</tr>
</table></td>
</tr>
<tr>
<td background="ImaGes/hotelHi02.jpg"><table width="538" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
<tr bgcolor="#87cefa">
<td width="25" height="22">&nbsp;</td>
<td colspan="2">&nbsp;房型</td>
<td>&nbsp;门市价</td>
<td align="center">早餐</td>
<td colspan="2">&nbsp;前台现付价</td>
<td width="77" align="center">备注</td>
</tr>
<%if not rsroom.eof then
do while not rsroom.eof%>
<tr bgcolor="e3e3e3">
<td height="22" align="center"><%if rshotel("酒店备注")<>""then%>
<a href=# onClick="javascript:window.open('Hotelinfo.asp?id=<%=rshotel("id")%>','','width=300,height=180,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"><img src="IMG/gift.gif" width="15" height="16" border="0"></a>
<%end if%></td>
<td width="130" height="23"><%=rsroom("房型")%></td>
<td width="37"><%=rsroom("宽带")%></td>
<td width="82"><STRIKE>RMB&nbsp;<%=rsroom("门市价")%></STRIKE></td>
<td width="49" align="center"><%=rsroom("早餐")%></td>
<td width="76">
<%
roomt=rsroom("房型")
set rs=server.createobject("adodb.recordset")
sqltext="select * from 宾馆房型 where 日期 like '%"& StartDate &"%' and 宾馆='"&c_name&"'and '"&Roomt&"' like '%"&roomt&"%'"
rs.open sqltext,conn,1,1
%>
<table width="79" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>RMB <font color=red>
<%if roomt="特价房"then
response.write(rs("特价房"))
elseif roomt="普通房"then
response.write(rs("普通房"))
elseif roomt="普通单人房"then
response.write(rs("普通单人房"))
elseif roomt="普通双人房"then
response.write(rs("普通双人房"))
elseif roomt="标准房"then
response.write(rs("标准房"))
elseif roomt="标准单人房"then
response.write(rs("标准单人房"))
elseif roomt="标准双人房"then
response.write(rs("标准双人房"))
elseif roomt="标准大床房"then
response.write(rs("标准大床房"))
elseif roomt="高级房"then
response.write(rs("高级房"))
elseif roomt="高级大床房"then
response.write(rs("高级大床房"))
elseif roomt="高级单人房"then
response.write(rs("高级单人房"))
elseif roomt="高级双人房"then
response.write(rs("高级双人房"))
elseif roomt="豪华房"then
response.write(rs("豪华房"))
elseif roomt="豪华单人房"then
response.write(rs("豪华单人房"))
elseif roomt="豪华大床房"then
response.write(rs("豪华大床房"))
elseif roomt="豪华双人房"then
response.write(rs("豪华双人房"))
elseif roomt="商务房"then
response.write(rs("商务房"))
elseif roomt="商务大床房"then
response.write(rs("商务大床房"))
elseif roomt="商务双人房"then
response.write(rs("商务双人房"))
elseif roomt="商务单人房"then
response.write(rs("商务单人房"))
elseif roomt="行政房"then
response.write(rs("行政房"))
elseif roomt="江景房"then
response.write(rs("江景房"))
elseif roomt="城景房"then
response.write(rs("城景房"))
elseif roomt="豪华江景房"then
response.write(rs("豪华江景房"))
elseif roomt="豪华城景房"then
response.write(rs("豪华城景房"))
elseif roomt="高级江景房"then
response.write(rs("高级江景房"))
elseif roomt="高级城景房"then
response.write(rs("高级城景房"))
elseif roomt="特别行政房"then
response.write(rs("特别行政房"))
elseif roomt="迷你房"then
response.write(rs("迷你房"))
elseif roomt="套房"then
response.write(rs("套房"))
elseif roomt="标准套房"then
response.write(rs("标准套房"))
elseif roomt="普通套房"then
response.write(rs("普通套房"))
elseif roomt="高级套房"then
response.write(rs("高级套房"))
elseif roomt="豪华套房"then
response.write(rs("豪华套房"))
elseif roomt="行政套房"then
response.write(rs("行政套房"))
elseif roomt="商务套房"then
response.write(rs("商务套房"))
end if
%>
</font></td>
</tr>
</table></td>
<td width="42" align="center"> <a href="Roin.asp?hotel=<%=rshotel("ID")%>&hotel_name=<%=rshotel("宾馆")%>&room_name=<%=rsroom("房型")%>&StartDate=<%=StartDate%>&DepDate=<%=DepDate%>"><img src="ImaGes/cart_b.gif" width="35" height="19" border="0"></a> </td>
<td align="center"><%=rsroom("备注")%></td>
</tr>
<%
rsroom.movenext
loop
rsroom.close
end if%>
</table></td>
</tr>
<tr>
<td height="30" align="right" background="ImaGes/hotelHi03.jpg"><img src="ImaGes/arrow.gif" width="10" height="10"><a href=# onClick="javascript:window.open('HotelRoom.asp?hotel=<%=rshotel("id")%>&hotel_name=<%=rshotel("宾馆")%>&StartDate=<%=StartDate%>&DepDate=<%=DepDate%>','','width=700,height=380,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;">浏览该酒店<font color=red>所有房型</font>>>></a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
<tr>
<td height="15">&nbsp;</td>
</tr>
</table>
<%
end if
rshotel.movenext
loop
end if
rshotel.close
conn.close
%></td>
</tr>
</table>
<!--#include file="Inc/foot.asp"-->
这个页面要加分页怎么分呢?能不能有代码给我一个啊,谢谢!!!

2006-09-24 18:48
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
2006-09-25 09:20
快速回复:请教分页问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018417 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved