<!--#include file="head.asp"-->

<!-- 这里是主题 -->
<%
Set rs = Server.CreateObject("ADODB.Recordset")
name=HtmlEncode(trim(request("keyword")))
thelei=HtmlEncode(trim(request("lei")))
thecity=HtmlEncode(trim(request("city")))

if name="" then

if thelei="不限行业类别" and thecity="不限区域" then
sql="select * from nyeee_qydata where mark='1' order by id asc"
rs.open sql,conn,1,1
end if

if thelei="不限行业类别" and thecity<>"不限区域" then
sql="select * from nyeee_qydata where mark='1' and city='"&thecity&"' order by id asc"
rs.open sql,conn,1,1
end if

if thelei<>"不限行业类别" and thecity="不限区域" then
sql="select * from nyeee_qydata where mark='1' and lei='"&thelei&"' order by id asc"
rs.open sql,conn,1,1
end if

if thelei<>"不限行业类别" and thecity<>"不限区域" then
sql="select * from nyeee_qydata where mark='1' and lei='"&thelei&"' and city='"&thecity&"' order by id asc"
rs.open sql,conn,1,1
end if

else 

if thelei="不限行业类别" and thecity="不限区域" then
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 &"%') and mark='1' order by id asc"
rs.open sql,conn,1,1
end if

if thelei="不限行业类别" and thecity<>"不限区域" then
sql="select * from nyeee_qydata where (name Like '%"& name &"%' or faren Like '%"& name &"%'  or yewu Like '%"& name &"%' or lei 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 &"%') and mark='1' and city='"&thecity&"' order by id asc"
rs.open sql,conn,1,1
end if

if thelei<>"不限行业类别" and thecity="不限区域" then
sql="select * from nyeee_qydata where (name Like '%"& name &"%' or faren Like '%"& name &"%'  or yewu 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 &"%') and mark='1' and lei='"&thelei&"' order by id asc"
rs.open sql,conn,1,1
end if

if thelei<>"不限行业类别" and thecity<>"不限区域" then
sql="select * from nyeee_qydata where (name Like '%"& name &"%' or faren Like '%"& name &"%'  or yewu 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 &"%') and mark='1' and lei='"&thelei&"' and city='"&thecity&"' order by id asc"
rs.open sql,conn,1,1
end if

end if

if rs.eof then
	response.write "<SCRIPT language=JavaScript>alert('对不起，没有找到符合条件的企业！');"
	response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
   	response.end
else
%>

<div align="center">        
  <center>  
  <table border="0" width="760" cellspacing="0" cellpadding="0">          
  <tr>          
    <td width="560" valign="top">        
  <div align="center">
    <center>     
    <table border="0" width="550" cellspacing="0" cellpadding="0">
    <tr>                                      
      <td height="29" bgcolor="#D9E1F7" align="center"><% if name="" then %>您没有输入搜索关键字，以下是搜索结果：<% else %>您输入的关键字是：<font color="red"><%=name%></font>&nbsp;                             
        以下是搜索结果：<% end if %>（按加入的先后顺序排序）
		</td>                                                    
    </tr>                  
<%            
const maxperpage=20            
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       
red_name = replace(rs("name"),name,"<font color=#ff0000>"&name&"</font>") 
if rs("jieshao")<>"" then  
red_jieshao = replace(rs("jieshao"),name,"<font color=#ff0000>"&name&"</font>")
shuzu=split(red_jieshao,"<br>") 
red_jieshao=shuzu(0)   
else
red_jieshao="&nbsp;&nbsp;&nbsp;&nbsp;企业详细资料暂缺！"
end if               
%>            
<tr>                            
      <td width="100%">                            
      </td>                            
    </tr>                            
    <tr>                            
      <td width="100%" height="25"><a href="qyindex.asp?id=<%=rs("id")%>" target="_blank"><font color="#800000" style="font-size:14px"><b><%=red_name%></b></font></a>&nbsp;<font color="#FF9900">[<%=rs("date")%>]</font><% if rs("tuijian")="yes" then %>&nbsp;&nbsp;<img src="images/star.gif">  
        <b><font color="#FF0000">推荐企业</font></b><% end if %></td>                                 
    </tr>                                 
    <tr>                                 
      <td width="100%">                                 
        <div align="center">     
          <center>                                 
        <table border="0" width="100%" cellspacing="0" cellpadding="0">                                 
          <tr>                                 
            <td width="100%">&nbsp;&nbsp;<% if len(red_jieshao)>160 then %><%=left(red_jieshao,160)&"..."%><% else %><%=red_jieshao%><% end if %></td>                                 
          </tr>                                 
        </table>                                 
          </center>     
        </div>     
      </td>                                 
    </tr>                                 
    <tr>                                 
      <td width="100%"><font color="#006699">（<%=rs("city")%>&nbsp;-&nbsp;<%=rs("lei")%>）</font></td>                                 
    </tr>
    <tr>                                       
      <td width="100%" height="10">                                       
      </td>                                       
    </tr>                                             
    <%                                                                                                                   
    i=i+1                                                                                                 
    rs.movenext                                                                                                  
    loop                                                                                                                           
    end if      
    rs.close                                                                               
    %>         
    <tr>                                               
      <td width="100%" colspan="5" height="25" bgcolor="#D9E1F7"><p align="center">页数：<%=currentpage%>/<% =n%>                                                                                              
   	<%k=currentpage                                                                                                                                                   
   	if k<>1 then%>                                                                                                      
   	<a href="qysearch.asp?pageid=1&keyword=<%=name%>&lei=<%=thelei%>&city=<%=thecity%>">首页</a>                                                                                                                                                   
   	<a href="qysearch.asp?pageid=<%=k-1%>&keyword=<%=name%>&lei=<%=thelei%>&city=<%=thecity%>">上一页</a>                                                                                                                                                   
   	<%else%>                                                                                                                               
   	首页&nbsp;上一页                                                                                                                                                   
   	<%end if%>                                                                                                      
   	<%if k<>n then%>                                                                                                                                                   
   	<a href="qysearch.asp?pageid=<%=k+1%>&keyword=<%=name%>&lei=<%=thelei%>&city=<%=thecity%>">下一页</a>                                                                                                                                                   
   	<a href="qysearch.asp?pageid=<%=n%>&keyword=<%=name%>&lei=<%=thelei%>&city=<%=thecity%>">尾页</a>                                                                                                                                                   
   	<%else%>                                                                                                                               
   	下一页&nbsp;尾页                                                                                                                                                   
   	<%end if%>                                                                                                      
     共找到 <%=totalput%> 家单位</p>                                                                                                                                                  
      </td>                                                        
    </tr>         
    </table>         
       </center>  
    </div>  
  </td>   
  <td width="200" valign="top">  
  <!--#include file="ad1.asp"-->  
  </td>  
  </tr></table>                        
<!--#include file="qysearchdown.htm"-->
</div>
<!--#include file="foot.asp"-->