<% data_path="../" 'ACC连接数据库路径，对SQL无效 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<!--#include file="../conn/conn.asp"-->
<!--#include file="../inc/safe.asp"-->
<!--#include file="../inc/headtop.asp"-->
<title><%=webname%>公司库搜索</title>
<link rel='stylesheet' href="../News/new.css" type='text/css'/>
<%
   	 seakind=Replace_Text(request("seakind"))
  	 '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	'处理种类的id号 
 	sortid=Replace_Text(request("p_z_Z_RootCategory")) 
	if   Replace_Text(request("p_z_Z_CategoryId1"))<>"" then
  	   CategoryId=split(Replace_Text(request("p_z_Z_CategoryId1")),",")
 	 typeid=CategoryId(0)                                                                 '第二类
 	 if ubound(CategoryId)>=1 then
	 typeid_2=CategoryId(1)                                                               '第三类     
		else
	 typeid_2=0
		end if
 		if typeid="" then
		typeid=0
		end if
		if typeid_2="" then
		typeid_2=0
		end if
	  end if
	'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 	keywords=replace_text(request("keywords"))
 	proadd=replace_text(request("proadd"))
  	country=Replace_Text(request("country1"))
	sf=Replace_Text(request("province"))
	city=Replace_Text(request("city"))
	DateTime=replace_text(request("DateTime"))
    comkind=replace_text(request("comkind"))
      sadddate=month(date())
	  
	  
'

	If Database_type=1 Then

sql="select * from Websen_corporation left join Websen_history_price  on   Websen_corporation.id=Websen_history_price.gsid  and Websen_history_price.keywords = '"&keywords&"' and  month(Websen_history_price.begintime)="&sadddate&"   where Websen_corporation.flag=1"

else
sql="select * from Websen_corporation where  flag=1"
end if
  if keywords<>"" then sql=sql&" and (Websen_corporation.zycp like '%"&keywords&"%' or Websen_corporation.qymc like '%"&keywords&"%'  )" 
   if Chkrequest(sortid)   then
	if sortid<>0 then
	 sql=sql&" and Websen_corporation.sortid="&sortid&""
 	if Chkrequest(typeid) then 
	sql=sql&" and Websen_corporation.typeid="&typeid&""
	end if
	if Chkrequest(typeid_2) then 
	sql=sql&" and Websen_corporation.typeid_2="&typeid_2&""
    end if
   end if
  end if
if country<>"" then sql=sql&" and Websen_corporation.country like '%"&country&"%'"
if sf<>"" then sql=sql&" and Websen_corporation.sf like '%"&sf&"%'"
if city<>"" then sql=sql&" and Websen_corporation.city like '%"&city&"%'"

if comkind<>"all" then sql=sql&" and Websen_corporation.qylb like '%"&comkind&"%'"

	If Database_type=1 Then

   sql=sql&"   order by Websen_history_price.price desc,Websen_corporation.trust_score desc,websen_corporation.id desc  "
   else
    sql=sql&"  order by trust_score desc,websen_corporation.id desc "

   end if
 
 Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1 

msg_per_page=20 '定义每页显示记录条数
%>
  
<!--#include file="../inc/headpage.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
	 function subcheck()
	 {
  	var str=document.form.keywords.value;
	if(str.replace(/\s+/g,"")==""||str=="请输入关键字")
	{
	//alert("请输入关键字！");
	//document.form.keywords.focus();
	//return false;
	}
	 }
	 
</script><SCRIPT language=javascript> 
<!-- Hide 
function killErrors() { 
return true; 
} 
window.onerror = killErrors; 
 // --> 
</SCRIPT>
</head>
<body>
 <div class="clear"></div>
