⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search2.asp

📁 一个功能强大的黄页查询系统
💻 ASP
字号:
<!--#include file="dbpath/dbpath.asp"-->
<html>

<head>
<title>企业搜索</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style type="text/css"><!-- td           { font-size: 12px; line-height: 17px }
body         { font-size: 12px; line-height: 17px }
a:link       { text-decoration: none; color: blue }
a:visited    { text-decoration: none; color: #993333 }
a:active     { text-decoration: none }
a:hover      { text-decoration: underline; color: red }
-->
</style>
<script language="JavaScript">
function click(e) {
if (document.all) {
if (event.button==2||event.button==3) {
oncontextmenu='return false';
}
}
if (document.layers) {
if (e.which == 3) {
oncontextmenu='return false';
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
document.oncontextmenu = new Function("return false;")
</script>
<%
   dim MaxPerPage
   dim sql 
   dim rs
   dim gstBookID
   dim totalPut   
   dim CurrentPage
   dim TotalPages
    if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
%>
</head>

<body leftmargin="0" topmargin="0">
<div align="center">
<table border="0" width="426" cellspacing="0" cellpadding="0">
<center>
<tr>
</center>
<td bgcolor="#FFFFFF" width="254" valign="top">
<table border="2" width="100%" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF">
<tr>
<td width="100%">
<div align="center">
<center>
<table border="0" cellpadding="0" width="510">
</center>
<tr>
<td valign="top" width="443">
<p align="right"><font class="d"><a href="index.asp" target="_parent">回到首页</a></font> 
| <a href="new.asp" target="_parent">最新企业信息</a> | <a href="addgq.asp" target="_parent">发布企业信息</a> | 
<a href="login.asp" target="_parent">企业信息管理 </a>   
&nbsp;</td>  
</tr>  
<tr>  
<td width="443" valign="top"></td>  
</tr>  
<tr>  
<td width="443" valign="top">  
<table border="0" width="110%" cellspacing="0" cellpadding="0">  
<tr>  
<td width="100%">  
<table border="0" width="100%" cellspacing="0" cellpadding="0">  
<tr>  
<td width="100%"><%   
   
name=trim(request("keyword"))   
name=replace(name,"'","''")   
if name="" then   
   response.write"查找字符不能为空串,请重输入查找的信息<a href=""javascript:history.go(-1)"">返回重查</a>"   
   response.end   
else   
    sql="select * from gq where subject Like '%"& name &"%' or memo like '%"& name &"%' or phone like '%"& name &"%' or address like '%"& name &"%' or code like '%"& name &"%' or name like '%"& name &"%' or email Like '%"& name &"%'or gs Like '%"& name &"%'order by id desc"   
    Set rs= Server.CreateObject("ADODB.Recordset")   
    rs.open sql,conn,1,1   
end if   
 if rs.eof then   
   response.write"没有你要查找的信息<a href=""javascript:history.go(-1)"">返回重查</a>"   
   response.end   
else      
   if not isempty(request("page")) then   
      currentPage=cint(request("page"))   
   else   
      currentPage=1   
   end if   
   
   rs.pagesize=10   
   totalPut=rs.recordcount '记录总数    
   totalPage=rs.pagecount    
   MaxPerPage=rs.pagesize    
      if currentpage<1 then    
          currentpage=1    
      end if    
      if currentpage>totalPage then    
          currentpage=totalPage    
      end if    
   if currentPage=1 then    
      showpages    
      showContent    
      showpages1    
    else    
         if (currentPage-1)*MaxPerPage<totalPut then    
         rs.move  (currentPage-1)*MaxPerPage    
         dim bookmark    
         bookmark=rs.bookmark '移动到开始显示的记录位置    
         showpages    
         showContent    
         showpages1    
      else     
               
      end if    
   end if    
      rs.close    
end if    
set rs=nothing      
conn.close    
set conn=nothing      
    
sub showContent    
     dim i,j   
   
%>    
   
   
   
   
<br>  
<table width="510%" cellpadding="0">  
   
<% i=1   
       do while not (rs.eof or err)    
if i mod 2 <> 0 then     %>    
<tr>  
<%else%>   
<tr>  
<%end if%>   
<td width="100%">  
<ul>  
<li> <% if rs("gq")="企业名称" then%> <font color="#fc9603">【<%=rs("gq")%>】</font>             
                <%else%>          <font color="#079807">【<%=rs("gq")%>】</font> <%end if%>               
 <font color="#aa0000"><%=rs("subject")%></font> (<%=rs("date")%>?<%=rs("time")%>)<br>   
                <%=rs("gs")%>          <a href="open.asp?id=<%=rs("id")%>" target="_blank">【详细信息...】</a>   
</ul>   
</td>   
</tr>   
<%      
         
    if i>=MaxPerPage then exit do '循环时如果到尾部则先退出,如果记录达到页最大显示数,也退出      
   i=i+1      
    rs.movenext      
    loop      
%>    
<tr>   
<td>    
</table>   
     
      <%end sub       
      
sub showpages()      
%>     
<table width="98%">   
<tr>   
<td align="right">共查询到<font color="#FF0000"><%=totalPage%></font>页/<font color="red"><b><%=totalPut%></b></font>条信息</td>   
</tr>   
</table>   
<%      
end sub      
sub showpages1()      
dim n      
n=totalPage      
%>     
     
<p align="right"> </p>   
<form action="search.asp" method="GET" align="right">   
<div align="center">   
<center>   
<table border="0" cellspacing="0" cellpadding="0" height="30">   
<tr>   
<td width="100%" height="30"> <%       
   If currentPage <> 1 Then      
      Response.Write "<A HREF=search.asp?keyword="&request("keyword") & ">[第一页]</A> "      
      Response.Write "<A HREF=search.asp?keyword="&request("keyword") & "&Page=" & (currentPage-1) & ">[上一页]</A> "      
   End If      
   If currentPage <> rs.PageCount Then      
      Response.Write "<A HREF=search?keyword="&request("keyword") & "&Page=" & (currentPage+1) & ">[下一页]</A> "      
      Response.Write "<A HREF=search.asp?keyword="&request("keyword") & "&Page=" & totalPage & ">[最后一页]</A> "      
   End If      
%>第<font color="#FF0000"><%=currentPage%></font>页/共<font color="#FF0000"><%=totalPage%></font>页<%   response.write " 转到:<select name='page' size=1 class=smallselsect style='font-family: 宋体; font-size: 9pt;'>"      
      
for i=1 to n      
   response.write "<option value="& i       
   if currentpage=i then       
     response.write " selected"      
   end if      
   response.write ">"& i &"</option>"      
next      
  response.write "</select>"      
  response.write "<input type='hidden' name='keyword' value="&request("keyword")&">"     
   response.write "&nbsp;<input class=buttonface type='submit'  value='确定'  style='font-family: 宋体; font-size: 9pt;'>"      
%> </td>   
</tr>   
</table>   
</center>   
</div>   
</form>   
     
<%end sub%>     
</td>   
</tr>   
</table>   
</td>   
</tr>   
</table>   
</td>   
</tr>   
</table>   
</div>   
<center>   
</center></td>   
</tr>   
</table>   
</td>   
</tr>   
</table>   
</div>                    
</body>   
   
</html>   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -