<%dim productsort productsort=cint(request("productsort")) if productsort<>0 then set rssort=server.CreateObject("adodb.recordset") rssort.open "select * from productsort where id="&productsort,conn,1,1 response.Write rssort("name") else response.Write "产品展示" end if %>
<% page=cint(request("page")) if page=0 then page=1 txtitle=request("txtitle") num_row=3 rows=3 maxperpage=num_row*rows function getSort(i) '该函数获取类别下的所有子类,符合一般搜索习惯 dim rs,sql set rs=server.createObject("adodb.recordset") sql="select * from productSort where fatherID="&i rs.open sql,conn,1,1 do while not rs.eof strSort=strSort&","&rs("id") '&rs("name") call getSort(rs("id")) rs.movenext loop end function strSort=productSort CALL getSort(productSort) '得到所有属于该类的子类 page=Request("page") if (page="" or isempty(page)) then page=1 thisUrl="cp.asp?productsort="&productsort&"" set rs=server.createobject("adodb.recordset") sql="select * from product where 1=1" if productsort>0 then sql=sql&" and productsort in ("&strSort&")" end if if not (txtitle="" or isempty(txtitle)) then sql=sql&" and cpname like '%"&txtitle&"%'" end if sql=sql& " order by productsort asc , oid asc" rs.open sql,conn,1,1 rs.pagesize=MaxPerPage if not rs.eof then %>
<% j=1 if not (rs.eof or err) then rs.move (page-1)*maxPerPage do while not (rs.eof or err) if (j mod num_row)=1 then %> <% response.write "" end if %> <% if (j mod num_row)=0 then response.write "" else %> <% end if j=j+1 if j>maxperpage then exit do rs.moveNext loop %>
共<%=rs.recordCount%>条记录  每页<%=maxperpage%>条  共<%=rs.pagecount%>页   <%if cint(page)>1 then%> > <%end if%> 首页 <%if cint(page)>1 then%> &page=<%=page-1%>> <%end if%> 上一页 <% pp=cint(page)-4 if pp<1 then pp=1 end if for pno=pp to rs.pagecount p=p+1 if pno=cint(page) then%> <%=pno%> <%else%> &page=<%=pno%>><%=pno%> <%end if%> <% if p>=10 then exit for next%> <%if cint(page)< rs.pagecount then%> &page=<%=page+1%>> <%end if%> 下一页 <%if cint(page)< rs.pagecount then%> &page=<%=rs.pagecount%>> <%end if%> 尾页
<% else response.Write("

提示信息: 对不起,暂时没有相关栏目图片信息...") end if %>