📄 search.asp
字号:
<!--#include file="conn.asp" --><HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>产品搜索</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META http-equiv=Content-Language content=zh-CN>
<META content=all name=robots>
<META content=LJCMS name=Copyright>
<META
content=
name=description>
<META
content=""
name=keywords><LINK
href="../images/css.css"
type=text/css rel=stylesheet>
<SCRIPT language=javascript>
function opencat(cat,img){
if(cat.style.display=="none"){
cat.style.display="";
img.src="img/class2.gif";
} else {
cat.style.display="none";
img.src="img/class1.gif";
}
}
</Script>
<SCRIPT language=JavaScript
src="../images/Prototype.js"></SCRIPT>
<META content="MSHTML 6.00.6000.16441" name=GENERATOR></HEAD>
<BODY><!-- 顶部开始 -->
<DIV id=BigTop>
<DIV id=TopLeft></DIV>
<DIV id=TopCenter>
<DIV id=Logo><IMG height=84
src="../images/Logo.jpg"
width=238 border=0> </DIV>
<DIV id=BigMenu>
<UL class=AllUl>
<LI class=MenuLi1><SPAN class=S_Spanlink>⊙<A href="<%=EnterpriseMail%>" > WEBMAIL </A>⊙<A onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('<%=SiteUrl%>');" href="#" > INDEX </A>⊙<A onClick="window.external.addFavorite('<%=SiteUrl%>','<%=SiteName%>');return false;" href="../Contact.asp" target="mainFrame" > Favorite </A> <a href="Contact.asp"></a> ⊙ <a href="../HTML/INDEX.HTML">中文版</a></LI>
<form name="Search_form" id="Search_form" class="AllForm" action="search.asp" target="_blank" method="get">
<li class="MenuLi1"><span class="S_Span"><input type="text" name="KeyWords" id="KeyWords" class="Input" style="width:200px;" /></span><span class="S_SeType"><input type="hidden" name="SeTypeTxt" id="SeTypeTxt" value="" /><input type="button" name="Setype" id="Setype" value="Setype" class="S_Typebutton" onClick="Dis_HiddenDiv();" /></span><span class="S_ImgSpan"><img src="../images/enssBount.jpg" width="57" height="20" border="0" align="absbottom" onClick="Fun_Se_Form();" /></span></li>
</form></LI>
<LI class=MenuLi2><div class="menu"><ul>
<!--#include file="inc/menu.asp" -->
</ul></div></LI>
</UL></DIV></DIV>
<DIV id=TopRight></DIV></DIV><!-- 顶部结束 --><!-- 主体部分开始 -->
<DIV id=BodyDiv><!-- 主体左边部分 -->
<DIV id=BodyLeft><!-- 用户登陆 -->
<DIV class=BigLoginDiv>
<DIV class=Login_Type_Div><SPAN class=Lo_Web_User_2 id=Lo_Web_User
></SPAN></DIV>
<DIV><iframe src="../enlogin.asp" style=" width:100%; height:100px" frameborder="0"></iframe></DIV>
</DIV><!-- 用户登陆结束 --><!-- 快速通道 -->
<DIV class="DivBorder Fs_Kstd">
<DIV class=Fs_Kstd_Top><SPAN class=Fs_Text>产品分类>></SPAN></DIV>
<DIV class=Fs_Kstd_Bottom>
<UL class=AllUl>
<%call ShowSmallClass_Tree()%>
</UL></DIV><DIV class=Fs_Kstd_Bo><SPAN class=Fs_Dot></SPAN><SPAN class=Fs_Textt></SPAN></DIV></DIV><!-- 快速通道结束 --><!-- 产品中心 -->
<!-- 产品中心结束 -->
<!-- 代理中心 -->
<!-- 代理中心结束 -->
<!-- 解决方案 -->
<!-- 解决方案结束 -->
<!-- 合作联盟 -->
<!-- 合作联盟结束 -->
</DIV>
<!-- 主体左边部分结束 --><!-- 主体中间部分 -->
<!-- 产品介绍结束 --><!-- 购买流程 -->
<DIV class="DivBorder OrderDiv1">
<DIV class=News_Top1><SPAN class=News_Dot><IMG height=9
src="../images/Ddot.jpg"
width=9 border=0></SPAN><SPAN class=News_Text1>产品搜索</SPAN></DIV>
<DIV class=Fs_All_Bottom1><%
keyword=trim(request("keywords"))
if keyword<>"" then
keyword=replace(replace(replace(replace(keyword,"'","‘"),"<","<"),">",">")," "," ")
end if
strField=trim(request("SeTypeTxt"))
%> <table Class=border width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="206" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD> <% call SearchResultTotal() %><%
sqlSearch="select "
sqlSearch=sqlSearch & " * from Product where Passed=True "
if keyword<>"" then
select case strField
case "Title"
sqlSearch=sqlSearch & " and Title like '%" & keyword & "%' "
case "Content"
sqlSearch=sqlSearch & " and Content like '%" & keyword & "%' "
case else
sqlSearch=sqlSearch & " and Title like '%" & keyword & "%' "
end select
end if
sqlSearch=sqlSearch & " order by ID desc"
Set rsSearch= Server.CreateObject("ADODB.Recordset")
rsSearch.open sqlSearch,conn,1,1
if not rsSearch.eof and rsSearch.bof then
response.write "<p align='center'><br><br>没有或没有找到任何产品</p>"
else
dim i,strTemp
i=0
strTemp= strTemp & "<DIV id=featured-sites>"
do while not rsSearch.eof
strTemp=""
strTemp= strTemp & "<DIV class=bel>"
strTemp= strTemp & "<DIV class=mbcon>"
strTemp= strTemp & "<DIV class=dp1><A href=Product_"&rsSearch("id")&".html target=_blank><IMG height=100 src=../"&rsSearch("DefaultPicUrl")&" width=110 align=left border=0></A></DIV><DIV class=Fs_Kstd_Bo><SPAN class=Fs_Dot></SPAN><SPAN class=Fs_Textt></SPAN></DIV>"
strTemp= strTemp & "<DIV class=dtt1><B><A href=Product_"&rsSearch("id")&".html/ target=_blank>"&rsSearch("title")&"</A></B>"
strTemp= strTemp & "<P>产品编号:"&rsSearch("Product_ID")&"</P><P>产品规格:"&rsSearch("Spec")&"</P><P>产品类别:"&rsSearch("BigClassName")&"</P></DIV>"
strTemp= strTemp & "<DIV class=dtt1><B><A href=Product_"&rsSearch("id")&".html target=_blank><IMG src=../images/shoucang.gif align=left border=0></A><A href=Product_"&rsSearch("id")&".html target=_blank><IMG src=../images/goumai.gif align=left border=0></A></B><P> </P>"
strTemp= strTemp & "<P>产品售价:"&rsSearch("Price")&"</P><P>产品备注:"&rsSearch("Memo")&"</P><P>产品信息:"&rsSearch("Memo")&"</P></DIV>"
strTemp= strTemp & "<DIV class=x></DIV><DIV class=cut><IMG height=2 width=1></DIV></DIV></DIV>"
response.write strTemp
rsSearch.movenext
i=i+1
if i>=MaxPerPage then exit do
loop
end if
rsSearch.close
set rsSearch=nothing%></TD>
</tr>
</table> </td>
</tr>
<TR>
<TD
height=1 colspan="3" background=img/naBialym.gif><IMG height=1 src="img/1x1_pix.gif"
width=10></TD>
</TR>
<TR>
<TD
height=25 colspan="3" bgcolor="#D8D8D8"> <div align="right">
</div></TD>
</TR>
</table>
<DIV class=Fs_C_Center></DIV>
</DIV></DIV><!-- 购买流程结束 --><!-- 客户案例 -->
<!-- 客户案例结束 -->
</DIV>
<!-- 主体中间部分结束 --><!-- 右边部分开始 -->
<!-- 右边部分结束 -->
</DIV></div>
<!-- 主体部分结束 --><!-- 版权部分开始 -->
<!--#include file="inc/foot.asp" --><!-- 版权部分结束 -->
<SCRIPT language=javascript
src="../images/js.js"
type=text/javascript></SCRIPT>
</BODY></HTML>
<%Sub ShowSmallClass_Tree()
%>
<%
dim i
set rsbig = server.CreateObject ("adodb.recordset")
sql="select * from BigClass"
rsbig.open sql,conn,1,1
if rsbig.eof and rsbig.bof then
Response.Write "栏目正在建设中……"
else
i=1
do while not rsbig.eof
%> <LI class=Fs_KstdLi>·<A
href="List_<%=rsbig("BigclassID")%>_1.html"
target=_blank><%=rsbig("BigClassName")%></A></LI>
<%
rsbig.movenext
i=i+1
loop
rsbig.close
set rsbig=nothing
end if
%>
<%
end Sub
'=================================================
'过程名:SearchResultTotal
'作 用:显示搜索结果总数
'参 数:无
'=================================================
sub SearchResultTotal()
dim rsTotal,sqlTotal
sqlTotal="select count(*) from Product where Passed=True "
if keyword<>"" then
select case strField
case "Title"
sqlTotal=sqlTotal & " and Title like '%" & keyword & "%' "
case "Content"
sqlTotal=sqlTotal & " and Content like '%" & keyword & "%' "
case else
sqlTotal=sqlTotal & " and Title like '%" & keyword & "%' "
end select
end if
Set rsTotal= Server.CreateObject("ADODB.Recordset")
rsTotal.open sqlTotal,conn,1,1
if rsTotal.eof and rsTotal.bof then
totalPut=0
response.write "共有 0 个产品"
else
totalPut=rsTotal(0)
response.Write "共找到 " & totalPut & " 个产品"
end if
end sub
'=================================================
'过程名:ShowSearchResult
'作 用:分页显示搜索结果
'参 数:无
'=================================================
sub ShowSearchResult()
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
sqlSearch="select top " & MaxPerPage
else
sqlSearch="select "
end if
sqlSearch=sqlSearch & " * from Product where Passed=True "
if keyword<>"" then
select case strField
case "Title"
sqlSearch=sqlSearch & " and Title like '%" & keyword & "%' "
case "Content"
sqlSearch=sqlSearch & " and Content like '%" & keyword & "%' "
case else
sqlSearch=sqlSearch & " and Title like '%" & keyword & "%' "
end select
end if
sqlSearch=sqlSearch & " order by ID desc"
Set rsSearch= Server.CreateObject("ADODB.Recordset")
rsSearch.open sqlSearch,conn,1,1
if not rsSearch.eof and rsSearch.bof then
response.write "<p align='center'><br><br>没有或没有找到任何产品</p>"
else
if currentPage=1 then
call SearchResultContent()
else
if (currentPage-1)*MaxPerPage<totalPut then
rsSearch.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rsSearch.bookmark
call SearchResultContent()
else
currentPage=1
call SearchResultContent()
end if
end if
end if
rsSearch.close
set rsSearch=nothing
end sub
sub SearchResultContent()
dim i,strTemp
i=0
do while not rsSearch.eof
strTemp=""
strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td width=25% rowspan=6>"
strTemp= strTemp & "<div align=center><a href=ProductShow.asp?ID=" & rsSearch("ID") & ">"
fileExt=lcase(getFileExtName(rsSearch("DefaultPicUrl")))
if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then
strTemp= strTemp & "<img border=0 src=" & rsSearch("DefaultPicUrl") & " width=105 height=80>"
else
if fileext="swf" then
strTemp= strTemp & "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='105' height='84'>"
strTemp= strTemp &"<param name=movie value='"&rsSearch("DefaultPicUrl")&"'>"
strTemp= strTemp &"<param name=quality value=high>"
strTemp= strTemp &"<param name='Play' value='-1'>"
strTemp= strTemp &"<param name='Loop' value='0'>"
strTemp= strTemp &"<param name='Menu' value='-1'>"
strTemp= strTemp &"<param name='wmode' value='transparent'>"
strTemp= strTemp &"<embed src='"&rsSearch("DefaultPicUrl")&"' width='105' height='84' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed> </object>"
end if
end if
strTemp= strTemp & "</a></div></td>"
strTemp= strTemp & "<td width=12% height=12>"
strTemp= strTemp & "产品名称:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsSearch("ID") & ">" & rsSearch("Title") & ""
strTemp= strTemp & "</a></td>"
'strTemp= strTemp & "</tr><tr>"
'strTemp= strTemp & "<td width=12% height=12>"
'strTemp= strTemp & "产品售价:</td>"
'strTemp= strTemp & "<td>" & rsSearch("Price") & "元</td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td width=12% height=12>"
strTemp= strTemp & "产品规格:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & rsSearch("Spec") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td width=12% height=12>"
strTemp= strTemp & "产品备注:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & rsSearch("Memo") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=12>"
strTemp= strTemp & "产品类别:</td>"
strTemp= strTemp & "<td><a href=Product.asp?BigClassName=" & rsSearch("BigClassName") & ">" & rsSearch("BigClassName") & "</a> → "
strTemp= strTemp & "<a href=Product.asp?BigClassName=" & rsSearch("BigClassName") & "&SmallClassName=" & rsSearch("SmallClassName") & ">" & rsSearch("SmallClassName") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=12>产品信息:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsSearch("ID") & "><img src=Img/arrow_7.gif border=0></a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td colspan=2>"
strTemp= strTemp & "<table width=100% border=0 cellpadding=0 cellspacing=0>"
strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td width=50% height=12>"
strTemp= strTemp & "<div align=center></div></td>"
strTemp= strTemp & "<td width=50% height=12>"
strTemp= strTemp & "<div align=center><input name='Product_Id' type='checkbox' id='Product_Id' value="&cstr(rsSearch("Product_Id"))&"> 选取"
strTemp= strTemp & "</div></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
strTemp= strTemp & "</td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=1 colspan=3 bgcolor=#CCCCCC></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
response.write strTemp
rsSearch.movenext
i=i+1
if i>=MaxPerPage then exit do
loop
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -