 |
|
 |
<%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
%>
|
<%
else response.Write("
提示信息: 對不起,暫時沒有相關欄目圖片信息...")
end if
%> |
|
|
|
 |