鲜 花 导 购 |
|
+ 按对象选购
<%
dim anclassid
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from shop_anclass where anclass='用途'",conn,1,1
if rs1.bof and rs1.eof then
response.write "分类中没有内容!"
else
anclassid=rs1("anclassid")
rs1.close
set rs1=nothing
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select nclass,nclassid from shop_nclass where anclassid="&anclassid,conn,1,1
do while not rs.eof
%>
<%
i=1
do while i<=4 and not rs.eof
i=i+1
%>
|
<%
rs.movenext
loop
%>
<%
loop
rs.close
set rs=nothing
%>
|
|
+
按用途分类
<%
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from shop_anclass where anclass='对象'",conn,1,1
if rs1.bof and rs1.eof then
response.write "分类中没有内容!"
else
anclassid=rs1("anclassid")
rs1.close
set rs1=nothing
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select nclass,nclassid from shop_nclass where anclassid="&anclassid,conn,1,1
do while not rs.eof
%>
<%
i=1
do while i<=4 and not rs.eof
i=i+1
%>
|
<%
rs.movenext
loop
%>
<%
loop
rs.close
set rs=nothing
%>
|
|
+
按品种分类
<%
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from shop_anclass where anclass='品种'",conn,1,1
if rs1.bof and rs1.eof then
response.write "分类中没有内容!"
else
anclassid=rs1("anclassid")
rs1.close
set rs1=nothing
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select nclass,nclassid from shop_nclass where anclassid="&anclassid,conn,1,1
do while not rs.eof
%>
<%
i=1
do while i<=4 and not rs.eof
i=i+1
%>
|
<%
rs.movenext
loop
%>
<%
loop
rs.close
set rs=nothing
%>
|
|
|
|
<%'开始分页
Const MaxPerPage=12
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
sqlstr="select * from shop_books where class like '%巧克力%' order by adddate desc"
if nclassid="" then
set rs=server.CreateObject("adodb.recordset")
rs.open sqlstr,conn,1,1
else
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_books where nclassid="&nclassid&" order by adddate desc",conn,1,1
end if
if err.number<>0 then
response.write "数据库中无数据"
end if
if rs.eof And rs.bof then
Response.Write " 对不起,此分类暂时还没有商品! "
else
totalPut=rs.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=1 then
showContent
showpage totalput,MaxPerPage,"index.asp"
else
if (currentPage-1)*MaxPerPage
<%
do while not rs.eof
%>
<%
n=1
do while n<=5 and not rs.eof
n=n+1
%>
|
<%
rs.movenext
loop
%>
<% i=i+1
if i>=2 then exit do '控制行数
'rs.movenext
loop
%>
|
<%
End Sub
Function showpage(totalnumber,maxperpage,filename)
Dim n
If totalnumber Mod maxperpage=0 Then
n= totalnumber \ maxperpage
Else
n= totalnumber \ maxperpage+1
End If
Response.Write ""
End Function
%>
|
|
|