%
dim scid,bcid
scid=trim(request("scid"))
bclassid=trim(request("bcid"))
if bclassid<>"" then
Set pro_b = Server.CreateObject("ADODB.Recordset")
sqlb="select BigClassName from BigClass where BigClassID="&bclassid
pro_b.open sqlb,conn,1,1
bclass=pro_b("BigClassName")
pro_b.close
set pro_b=nothing
else
bclass=""
end if
if scid<>"" then
Set pro_c = Server.CreateObject("ADODB.Recordset")
sql="select SmallClassName,BigClassName,sclassimg from SmallClass where SmallClassID="&scid
pro_c.open sql,conn,1,1
sname=pro_c("SmallClassName")
bname=pro_c("BigClassName")
simg=pro_c("sclassimg")
pro_c.close
set pro_c=nothing
else
Set pro_c = Server.CreateObject("ADODB.Recordset")
sql="select top 1 SmallClassName from SmallClass"
pro_c.open sql,conn,1,1
sname=pro_c("SmallClassName")
pro_c.close
set pro_c=nothing
end if
%>
<%
'页码显示~
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
'页码显示!
set rzsl = server.createobject("adodb.recordset")
if sname<>"" then
prosql="select ID,Title,DefaultPicUrl,DefaultPicUrl2 from Product where SmallClassName='"& sname &"' order by UpdateTime asc"
else
prosql="select ID,Title,DefaultPicUrl,DefaultPicUrl2 from Product order by UpdateTime asc"
end if
rzsl.open prosql,conn,1,1
if not rzsl.eof then
rzsl.pagesize=6
if Request("Page")="" then
Page=1
else
Page =cint(Request("Page"))
end if
'分页显示
If not Page >1 Then Page = 1
If Page > rzsl.PageCount Then Page = rzsl.PageCount
rzsl.absolutepage=page
'页码显示~
totalPut=rzsl.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
If currentpage > rzsl.PageCount Then currentpage = rzsl.PageCount
'页码显示!
dim countrs,k,i
countrs=1
i=1
if rzsl.pagesize<3 then
js=rzsl.pagesize
else
js=3
end if
do while countrs<=rzsl.pagesize and not rzsl.eof
if rzsl.eof then exit do
%>
<%rzsl.movenext
countrs=countrs+1
%>
<%loop%>
<%else
Response.write("
对不起,暂无任何相关产品信息...
")
end if
'-----------------------------------------------------------------------------------------------------------------------
%>
<%=Page%>/<%=rzsl.PageCount%>
<%a=6 '要显示的页码数 page 当前页码 pagecount 总页码数
if page>a-1 and rzsl.PageCount >a Then '如果当前页大于 要显示的页数 或 记录总数 大于 要显示的页数.
if (page+int((a-1)/2))>rzsl.PageCount then
pagenow = rzsl.PageCount - a+1
else
pagenow = page - int((a-1)/2)
end if
for i = 1 to a
If pagenow=page Then
response.write "- "&pagenow&"
"
Else
response.write "- "&pagenow&"
"
End If
pagenow = pagenow + 1
next
else
if rzsl.PageCount < a then
for i = 1 to rzsl.PageCount
If i=page Then
response.write "- "&i&"2
" '当前页码显示
Else
response.write "- "&i&"
"
End If
next
else
for i = 1 to a
If i=page Then
response.write "- "&i&"
" '当前页码显示
Else
response.write "- "&i&"
"
End If
next
end if
end if
%>
<%
rzsl.close
set rzsl=nothing
%>