Products
<% dim strsql dim rs1,classid,previewimg,id,itemno,feature dim keyword dim ArticleCount classid=request("classid") Nclassid=request("Nclassid") keyword=checkstr(request("keyword")) keyword1=checkstr(request("keyword1")) strsql="where 1=1" if classid<>"" and classid<>0 then strsql=strsql&" and classid="&classid end if if Nclassid<>"" and nclassid<>0 then strsql=strsql&" and Nclassid="&Nclassid end if if keyword<>"" then strsql=strsql&" and (itemno like '%"&keyword&"%')" end if if keyword1<>"" then strsql=strsql&" and (id="&keyword1&")" end if 'response.Write(strsql) PageSize=60 %>
<% Set Rs=Server.CreateObject("Adodb.RecordSet") SQL="SELECT * FROM product "&strsql&" ORDER BY ID DESC" 'response.Write(sql) Rs.CursorLocation=3 Rs.Open SQL,Conn,1 ArticleCount=Rs.RecordCount Page=Request.QueryString("Page") If IsInt(Page) = False Then Page=1 Else Page=Cint(Page) End If If ArticleCount Mod Cint(PageSize)=0 Then PageCount= ArticleCount \ Cint(PageSize) Else PageCount= ArticleCount \ Cint(PageSize)+1 End If If Not (Rs.Bof And Rs.Eof) Then Rs.MoveFirst If Page > PageCount Then Page = PageCount If Page<1 Then Page=1 Rs.Move (Page-1) * Cint(PageSize) i=0 %> <% count=1 Do While Not Rs.Eof And i<=PageSize Id=Rs("id") ItemNo=rs("ItemNo") previewimg=rs("previewimg") %> <% if count mod 4 <>0 then%> <%end if%> <% if count mod 4 =0 then response.write"" end if Rs.MoveNext count=count+1 i=i+1 if i>=PageSize then exit do Loop %>

<% else %>
No product
<% End If Rs.Close Set Rs=Nothing %>
<% If ClassID<>"" Then pagestr="ClassID="&request("classid")&"&" end if if nclassid<>"" then pagestr="NClassID="&request("Nclassid")&"&" end if if keyword<>"" then pagestr=pagestr&"keyword="&keyword&"&" end if Response.Write (ShowPage(PageCount,ArticleCount,Page,PageSize,"/product.asp?"&pagestr)) %>