<!--#include file="conn.asp"-->
<%Set rs = Server.CreateObject("ADODB.Recordset")
name=HtmlEncode(trim(request("keyword")))
if name="" then
	response.write "<SCRIPT language=JavaScript>alert('关键字不能为空!');"
	response.write "this.location.href='vbscript:window.close()';</SCRIPT>"
	response.end
end if

sql="select * from nyeee_qydata where name Like '%"& name &"%' or faren Like '%"& name &"%'  or yewu Like '%"& name &"%' or lei Like '%"& name &"%' or city Like '%"& name &"%' or http Like '%"& name &"%' or mail Like '%"& name &"%' or address Like '%"& name &"%' or youbian Like '%"& name &"%' or tel Like '%"& name &"%' or fax Like '%"& name &"%' or jieshao Like '%"& name &"%' order by id desc"
rs.open sql,conn,1,1

if rs.eof then
	response.write "<SCRIPT language=JavaScript>alert('对不起，没有找到符合条件的企业！');"
	response.write "this.location.href='vbscript:window.close()';</SCRIPT>"
   	response.end
else%>
<html>
<head>
<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">
<title>企业查找结果</title>
<style type="text/css">
<!-- 
td           { font-size: 12px; line-height: 17px }
body         { font-size: 12px; line-height: 17px }
p            { margin-top: 1px; margin-bottom: 1px }
-->
</style>
</head>

<body>
<div align="center">   
  <center>   
  <table border="0" width="755" cellspacing="0" cellpadding="0">
  <tr>                                      
      <td width="100%" colspan="5" height="30"><p align="center"><b><font style="font-size:14px">搜索关键字：<font color="red"><%=name%></font>&nbsp;&nbsp;以下是搜索结果：</font></p>                                                                                                                                     
        </b>                                                                                                                                     
      </td>                                           
    </tr>
    <tr>
    <td>
    <div align="center">
      <center>
    <table width="100%" bordercolor="#E0E0E0" border="2" cellpadding="2"> 
  <tr>
    <td width="8%" align="center" bgcolor="#E0E0E0">编号</td>
    <td width="26%" align="center" bgcolor="#E0E0E0">企业名称</td>
    <td width="35%" align="center" bgcolor="#E0E0E0">联系地址</td>
    <td width="11%" align="center" bgcolor="#E0E0E0">联系人</td>
    <td width="20%" align="center" bgcolor="#E0E0E0">联系电话</td>
  </tr>   
<%const maxperpage=50   
dim currentpage   
rs.pagesize=maxperpage   
currentpage=request.querystring("pageid") 
if not isnumeric(currentpage) then   
currentpage=1   
end if     
if currentpage="" then   
currentpage=1   
elseif currentpage<1 then   
currentpage=1   
else   
currentpage=clng(currentpage)   
	if currentpage > rs.pagecount then   
	currentpage=rs.pagecount   
	end if   
end if   
   
dim totalput,n   
totalput=rs.recordcount   
if totalput mod maxperpage=0 then   
n=totalput\maxperpage   
else   
n=totalput\maxperpage+1   
end if   
if n=0 then   
n=1   
end if   
rs.move(currentpage-1)*maxperpage   
i=0   
do while i< maxperpage and not rs.eof%>   
<tr>
    <td width="8%">
      <p align="center"><%=i+1%></p>
    </td>
    <td width="26%"><a href="../qyindex.asp?id=<%=rs("id")%>" target="_blank"><%=rs("name")%></a><%if session("admin")<>"" then%>&nbsp;&nbsp;<a href="edit.asp?id=<%=rs("id")%>&pageid=<%=currentpage%>"><font color="#008000">修改</font></a><%end if%><%if session("admin")<>"" then%>&nbsp;<a href="delqy.asp?id=<%=rs("id")%>&pageid=<%=currentpage%>"><font color="red">删</font></a><%end if%></td>
    <td width="35%">&nbsp;<%=rs("address")%></td>
    <td width="11%">&nbsp;<%=rs("faren")%></td>
    <td width="20%">&nbsp;<%=rs("tel")%></td>
  </tr>                                    
    <%i=i+1                                                                                        
    rs.movenext                                                                                         
    loop                                                                                                                  
    end if%> 
    </table>
      </center>
    </div>
    </td></tr>                                                                                    
    <tr>                                      
      <td width="100%" colspan="5" height="30"><p align="center"><b><font style="font-size:14px">页数：<%=currentpage%>/<%=n%>                                                                                     
   	<%k=currentpage                                                                                                                                         
   	if k<>1 then%>                                                                                            
   	<a href="searchqy.asp?pageid=1&keyword=<%=name%>">首页</a>                                                                                                                                         
   	<a href="searchqy.asp?pageid=<%=k-1%>&keyword=<%=name%>">上一页</a>                                                                                                                                         
   	<%else%>                                                                                                                     
   	首页&nbsp;上一页                                                                                                                                         
   	<%end if%>                                                                                            
   	<%if k<>n then%>                                                                                                                                         
   	<a href="searchqy.asp?pageid=<%=k+1%>&keyword=<%=name%>">下一页</a>                                                                                                                                         
   	<a href="searchqy.asp?pageid=<%=n%>&keyword=<%=name%>">尾页</a>                                                                                                                                         
   	<%else%>                                                                                                                     
   	下一页&nbsp;尾页                                                                                                                                         
   	<%end if%>                                                                                            
     共找到<font color="red"><%=totalput%></font>个单位</font></b></p>                                                                                                                                        
      </td>                                              
    </tr>                                           
  </table>                                                                                
</div>                                                                                                                                                               
</body>                                                                                       
</html>                            
                         
                         
                         
                         
                         
                         
                         
