<%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 %>