<div id='yabock'>
  <div class='mulur'>搜索选项
  </div>
  <div class='fenli'>
    <table width="952"  border="0" cellpadding="0" cellspacing="0" >
        <form action="<%=HOPE_InstallDir%>search/searchcom.asp" method="post" name="form" id="form" onsubmit="return subcheck();">
           <tr>
            <td valign="top">
              &nbsp;关键字：
              &nbsp;
              <input name="keywords" type="text" id="keywords"  onfocus="if(this.value=='请输入关键字'){this.value='';}" onblur="this.value=this.value.replace(/\s/g,'')" value=""   maxlength="25" style=" border: 1px #7F9DB9 solid; height: 18px" />
              &nbsp; 所属类别：
              <select name="p_z_Z_RootCategory" onchange="changeCategory(this)"  >
                <option value="0" selected="selected">--请选择行业大类--</option>
              </select>
              <select name="p_z_Z_CategoryId1" maxlength="80">
                <option value="0" selected="selected">--请选择行业子类--</option>
              </select>
              <br />
              <br /> 
              &nbsp;时&nbsp; 间：
              &nbsp; <select name="DateTime" size="1">
                <option value="all" selected="selected">显示所有</option>
                <option  value="ok" >显示所有未过期</option>
                   <option value="10">显示最近10天</option>
                <option  value="30">显示最近30天</option>
                 <option  value="no">显示所有过期</option>
              </select>
              &nbsp;&nbsp;&nbsp;地 &nbsp;&nbsp; 区：
               <select style="WIDTH: 90px"   onchange="javascript:changeCountry1(this);" name="country1">
              </select>
              &nbsp; <select style="WIDTH: 60px"  onchange="changeProvince(this);" name="province">
                <option value=""   selected="selected">省份</option>
              </select>
               <select name="city">
                <option value="" selected="selected">地 级</option>
              </select>
             &nbsp;  <input type="submit"  name="seabtn"  value="立即搜索">
             <br /></td>
          </tr>
        </form>
    </table>
  </div>
</div>
<table width="783" height="10" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>
<div id="stecy">
  <div class="bodyet">
    <div class="titep">
      <div class="zlu"></div>
      <div class="zle">搜索结果列表</div>
      <div class="zla"></div>
    </div>
    <div id="lacket">
      <div class="Sclass1"></div>
      <div class="Sclass2">供应信息/公司</div>
      <div class="Sclass3">会员等级</div>
      <div class="Sclass4">网胜通指数</div>
      <div class="Sclass5">在线商务</div>
    </div>
    <div class="lacket_LAS">
	<%
if rs.eof then
response.Write"<table width=""100%""  border=""0"" cellspacing=""0"" cellpadding=""0"">"
response.Write"<tr><td class=buttoncolor2 align=left>"
response.Write"<br><b>&nbsp;您查找的<font color=red>“"&keywords&"”</font>的信息暂时没有找到</b><br><br>"
response.Write"</tr></table>"
response.Write"<table width=""100%""  border=""0"" cellspacing=""0"" cellpadding=""0"" class=blackborder>"
response.Write"<tr><td class=""lh17 c"">"
response.Write"· 缩短或更换搜索关键字后重新搜索<span class=""S""><font color=""#666666"">（例：将“网盛电子商务网”改为“网盛”后重新搜索）,对类别和范围做调整查询！</font></span>；<br><br>" 
response.Write"· 您也可以<input name=""postOffer"" type=""button"" value=""修改自己的公司介绍"" onclick=location.href="""&HOPE_InstallDir&"member/corporation/company_edit.asp"" style=' border-color:#ffffff'>让客户更快的找到你，让他们找上门！<br><br><br> </td>"
response.Write"</tr></table>"
else
%>
	<table bordercolor="#d6dde2" cellspacing="0" bordercolordark="#ffffff" cellpadding="0" width="750" align="center" border="1">
  <tbody>
    <tr>
      <td width="100%" bgcolor="#ffffff"><table width="750"  border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td valign="top"><table width="100%" border="0" align="center" cellpadding="1" cellspacing="0" style="BORDER-TOP: #9C9A9C 1px solid;BORDER-Bottom: #9C9A9C 1px solid">
            <tr> </tr>
            </table></td>
          </tr>
      </table>
        <table width="100%" height="21" border="0" align="center" cellpadding="0" cellspacing="1">
          <tbody>
            <tr>
              <td height="1"></td>
              <td width="40%"></td>
              <td width="8%"></td>
              <td width="8%"></td>
              <td width="10%"></td>
              <td width="10%"></td>
            </tr>
        
        <%
