搜索页面左边树型搜索结果代码 修改

来源:互联网 发布:xbox360 手柄链接mac 编辑:程序博客网 时间:2024/05/16 02:22

<%
if Chkrequest(sortid) then
sortsql="select class_2.typeid,class_2.typename,class_1.* from class_2,class_1 where class_2.sortid="&sortid&" and class_1.sortid=class_2.sortid"
set rssort=conn.execute(sortsql)
if rssort.eof then
response.write"暂无信息"
else
if Getsearchsortcount4>0 then response.write"<b><A href='searchall.asp?sortid="&sortid&"&keywords="&keywords&"'>"&rssort("sort")&"</A> ("&Getsearchsortcount4&")</b><br>"
do while not rssort.eof
response.write"<span class=lh13>"
if Getsearchtypecount4>0 then response.write"·<a href='searchall.asp?typeid="&rssort("typeid")&"&keywords="&keywords&"' class='s'>"&rssort("typename")&"</a> ("&Getsearchtypecount4&")<br>"
rssort.movenext   
loop
end if
rssort.close
set rssort=nothing


elseif Chkrequest(typeid) then
typesql="select class_2.typeid,class_2.typename,class_1.* from class_2,class_1 where class_2.typeid="&typeid&" and class_1.sortid=class_2.sortid"
set rstype=conn.execute(typesql)
if rstype.eof then
response.write"暂无信息"
else
if Getsearchsortcount5>0 then response.write"<b><A href='searchall.asp?sortid="&rstype("sortid")&"&keywords="&keywords&"'>"&rstype("sort")&"</A> ("&Getsearchsortcount5&")</b><br><span class=lh15>"
if Getsearchtypecount>0 then response.write"·<a href='searchall.asp?typeid="&rstype("typeid")&"&keywords="&keywords&"' class='s'>"&rstype("typename")&"</a> ("&Getsearchtypecount&")<br>"
end if
rstype.close
set rstype=nothing

else

sortsql="select * from class_1"  
set rssort=conn.execute(sortsql)
if rssort.eof then
response.write"暂无信息"
else
do while not rssort.eof
response.write"<span class=lh15>"
if Getsearchsortcount>0 then response.write" <b><A href='searchall.asp?sortid="&rssort("sortid")&"&keywords="&keywords&"'>"&rssort("sort")&"</A> ("&Getsearchsortcount&")</b><br>"
typesql="select * from class_2 where sortid="&rssort("sortid")&""
set rstype=conn.execute(typesql)
if rstype.eof then
response.write"暂无信息"
else
do while not rstype.eof
if Getsearchtypecount>0 then response.write"·<a href='searchall.asp?typeid="&rstype("typeid")&"&keywords="&keywords&"' class='s'>"&rstype("typename")&"</a> ("&Getsearchtypecount&")<br>"
rstype.movenext   
loop
end if
rstype.close
set rstype=nothing
rssort.movenext
loop
end if
rssort.close
set rssort=nothing
end if
%>

原创粉丝点击