Search.Asp
上传用户:mtjhgs
上传日期:2021-12-08
资源大小:3755k
文件大小:12k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <!--#include file="../Include/Const.asp" -->
  3. <!--#include file="../Include/NoHackSql.Asp" -->
  4. <!--#include file="../Include/ConnSiteData.asp" -->
  5. <%call SiteInfo
  6. headid=3
  7. %>
  8. <!--#include file="Head.Asp" -->
  9. <div class="clear"></div>
  10. <div id="contant">
  11.   <div class="cleft">
  12. <div class="news">
  13.       <div class="title">
  14.   &nbsp;<b>产品列表</b>
  15.   </div>
  16.   <div>
  17.   <ul>
  18.   <%call CallFolderView()%>
  19.   </ul>
  20.   </div>
  21.     </div>
  22. <div class="news">
  23.       <div class="title">
  24.   &nbsp;<b>热门产品</b>
  25.   </div>
  26.   <div>
  27.   <ul>
  28.   <%=Producthot(10)%>
  29.   </ul>
  30.   </div>
  31.     </div>
  32.   </div>
  33.   <div class="cright">
  34. <div class="crightb">
  35.   <div class="crightbtitle">
  36.     <div class="crightbtitlel">
  37. 当前位置:
  38. </div>
  39. <div class="crightbtitler">
  40. <%=WebLocation()%>
  41. </div>
  42.   </div>
  43.   <div class="crightbcontent">
  44.   <%=WebContent(trim(request("Keyword")),request("Range"))%></div>
  45. </div>
  46.   </div>
  47. </div>
  48. <!--#include file="Foot.Asp"-->
  49. <%
  50. '调用显示节点------------------------------
  51. Function CallFolderView()
  52. %>
  53. <% Folder(0) %>
  54. <%
  55. End Function
  56. '列出所有节点------------------------------
  57. Function Folder(id)
  58.   Dim rs,sql,i,ChildCount,FolderType,FolderName,onMouseUp,ListType,ViewFlag
  59.   Set rs=server.CreateObject("adodb.recordset")
  60.   sql="Select * From Wygkcnflash_ProductSort where ViewFlag"&Language&" and ParentID="&id&" order by id"
  61.   rs.open sql,conn,1,1
  62.   if id=0 and rs.recordcount=0 then
  63.     response.write ("No Information!")
  64.     response.end
  65.   end if  
  66.   i=1
  67.   response.write("<table border='0' cellspacing='0' cellpadding='0' style='margin-left:16px;'>")
  68.   while not rs.eof
  69.     ChildCount=conn.execute("select count(*) from Wygkcnflash_ProductSort where ParentID="&rs("id"))(0)
  70.     if ChildCount=0 then
  71.   if i=rs.recordcount then
  72.     FolderType="SortFileEnd"
  73.   else
  74.     FolderType="SortFile"
  75.   end if
  76.   FolderName=rs("SortNameCh")&"&nbsp;"&ViewFlag
  77.   onMouseUp=""
  78.     else
  79.   if i=rs.recordcount then
  80.   FolderType="SortEndFolderOpen"
  81. ListType="SortEndListline"
  82. onMouseUp="EndSortChange('a"&rs("id")&"','b"&rs("id")&"');"
  83.   else
  84. FolderType="SortFolderOpen"
  85. ListType="SortListline"
  86. onMouseUp="SortChange('a"&rs("id")&"','b"&rs("id")&"');"
  87.   end if
  88.   FolderName=rs("SortNameCh")&"&nbsp;"&ViewFlag
  89.     end if
  90.     response.write("<tr>")
  91.     response.write("<td nowrap id='b"&rs("id")&"' class='"&FolderType&"' onMouseUp="&onMouseUp&"></td><td nowrap><a href=""ProductList.asp?SortID="&rs("ID")&""">"&FolderName&"</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
  92.     response.write("</td></tr>")
  93.     if ChildCount>0 then
  94. %>
  95.       <tr id="a<%= rs("id")%>" style="display:none"><td class="<%= ListType%>" nowrap></td><td ><% Folder(rs("id")) %></td></tr>
  96. <%
  97.     end if
  98.     rs.movenext
  99.     i=i+1
  100.   wend
  101.   response.write("</table>")
  102.   rs.close
  103.   set rs=nothing
  104. end function
  105. function WebMenu(ParentID,i,level)
  106.   if request("Range")="Void" then
  107.  response.write "请选择搜索范围"
  108. exit function
  109. end if
  110.   dim rs,sql
  111.   set rs = server.createobject("adodb.recordset")
  112.   sql="select * from LiangJingCMS_"&request("Range")&"Sort where ViewFlag"&Language&" and ParentID="&ParentID&" order by ID asc"
  113.   rs.open sql,conn,1,1
  114.   if conn.execute("select ID from LiangJingCMS_"&request("Range")&"Sort Where ViewFlag"&Language&" and ParentID=0").eof then
  115.     response.write "暂无相关信息"
  116.   end if
  117.   do while not rs.eof
  118. if ParentID=0 then
  119.   response.write "<a href="""&request("Range")&"List.asp?SortID="&rs("ID")&""">"&rs("SortName"&Language)&"</a><br/>"
  120. else
  121.   response.write string(i," ")&"<a href="""&request("Range")&"List.asp?SortID="&rs("ID")&""">"&rs("SortName"&Language)&"</a><br/>"
  122. end if
  123.     i=i+1
  124. if i<level then call WebMenu(rs("ID"),i,level)
  125. i=i-1
  126. rs.movenext
  127.   loop 
  128.   rs.close
  129.   set rs=nothing
  130. end function
  131. function WebLocation()
  132.   WebLocation="&nbsp;当前位置:<a href=""index.asp"" class=""agray"">首页</a> - 搜索 - "&VbCrLf
  133.   if request("Range")="Void" then
  134. WebLocation=WebLocation&"<center>请选择搜索范围</center>"
  135.     exit Function
  136.   elseif trim(request("Keyword")) ="" Then
  137.     WebLocation=WebLocation&"<font color=""red"">关键字为空</font>"
  138.   elseif request("Range")="Product" Then
  139.     WebLocation=WebLocation&"产品 - 关键字[<font color=""red"">"&trim(request("Keyword"))&"</font>]"
  140.   elseif request("Range")="News" Then
  141.     WebLocation=WebLocation&"新闻 - 关键字[<font color=""red"">"&trim(request("Keyword"))&"</font>]"
  142.   elseif request("Range")="Down" Then
  143.     WebLocation=WebLocation&"下载 - 关键字[<font color=""red"">"&trim(request("Keyword"))&"</font>]"
  144.   elseif request("Range")="Others" Then
  145.     WebLocation=WebLocation&"其他 - 关键字[<font color=""red"">"&trim(request("Keyword"))&"</font>]"
  146.   end if
  147. end Function
  148. function WebContent(Keyword,Range)
  149.   if Range="Void" then
  150.  response.write "<center>请选择搜索范围</center>"
  151.      exit function
  152.   end if
  153.   dim idCount
  154.   dim pages
  155.       pages=12
  156.   dim pagec
  157.   dim page
  158.       page=clng(request("Page"))
  159.   dim pagenc
  160.       pagenc=5
  161.   dim pagenmax
  162.   dim pagenmin
  163.   dim pageprevious
  164.   dim pagenext
  165.   dim datafrom
  166.   dim datawhere
  167.      select case Range
  168.   case "Product"
  169.         datafrom="Wygkcnflash_Products"
  170.         datawhere="where ViewFlag"&Language&" and ProductName"&Language&" like '%"&KeyWord&"%'"
  171.   case "News"
  172.         datafrom="Wygkcnflash_News"
  173.         datawhere="where ViewFlag"&Language&" and NewsName"&Language&" like '%"&KeyWord&"%'"
  174.   case "Down"
  175.         datafrom="Wygkcnflash_Download"
  176.         datawhere="where ViewFlag"&Language&" and DownName"&Language&" like '%"&KeyWord&"%'"
  177.   case "Others"
  178.         datafrom="Wygkcnflash_Others"
  179.         datawhere="where ViewFlag"&Language&" and OthersName"&Language&" like '%"&KeyWord&"%'"
  180.       end select
  181.   dim sqlid
  182.   dim Myself,PATH_INFO,QUERY_STRING
  183.       PATH_INFO = request.servervariables("PATH_INFO")
  184.   QUERY_STRING = request.ServerVariables("QUERY_STRING")'
  185.       if QUERY_STRING = "" then
  186.     Myself = PATH_INFO & "?"
  187.   elseif Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then
  188.     Myself= PATH_INFO & "?" & QUERY_STRING & "&"
  189.   else
  190.     Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1)
  191.   end if
  192.   dim taxis
  193.       taxis="order by id desc "
  194.   dim i
  195.   dim rs,sql
  196.   set rs = server.createobject("adodb.recordset")
  197.   sql="select count(ID) as idCount from ["& datafrom &"]" & datawhere
  198.   set rs=server.createobject("adodb.recordset")
  199.   rs.open sql,conn,0,1
  200.   idCount=rs("idCount")
  201.   if(idcount>0) then
  202.     if(idcount mod pages=0)then
  203.   pagec=int(idcount/pages)
  204.     else
  205.       pagec=int(idcount/pages)+1
  206.     end if
  207.     sql="select id from ["& datafrom &"] " & datawhere & taxis
  208.     set rs=server.createobject("adodb.recordset")
  209.     rs.open sql,conn,1,1
  210.     rs.pagesize = pages
  211.     if page < 1 then page = 1
  212.     if page > pagec then page = pagec
  213.     if pagec > 0 then rs.absolutepage = page
  214.     for i=1 to rs.pagesize
  215.   if rs.eof then exit for
  216.   if(i=1)then
  217.     sqlid=rs("id")
  218.   else
  219.     sqlid=sqlid &","&rs("id")
  220.   end if
  221.   rs.movenext
  222.     next
  223.   end if
  224.   if(idcount>0 and sqlid<>"") Then
  225.     sql="select * from ["& datafrom &"] where id in("& sqlid &") "&taxis
  226.     set rs=server.createobject("adodb.recordset")
  227.     rs.open sql,conn,0,1
  228. Response.Write "<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&VbCrLf
  229. Response.Write "  <tr height=""32"">"&VbCrLf
  230. Response.Write "    <td width=""550"" style=""color:#FFFFFF; font-weight:bold; background:url(Images/split.gif) no-repeat right center; background-color:#abacaf"">&nbsp;&nbsp;&nbsp;&nbsp;信息标题</td>"&VbCrLf
  231. Response.Write "    <td align=""center"" bgcolor=""#ABACAF"" style=""color:#FFFFFF; font-weight:bold"">发布日期</td>"&VbCrLf
  232. Response.Write "  </tr>"&VbCrLf
  233.     while not rs.eof
  234.      select case Range
  235.   case "Product"
  236. Response.Write "  <tr height=""28"">"&VbCrLf
  237. Response.Write "    <td style=""background:url(Images/bg2.gif) repeat-x left bottom;"">&nbsp;<img src=""images/arr.gif"" width=""11"" height=""14"" align=""absmiddle"" />&nbsp;&nbsp;<a href=""ProductView.asp?ID="&rs("ID")&""">"&rs("ProductName"&Language)&"</a></td>"&VbCrLf
  238. Response.Write "    <td align=""center"" style=""background:url(Images/bg2.gif) repeat-x left bottom; color:#999999"">"&FormatDate(rs("UpdateTime"),13)&"</td>"&VbCrLf
  239. Response.Write "  </tr>"&VbCrLf
  240.   case "News"
  241. Response.Write "  <tr height=""28"">"&VbCrLf
  242. Response.Write "    <td style=""background:url(Images/bg2.gif) repeat-x left bottom;"">&nbsp;<img src=""images/arr.gif"" width=""11"" height=""14"" align=""absmiddle"" />&nbsp;&nbsp;<a href=""NewsView.asp?ID="&rs("ID")&""">"&rs("NewsName"&Language)&"</a></td>"&VbCrLf
  243. Response.Write "    <td align=""center"" style=""background:url(Images/bg2.gif) repeat-x left bottom; color:#999999"">"&FormatDate(rs("Addtime"),13)&"</td>"&VbCrLf
  244. Response.Write "  </tr>"&VbCrLf
  245.   case "Down"
  246. Response.Write "  <tr height=""28"">"&VbCrLf
  247. Response.Write "    <td style=""background:url(Images/bg2.gif) repeat-x left bottom;"">&nbsp;<img src=""images/arr.gif"" width=""11"" height=""14"" align=""absmiddle"" />&nbsp;&nbsp;<a href=""DownView.asp?ID="&rs("ID")&""">"&rs("DownName"&Language)&"</a>("&rs("FileSize")&")</td>"&VbCrLf
  248. Response.Write "    <td align=""center"" style=""background:url(Images/bg2.gif) repeat-x left bottom; color:#999999"">"&FormatDate(rs("Updatetime"),13)&"</td>"&VbCrLf
  249. Response.Write "  </tr>"&VbCrLf
  250.   case "Others"
  251. Response.Write "  <tr height=""28"">"&VbCrLf
  252. Response.Write "    <td style=""background:url(Images/bg2.gif) repeat-x left bottom;"">&nbsp;<img src=""images/arr.gif"" width=""11"" height=""14"" align=""absmiddle"" />&nbsp;&nbsp;<a href=""OtherView.asp?ID="&rs("ID")&""">"&rs("OthersName"&Language)&"</a></td>"&VbCrLf
  253. Response.Write "    <td align=""center"" style=""background:url(Images/bg2.gif) repeat-x left bottom; color:#999999"">"&FormatDate(rs("UpdateTime"),13)&"</td>"&VbCrLf
  254. Response.Write "  </tr>"&VbCrLf
  255.       end select
  256.   rs.movenext
  257.     wend
  258. Response.Write "</table>"&VbCrLf
  259.   else
  260.     response.write "<center>暂无相关信息</center>"
  261. exit function
  262.   end If
  263.   Response.Write "<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&VbCrLf
  264.   Response.Write "  <tr height=""35"">"&VbCrLf
  265.   Response.Write "    <td align=""center"">"&VbCrLf
  266.   Response.Write "共<strong style=""color:red"">"&idcount&"</strong>条记录 页次:<strong style=""color:red"">"&page&"</strong>/"&pagec&" 每页:<strong style=""color:red"">"&pages&"</strong>条记录" & vbCrLf
  267.   pagenmin=page-pagenc
  268.   pagenmax=page+pagenc
  269.   if(pagenmin<1) then pagenmin=1
  270.   if(page>1) then response.write ("<a href=""search.asp?Page=1&Range="&request("Range")&"&KeyWord="&Keyword&""" title=""回到第一页""><font face=""webdings"" color=""#000000"">9</font></a> ")
  271.   if page-(pagenc*2+1)<=0 then
  272. pageprevious=1
  273.   else
  274. pageprevious=page-(pagenc*2+1)
  275.   end if
  276.   if(pagenmin>1) then response.write ("<a href=""search.asp?Page="& pageprevious &"&Range="&request("Range")&"&KeyWord="&Keyword&""" title=""第"& pageprevious &"页""><font face=""webdings"" color=""#000000"">3</font></a> ")
  277.   if(pagenmax>pagec) then pagenmax=pagec
  278.   for i = pagenmin to pagenmax
  279. if(i=page) then
  280.   response.write ("&nbsp;<strong style=""color:red"">"& i &"</strong>&nbsp;")
  281. else
  282.   response.write ("[<a href=""search.asp?Page="& i &"&Range="&request("Range")&"&KeyWord="&Keyword&""">"& i &"</a>]")
  283. end if
  284.   next
  285.   if page+(pagenc*2+1)>=pagec then
  286.     pagenext=pagec
  287.   else
  288.     pagenext=page+(pagenc*2+1)
  289.   end if
  290.   if(pagenmax<pagec) then response.write (" <a href=""search.asp?Page="& pagenext &"&Range="&request("Range")&"&KeyWord="&Keyword&""" title=""跳转到第"&pagenext&"页""><font face=""webdings"" color=""#999999"">:</font></a> ")
  291.   if(page<pagec) then response.write (" <a href=""search.asp?Page="& pagec &"&Range="&request("Range")&"&KeyWord="&Keyword&""" title=""跳转到第"&pagec&"页""><font face=""webdings"" color=""#000000"">:</font></a>")
  292.   Response.Write "    </td>"&VbCrLf
  293.   Response.Write "  </tr>"&VbCrLf
  294.   Response.Write "</table>"&VbCrLf
  295.   rs.close
  296.   set rs=nothing
  297. end function
  298. %>