do while not rs.eof and rowcount > 0
%><TR>
<TD align=middle width='10%'>
<FONT color=red ><%=rs("trust_score")%></FONT>
</TD>
<TD width=""40%"" class=cate style=""WORD-BREAK: break-all"">
<%
	   Set re = New RegExp
		re.Pattern ="("&keywords&")"
		re.IgnoreCase = True
		re.Global=True
		result = re.Replace(rs("qymc"), "<font color=red>$1</font>") 
'--是否使用的名片页------------------------------------------------------------
	   set rsmp=server.CreateObject("adodb.recordset")
	   sqlmp="select * from Websen_vipgrade where roleid="&rs("gradeid")
	   rsmp.open sqlmp,conn,1,1
	   if not rsmp.eof  then 
  	   if instr(rsmp("rolelist"),"qw")>0 then		
	   

	   
		 if is2weburl=1 then
		response.write"<A href=http://"&rs("user")&"."&weburl1&" target=_blank class=m style='text-decoration:underline'><STRONG>"&result&"</STRONG></A>"&vbCrlf 
		else
		response.write"<A href="""&HOPE_InstallDir&"vipcom/"&rs("user")&""" target=_blank style='text-decoration:underline' class=m><STRONG>"&result&"</STRONG></A>"&vbCrlf 
		end if
		 else
		response.write"<A href="""&HOPE_InstallDir&"Ptcom/"&rs("user")&".html"" style='text-decoration:underline' target=""_blank"" class=M><b>"&result&"</b></A>"&vbCrlf
		end if
		 rsmp.close
		end if
		
response.write"<BR><font color=""#666666"">（"
if rs("country")="中国" then
response.write""&rs("sf")&""&rs("city")&""
else
response.write""&rs("country")&""
end if
response.write"）"
response.write"</FONT><FONT color=#666666>&nbsp;"
c="select * from Websen_cor_format where id="&rs("p_z_Z_LegalStatus")&""
set rsc=server.CreateObject("adodb.recordset")
rsc.open c,conn,1,1 
if not rsc.eof then response.write""&rsc("title")&"&nbsp;"
rsc.close
set rsc=nothing

'--是否使用的名片页------------------------------------------------------------
	   set rsmp1=server.CreateObject("adodb.recordset")
	   sqlmp1="select * from Websen_vipgrade where roleid="&rs("gradeid")
	   rsmp1.open sqlmp1,conn,1,1
	   if not rsmp1.eof  then 
 
	   if instr(rsmp1("rolelist"),"qw")>0 then		

 if is2weburl=1 then
 response.write" <a href=http://"&rs("user")&"."&weburl1&"  target=""_blank""><FONT color=#666666>查看该会员企业网站</font></a>"
