| |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
<%set rs=server.createobject("adodb.recordset")
'分页代码
sql="select * from product"
rs.open sql,conn,3,1
dim recordNum,totalpage,page,maxperpage
recordNum=rs.recordcount '数据总数
maxperpage=1
rs.pagesize=maxperpage '每页显示的记录
totalpage=rs.PageCount '总页数
if request.querystring("page")="" then
page=1
else
page=cint(request.querystring("page"))
end if
if not rs.eof then
rs.AbsolutePage=page
end if
if rs.eof then
response.write "没有找到任何记录!"
else
'开始显示记录
for i=1 to rs.pagesize
%>
| |
| |
"> " width="400" height="300" /> |
" width="132" height="99" onMouseOver="changeone<%=rs("id")%>();" onMouseOut="changeone<%=rs("id")%>();"/> |
|
<%if rs("imagepath1")<>"" then%>
" width="132" height="99" border="0" onMouseOver="changetwo<%=rs("id")%>();" onMouseOut="changeone<%=rs("id")%>();"/> |
|
<%end if%>
<%if rs("imagepath2")<>"" then%>
" width="132" height="99" onMouseOver="changethree<%=rs("id")%>();" onMouseOut="changeone<%=rs("id")%>();"/> |
|
<%end if%>
|
|
|
| |
| |
| |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
<%
rs.movenext
if rs.eof then exit for
next
end if
%>
<%dim xianshi,kaishi
if page<=5 then
kaishi=1
if totalpage<=8 then
xianshi=totalpage
else
xianshi=kaishi+8
end if
elseif page>=totalpage-4 then
if totalpage<=8 then
kaishi=1
xianshi=totalpage
else
kaishi=totalpage-8
xianshi=kaishi+8
end if
else
kaishi=page-4
if totalpage<=8 then
xianshi=totalpage
else
xianshi=kaishi+8
end if
end if
%>
<%if page <> 1 then%>
<%else%>
<%end if%>
<%
for yeshu=kaishi to xianshi
if yeshu <> page then%>
<%=yeshu%>
<%else%><%=yeshu%> <%end if
next%>
<%if page <> totalpage then%>
<%else%>
<%end if%>
|
| |
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
All products mentioned and shown within this website are the trademarks and / or registered trademarks of their respective companies
|
|
|