Search.Asp
上传用户:mtjhgs
上传日期:2021-12-08
资源大小:3755k
文件大小:12k
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
- <!--#include file="../Include/Const.asp" -->
- <!--#include file="../Include/NoHackSql.Asp" -->
- <!--#include file="../Include/ConnSiteData.asp" -->
- <%call SiteInfo
- headid=3
- %>
- <!--#include file="Head.Asp" -->
- <div class="clear"></div>
- <div id="contant">
- <div class="cleft">
- <div class="news">
- <div class="title">
- <b>产品列表</b>
- </div>
- <div>
- <ul>
- <%call CallFolderView()%>
- </ul>
- </div>
- </div>
- <div class="news">
- <div class="title">
- <b>热门产品</b>
- </div>
- <div>
- <ul>
- <%=Producthot(10)%>
- </ul>
- </div>
- </div>
- </div>
- <div class="cright">
- <div class="crightb">
- <div class="crightbtitle">
- <div class="crightbtitlel">
- 当前位置:
- </div>
- <div class="crightbtitler">
- <%=WebLocation()%>
- </div>
- </div>
- <div class="crightbcontent">
- <%=WebContent(trim(request("Keyword")),request("Range"))%></div>
- </div>
- </div>
- </div>
- <!--#include file="Foot.Asp"-->
- <%
- '调用显示节点------------------------------
- Function CallFolderView()
- %>
- <% Folder(0) %>
- <%
- End Function
- '列出所有节点------------------------------
- Function Folder(id)
- Dim rs,sql,i,ChildCount,FolderType,FolderName,onMouseUp,ListType,ViewFlag
- Set rs=server.CreateObject("adodb.recordset")
- sql="Select * From Wygkcnflash_ProductSort where ViewFlag"&Language&" and ParentID="&id&" order by id"
- rs.open sql,conn,1,1
- if id=0 and rs.recordcount=0 then
- response.write ("No Information!")
- response.end
- end if
- i=1
- response.write("<table border='0' cellspacing='0' cellpadding='0' style='margin-left:16px;'>")
- while not rs.eof
- ChildCount=conn.execute("select count(*) from Wygkcnflash_ProductSort where ParentID="&rs("id"))(0)
- if ChildCount=0 then
- if i=rs.recordcount then
- FolderType="SortFileEnd"
- else
- FolderType="SortFile"
- end if
- FolderName=rs("SortNameCh")&" "&ViewFlag
- onMouseUp=""
- else
- if i=rs.recordcount then
- FolderType="SortEndFolderOpen"
- ListType="SortEndListline"
- onMouseUp="EndSortChange('a"&rs("id")&"','b"&rs("id")&"');"
- else
- FolderType="SortFolderOpen"
- ListType="SortListline"
- onMouseUp="SortChange('a"&rs("id")&"','b"&rs("id")&"');"
- end if
- FolderName=rs("SortNameCh")&" "&ViewFlag
- end if
- response.write("<tr>")
- response.write("<td nowrap id='b"&rs("id")&"' class='"&FolderType&"' onMouseUp="&onMouseUp&"></td><td nowrap><a href=""ProductList.asp?SortID="&rs("ID")&""">"&FolderName&"</a> ")
- response.write("</td></tr>")
- if ChildCount>0 then
- %>
- <tr id="a<%= rs("id")%>" style="display:none"><td class="<%= ListType%>" nowrap></td><td ><% Folder(rs("id")) %></td></tr>
- <%
- end if
- rs.movenext
- i=i+1
- wend
- response.write("</table>")
- rs.close
- set rs=nothing
- end function
- function WebMenu(ParentID,i,level)
- if request("Range")="Void" then
- response.write "请选择搜索范围"
- exit function
- end if
- dim rs,sql
- set rs = server.createobject("adodb.recordset")
- sql="select * from LiangJingCMS_"&request("Range")&"Sort where ViewFlag"&Language&" and ParentID="&ParentID&" order by ID asc"
- rs.open sql,conn,1,1
- if conn.execute("select ID from LiangJingCMS_"&request("Range")&"Sort Where ViewFlag"&Language&" and ParentID=0").eof then
- response.write "暂无相关信息"
- end if
- do while not rs.eof
- if ParentID=0 then
- response.write "<a href="""&request("Range")&"List.asp?SortID="&rs("ID")&""">"&rs("SortName"&Language)&"</a><br/>"
- else
- response.write string(i," ")&"<a href="""&request("Range")&"List.asp?SortID="&rs("ID")&""">"&rs("SortName"&Language)&"</a><br/>"
- end if
- i=i+1
- if i<level then call WebMenu(rs("ID"),i,level)
- i=i-1
- rs.movenext
- loop
- rs.close
- set rs=nothing
- end function
- function WebLocation()
- WebLocation=" 当前位置:<a href=""index.asp"" class=""agray"">首页</a> - 搜索 - "&VbCrLf
- if request("Range")="Void" then
- WebLocation=WebLocation&"<center>请选择搜索范围</center>"
- exit Function
- elseif trim(request("Keyword")) ="" Then
- WebLocation=WebLocation&"<font color=""red"">关键字为空</font>"
- elseif request("Range")="Product" Then
- WebLocation=WebLocation&"产品 - 关键字[<font color=""red"">"&trim(request("Keyword"))&"</font>]"
- elseif request("Range")="News" Then
- WebLocation=WebLocation&"新闻 - 关键字[<font color=""red"">"&trim(request("Keyword"))&"</font>]"
- elseif request("Range")="Down" Then
- WebLocation=WebLocation&"下载 - 关键字[<font color=""red"">"&trim(request("Keyword"))&"</font>]"
- elseif request("Range")="Others" Then
- WebLocation=WebLocation&"其他 - 关键字[<font color=""red"">"&trim(request("Keyword"))&"</font>]"
- end if
- end Function
- function WebContent(Keyword,Range)
- if Range="Void" then
- response.write "<center>请选择搜索范围</center>"
- exit function
- end if
- dim idCount
- dim pages
- pages=12
- dim pagec
- dim page
- page=clng(request("Page"))
- dim pagenc
- pagenc=5
- dim pagenmax
- dim pagenmin
- dim pageprevious
- dim pagenext
- dim datafrom
- dim datawhere
- select case Range
- case "Product"
- datafrom="Wygkcnflash_Products"
- datawhere="where ViewFlag"&Language&" and ProductName"&Language&" like '%"&KeyWord&"%'"
- case "News"
- datafrom="Wygkcnflash_News"
- datawhere="where ViewFlag"&Language&" and NewsName"&Language&" like '%"&KeyWord&"%'"
- case "Down"
- datafrom="Wygkcnflash_Download"
- datawhere="where ViewFlag"&Language&" and DownName"&Language&" like '%"&KeyWord&"%'"
- case "Others"
- datafrom="Wygkcnflash_Others"
- datawhere="where ViewFlag"&Language&" and OthersName"&Language&" like '%"&KeyWord&"%'"
- end select
- dim sqlid
- dim Myself,PATH_INFO,QUERY_STRING
- PATH_INFO = request.servervariables("PATH_INFO")
- QUERY_STRING = request.ServerVariables("QUERY_STRING")'
- if QUERY_STRING = "" then
- Myself = PATH_INFO & "?"
- elseif Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then
- Myself= PATH_INFO & "?" & QUERY_STRING & "&"
- else
- Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1)
- end if
- dim taxis
- taxis="order by id desc "
- dim i
- dim rs,sql
- set rs = server.createobject("adodb.recordset")
- sql="select count(ID) as idCount from ["& datafrom &"]" & datawhere
- set rs=server.createobject("adodb.recordset")
- rs.open sql,conn,0,1
- idCount=rs("idCount")
- if(idcount>0) then
- if(idcount mod pages=0)then
- pagec=int(idcount/pages)
- else
- pagec=int(idcount/pages)+1
- end if
- sql="select id from ["& datafrom &"] " & datawhere & taxis
- set rs=server.createobject("adodb.recordset")
- rs.open sql,conn,1,1
- rs.pagesize = pages
- if page < 1 then page = 1
- if page > pagec then page = pagec
- if pagec > 0 then rs.absolutepage = page
- for i=1 to rs.pagesize
- if rs.eof then exit for
- if(i=1)then
- sqlid=rs("id")
- else
- sqlid=sqlid &","&rs("id")
- end if
- rs.movenext
- next
- end if
- if(idcount>0 and sqlid<>"") Then
- sql="select * from ["& datafrom &"] where id in("& sqlid &") "&taxis
- set rs=server.createobject("adodb.recordset")
- rs.open sql,conn,0,1
- Response.Write "<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&VbCrLf
- Response.Write " <tr height=""32"">"&VbCrLf
- Response.Write " <td width=""550"" style=""color:#FFFFFF; font-weight:bold; background:url(Images/split.gif) no-repeat right center; background-color:#abacaf""> 信息标题</td>"&VbCrLf
- Response.Write " <td align=""center"" bgcolor=""#ABACAF"" style=""color:#FFFFFF; font-weight:bold"">发布日期</td>"&VbCrLf
- Response.Write " </tr>"&VbCrLf
- while not rs.eof
- select case Range
- case "Product"
- Response.Write " <tr height=""28"">"&VbCrLf
- Response.Write " <td style=""background:url(Images/bg2.gif) repeat-x left bottom;""> <img src=""images/arr.gif"" width=""11"" height=""14"" align=""absmiddle"" /> <a href=""ProductView.asp?ID="&rs("ID")&""">"&rs("ProductName"&Language)&"</a></td>"&VbCrLf
- Response.Write " <td align=""center"" style=""background:url(Images/bg2.gif) repeat-x left bottom; color:#999999"">"&FormatDate(rs("UpdateTime"),13)&"</td>"&VbCrLf
- Response.Write " </tr>"&VbCrLf
- case "News"
- Response.Write " <tr height=""28"">"&VbCrLf
- Response.Write " <td style=""background:url(Images/bg2.gif) repeat-x left bottom;""> <img src=""images/arr.gif"" width=""11"" height=""14"" align=""absmiddle"" /> <a href=""NewsView.asp?ID="&rs("ID")&""">"&rs("NewsName"&Language)&"</a></td>"&VbCrLf
- Response.Write " <td align=""center"" style=""background:url(Images/bg2.gif) repeat-x left bottom; color:#999999"">"&FormatDate(rs("Addtime"),13)&"</td>"&VbCrLf
- Response.Write " </tr>"&VbCrLf
- case "Down"
- Response.Write " <tr height=""28"">"&VbCrLf
- Response.Write " <td style=""background:url(Images/bg2.gif) repeat-x left bottom;""> <img src=""images/arr.gif"" width=""11"" height=""14"" align=""absmiddle"" /> <a href=""DownView.asp?ID="&rs("ID")&""">"&rs("DownName"&Language)&"</a>("&rs("FileSize")&")</td>"&VbCrLf
- Response.Write " <td align=""center"" style=""background:url(Images/bg2.gif) repeat-x left bottom; color:#999999"">"&FormatDate(rs("Updatetime"),13)&"</td>"&VbCrLf
- Response.Write " </tr>"&VbCrLf
- case "Others"
- Response.Write " <tr height=""28"">"&VbCrLf
- Response.Write " <td style=""background:url(Images/bg2.gif) repeat-x left bottom;""> <img src=""images/arr.gif"" width=""11"" height=""14"" align=""absmiddle"" /> <a href=""OtherView.asp?ID="&rs("ID")&""">"&rs("OthersName"&Language)&"</a></td>"&VbCrLf
- Response.Write " <td align=""center"" style=""background:url(Images/bg2.gif) repeat-x left bottom; color:#999999"">"&FormatDate(rs("UpdateTime"),13)&"</td>"&VbCrLf
- Response.Write " </tr>"&VbCrLf
- end select
- rs.movenext
- wend
- Response.Write "</table>"&VbCrLf
- else
- response.write "<center>暂无相关信息</center>"
- exit function
- end If
- Response.Write "<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&VbCrLf
- Response.Write " <tr height=""35"">"&VbCrLf
- Response.Write " <td align=""center"">"&VbCrLf
- Response.Write "共<strong style=""color:red"">"&idcount&"</strong>条记录 页次:<strong style=""color:red"">"&page&"</strong>/"&pagec&" 每页:<strong style=""color:red"">"&pages&"</strong>条记录" & vbCrLf
- pagenmin=page-pagenc
- pagenmax=page+pagenc
- if(pagenmin<1) then pagenmin=1
- 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> ")
- if page-(pagenc*2+1)<=0 then
- pageprevious=1
- else
- pageprevious=page-(pagenc*2+1)
- end if
- 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> ")
- if(pagenmax>pagec) then pagenmax=pagec
- for i = pagenmin to pagenmax
- if(i=page) then
- response.write (" <strong style=""color:red"">"& i &"</strong> ")
- else
- response.write ("[<a href=""search.asp?Page="& i &"&Range="&request("Range")&"&KeyWord="&Keyword&""">"& i &"</a>]")
- end if
- next
- if page+(pagenc*2+1)>=pagec then
- pagenext=pagec
- else
- pagenext=page+(pagenc*2+1)
- end if
- 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> ")
- 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>")
- Response.Write " </td>"&VbCrLf
- Response.Write " </tr>"&VbCrLf
- Response.Write "</table>"&VbCrLf
- rs.close
- set rs=nothing
- end function
- %>