else
response.write" <a href="""&HOPE_InstallDir&"vipcom/"&rs("user")&""" target=""_blank""><FONT color=#666666>查看该会员企业网站</font></a>"
 end if
  end if
  rsmp1.close
  end if
  
response.write"</FONT><BR>"&vbCrlf
   
		Set re1 = New RegExp
		re1.Pattern ="("&keywords&")"
		re1.IgnoreCase = True
		re1.Global=True
		if rs("zycp")<>"" then 
		result1 = re1.Replace(rs("zycp"), "<font color=red>$1</font>") 
		else
		result=""
		end if
 response.write" <font class=s color=666666>主营:"&result1&"</FONT> <BR>"&vbCrlf
 
		 Set re2 = New RegExp
		re2.Pattern ="("&keywords&")"
		re2.IgnoreCase = True
		re2.Global=True
		if rs("qyjj")<>"" then
		result2 = re2.Replace(rs("qyjj"), "<font color=red>$1</font>") 
		
		else
		result2=""
		end if
response.write" <font color=""#666666"" class=s>"&left(result2,40)&"<font color=#666666>……</font></font> "
 
 response.Write("<br>经营模式:"&rs("qylb")&"")
 %>
</TD>
<TD width=""10%"" class=cate style=""WORD-BREAK: break-all"" align=center>
<%
 if rs("p_z_Z_EstablishedYear")="" then
response.write"未提供"&vbCrlf
else
response.write""&rs("p_z_Z_EstablishedYear")&""&vbCrlf
end if
%>
</TD>

<TD width=""10%"" class=S align=center><%
				  set rsmp1=server.CreateObject("adodb.recordset")
	       		  sqlmp1="select * from Websen_vipgrade where roleid="&rs("gradeid")
	   			  rsmp1.open sqlmp1,conn,1,1
	   			  FileFlag=rsmp1("FileFlag")
	   			  if not rsmp1.eof  then
	      		  if instr(rsmp1("rolelist"),"qw")>0 then			
	              '用于二级域名处理^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	              end if
	              %>
  <img border="0" src="../../UploadFile/vipgrade/<%=rsmp1("FileFlag")%>" width="20" />
  <% rsmp1.close
			 	  end if%></TD>
<TD width=""10%""class=S align=center><font color="red"><%=rs("trust_score")%></font></TD>
<TD width=""10%""class=S align=center><%If rs("tm")<>"" then%>
  <a target="blank" href="http://wpa.qq.com/msgrd?V=1&amp;Uin=<%=rs("tm")%>Site=www.websen.net&amp;Menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=1:<%=rs("tm")%>:1" alt="点击这里给我发消息" /></a><br />
  <br />
  <%end if%>
  <%if rs("country")="中国" then response.write""&rs("sf")&""&rs("city")&"" else response.write""&rs("country")&"" end if%></TD>
</TR>
<%

icolor=icolor+1
if icolor>1 then icolor=0
rowcount=rowcount-1
rs.movenext
loop
end if
%>  </tbody>
        </table>
        <br />
        <table width="100%" 
        border="0" cellpadding="4" cellspacing="0" style="BORDER-TOP: #9C9A9C 1px solid;BORDER-Bottom: #9C9A9C 1px solid">
          <tbody>
            <tr>
              <td class="m" align="middle"><%=listPages(""&HOPE_InstallDir&"search/searchcom.asp?sortid="&sortid&"&typeid="&typeid&"&typeid_2="&typeid_2&"&keywords="&keywords&"&comkind="&comkind&"&country1="&country&"&province="&sf&"&city="&city&"&datetime="&datetime)%></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
            </tr>
          </tbody>
      </table></td>
    </tr>
  </tbody>
</table> </div>
  </div>
  <div class="bodyat">
    <div class="zhanwei"></div>
    <div class="guangao">
      <p>
        <script src="/ads/JS/200817142139.js"></script>
      </p>
      <p>
        <script src="/ads/JS/20081491217.js"></script>
      </p>
      <p>
        <script src="/ads/JS/200814151336.js"></script>
      </p>
    </div>
  </div>
</div>

<script>
     function Category(id,title) {
			this.id = id;
			this.title=title;
			this.boardlist=new Array();
			this.addBoard=addBoard;
			this.getOptions = getOptions;
        }        
       function addBoard(board) {
            this.boardlist = this.boardlist.concat(board);
        }
       function getOptions() {
			var tmp = new Array();
			for(var i=0; i < this.boardlist.length;i++) {
			var b = this.boardlist[i];
			tmp[i]= b.getOption();
			}
			return tmp;
        }
      function Board(catid,id,title,total) {                
			this.catid=catid;
			this.id=id;
			this.title=title;
			this.getOption=getOption;
        }
     function getOption() {
       return new Option(this.title,this.id);                
        }
     function changeCategory(list) {
        if (list.selectedIndex<=0) {
                catForm.options[0].selected=true;
                var len = boardForm.options.length;
                for (var i=len-1;i>0;i--){
                        boardForm.options[i]=null;
                }                                        
         }
        else {
                var boards = catArr[list.selectedIndex-1].getOptions();
                var len = boardForm.options.length;
                for (var i=len-1;i>0;i--){
                        boardForm.options[i]=null;
                }                
                for (var i=0;i<boards.length;i++) {
                        boardForm.options[i+1]=boards[i];
                }
                }
                boardForm.options[0].selected=true;
        }
     function selectBoard(catid,bid,list) {
		var isExist = false; //是否是叶子类目
		for(var i=0;i<catForm.length;i++) {
				if (catForm.options[i].value==catid) {
						//alert("get Category");
						catForm.options[i].selected=true;
						changeCategory(catForm);
						break;                        
				}                        
		}                                
		for(var i=0;i<boardForm.length;i++) {
				if (boardForm.options[i].value==bid) {
						//alert("get Board");
						boardForm.options[i].selected=true;  
						isExist = true;                              
						break;
				}                        
		}   
		 if (!isExist) {//如果是二级类目，则下拉框只显示该二级类目下所有类目                   
			var boards = catArr[catForm.selectedIndex-1].getOptions();
			var len = boardForm.options.length;
			for (var i=len-1;i>0;i--){
				boardForm.options[i]=null;
			}     
			var locate = 1;           
			for (var i=0;i<boards.length;i++) {                                                              
				if(boards[i].text.indexOf(bid) == 0){
					boardForm.options[locate]=boards[i];
					locate++;
				}                                                
			}
			 boardForm.options[0].selected=true;   
		}            
        }        
	  var catArr = new Array();
	  var cur;   
	  var catForm = document.form.p_z_Z_RootCategory;
	  var boardForm = document.form.p_z_Z_CategoryId1;
    function showCategorys() {
		var catId = catForm.value
		if(boardForm.value){
			catId = boardForm.value
		}else if(catForm.value){
			catId = catForm.value
		}
	   }
        for (var i=0;i<catArr.length;i++) {
          catForm.options[i+1]=new Option(catArr[i].title,catArr[i].id);
        }
     function initRootCategorys(){
	    for (var i=0;i<catArr.length;i++) {
	    catForm.options[i+1]=new Option(catArr[i].title,catArr[i].id);
	    }
	}  
 </script>
<script src="<%=HOPE_InstallDir%>js/allCategorys.js"></script>
<script>
initRootCategorys(); 
</script>
 <SCRIPT language=javascript src="<%=HOPE_InstallDir%>js/area.js" purpose="INITIALIZER"></SCRIPT>
 <SCRIPT language=javascript>
 <!--
     for (var i=0;i<5;i++){
	    if (country1Form1.options[i].value == '<%=country%>'){
		    country1Form1.options[i].selected=true;
		}
	}
     for (var i=0;i<catArr1.length;i++) {
		catForm1.options[i+1]=new Option(catArr1[i].title,catArr1[i].id);
 		if(catForm1.options[i+1].value == '<%if country="中国" then response.write""&sf&""%>'){
	        	catForm1.options[i+1].selected=true;
	        }
	}
	changeProvince(catForm1);
	var len = boardForm1.options.length;
	for (var i=0;i<len;i++) {
 		if(boardForm1.options[i].value == '<%if country="中国" then response.write""&city&""%>') {
		    boardForm1.options[i].selected=true;
		}
	}
     if (country1Form1.options[country1Form1.selectedIndex].value!='中国') {
	    catForm1.style.display = 'none';
	    boardForm1.style.display = 'none';
		}
     for (var i=0;i<9;i++){
       if (document.form.DateTime[i].value =='<%=datetime%>'){
            document.form.DateTime[i].selected = true;
        }
    }
-->
</SCRIPT> 
 <div class="nav_950">
   <!--#include file="../inc/end.asp"-->
 </div>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>