<% 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"-->
<link rel='stylesheet' href="../News/new.css" type='text/css'/>


<!--#include file="../inc/headtop.asp"-->
<title><%=webname%>求购搜索</title>

<%
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"))
 	'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     sadddate=month(date())
	If Database_type=1 Then

 sql="select Websen_info.*,Websen_corporation.id,Websen_corporation.flag as corflag,Websen_corporation.qymc,Websen_corporation.tm,Websen_corporation.[user],Websen_corporation.gradeid,Websen_corporation.country,Websen_corporation.sf,Websen_corporation.city,Websen_corporation.web,Websen_corporation.url,Websen_corporation.trust_score from   Websen_Info     join Websen_corporation on     Websen_info.type='买' and Websen_corporation.id=Websen_info.gsid and Websen_info.flag=1"
else
 sql="select Websen_info.*,Websen_corporation.id,Websen_corporation.flag as corflag,Websen_corporation.qymc,Websen_corporation.tm,Websen_corporation.[user],Websen_corporation.gradeid,Websen_corporation.country,Websen_corporation.sf,Websen_corporation.city,Websen_corporation.web,Websen_corporation.url,Websen_corporation.trust_score from Websen_Info,Websen_corporation where Websen_info.type='买' and Websen_corporation.id=Websen_info.gsid and Websen_info.flag=1"
 end if
if Chkrequest(sortid)   then
	if sortid<>0 then
	 sql=sql&" and Websen_info.sortid="&sortid&""
 	if Chkrequest(typeid) then 
	sql=sql&" and Websen_info.typeid="&typeid&""
	end if
	if Chkrequest(typeid_2) then 
	sql=sql&" and Websen_info.typeid_2="&typeid_2&""
	 end if
	 end if
 end if
	if keywords<>"" then sql=sql&" and (Websen_info.keywords like '%"&keywords&"%' or Websen_info.showname like '%"&keywords&"%'    )"
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 datetime<>"" then
	  if datetime<>"all" then 
  		If Database_type=1 Then
 	  
  			if datetime="no" then 
			sql=sql&" and datediff(day,Websen_info.infoenddate,getdate())>0"
			elseif datetime="ok" then
			sql=sql&" and datediff(day,Websen_info.infoenddate,getdate())<=0"
			elseif datetime="10" then 
			sql=sql&" and datediff(day,Websen_info.infoenddate,getdate())<=10"
			elseif datetime="30" then 
			sql=sql&" and datediff(day,Websen_info.infoenddate,getdate())<=30"
 			end if
  		else
			if datetime="no" then 
			sql=sql&" and datediff('d',Websen_info.infoenddate,now())>0"
			elseif datetime="ok" then
			sql=sql&" and datediff('d',Websen_info.infoenddate,now())<=0"
			elseif datetime="10" then 
			sql=sql&" and datediff('d',Websen_info.infoenddate,now())>=10"
			elseif datetime="30" then 
			sql=sql&" and datediff('d',Websen_info.infoenddate,now())<=30"
			end if
		end if
	 end if
   end if
   	If Database_type=1 Then

   	 	 sql=sql&"    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&" order by Websen_history_price.price desc,Websen_corporation.trust_score desc,websen_Info.dateandtime desc   "
    else
	
	sql=sql&"    order by Websen_corporation.trust_score desc,websen_Info.dateandtime desc "
	end if
 	
 Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1 

msg_per_page=20 '定义每页显示记录条数
%>
<!--#include file="../inc/headpage.asp"-->

 <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> 
<SCRIPT language=JavaScript src="<%=HOPE_InstallDir%>mall.js"  type=text/JavaScript></SCRIPT>
</head>
<body>
 <DIV id=popImageLayer 
style=" background-color:#F6F6F6;BORDER-RIGHT: orange 1pt none; BORDER-TOP: orange 1pt none; VISIBILITY: hidden; BORDER-LEFT: orange 1pt none; WIDTH: 180px; CURSOR: hand; BORDER-BOTTOM: orange 1pt none; POSITION: absolute; HEIGHT: 180px" 
align=center calss="" name="popImageLayer"></DIV>
 <!--最近搜索处理------------------------------------------------------------------------->
 <!---------------------------------------------------------------------------------------->
 <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/searchbuy.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>
<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">
    <table width="750"  border="0" cellspacing="0" cellpadding="0" align="center">
      <tr>
        <td width="581" valign="top"><%
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="&HOPE_PageWidth&"  border=""0"" cellspacing=""0"" cellpadding=""0"" class=blackborder>"
response.Write"<tr><td  >"
response.Write"· 缩短或更换产品名后重新搜索 <font color=""#666666"">(例:将“彩色电视机”改为""电视机""后重新搜索),对类别和范围做调整查询！</font><br><br>" 
response.Write"· 您也可以<input name=""postOffer"" type=""button"" value=""立即发布供求信息"" onclick=location.href="""&HOPE_InstallDir&"member/"" style=' border-color:#ffffff'>告诉客户您需要什么，让他们找上门！<br><br><br> </td>"
response.Write"</tr></table>"
else
%>
          <%
do while not rs.eof and rowcount > 0

if trim(rs("draw")&"ok")="ok" and trim(rs("draw1")&"ok")="ok"  and trim(rs("draw2")&"ok")="ok" then 
		   PTpic=HOPE_InstallDir&"UploadFile/nopicture.gif"
		   else
		      if trim(rs("draw1"))<>"" and  trim(rs("draw2"))<>""  and trim(rs("draw"))<>"" then 
		       PTpic=HOPE_InstallDir&"Vipcom/"&rs("User")&"/"&rs("draw")
			  elseif trim(rs("draw2"))="" and trim(rs("draw1"))="" then
			    PTpic=HOPE_InstallDir&"Vipcom/"&rs("User")&"/"&rs("draw")
			  elseif trim(rs("draw2"))="" and trim(rs("draw"))="" then
				 PTpic=HOPE_InstallDir&"Vipcom/"&rs("User")&"/"&rs("draw1")
			  else
			     PTpic=HOPE_InstallDir&"Vipcom/"&rs("User")&"/"&rs("draw2")
			  end if 
		   end if 
%>
            <table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
              <tbody>
                <tr <%if icolor=0 then response.write"bgColor=#ffffff" else response.write"bgColor=#f6f6f6" end if%> onmouseover="this.style.backgroundColor='#FFF8F4'" onmouseout="this.style.backgroundColor='<%if icolor=0 then response.write"#ffffff" else response.write"#f6f6f6" end if%>'">
                  <td width="13%" align="middle"><table class="porductborder" height="64" cellspacing="0" cellpadding="0" width="64" 
      border="0">
                      <tbody>
                        <tr>
                          <td align="middle"><a class="M"  href="<%=HOPE_InstallDir%>seller/offerdetail/<%=rs("sortid")%>-<%=rs("typeid")%>-<%=rs("typeid_2")%>-<%=rs("info_id")%>.html"  target="_blank"> <img    onmouseover="popImage(this,'<%=PTpic%>','<%=HOPE_InstallDir%>seller/offerdetail/<%=rs("sortid")%>-<%=rs("typeid")%>-<%=rs("typeid_2")%>-<%=rs("info_id")%>.html');"   src="<%=PTpic%>"  width="100" height="100"    border="0" /> </a></td>
                        </tr>
                      </tbody>
                  </table></td>
                  <td width="51%" class="cate" style="word-break:break-all"><a class="M" href="<%=HOPE_InstallDir%>seller/offerdetail/<%=rs("sortid")%>-<%=rs("typeid")%>-<%=rs("typeid_2")%>-<%=rs("info_id")%>.html" target="_blank"> <span class="lh15">
                    <%
 Set re = New RegExp
re.Pattern ="("&keywords&")"
re.IgnoreCase = True
re.Global=True
result = re.Replace(rs("showname"), "<font color=red>$1</font>")
%>
                    <b><u><font style="font-size:14px"><%=result%></font></u></b> </span></a>
                      <%
 '是否为特色商机类型
	if rs("tsbz")=0 then
		tsbz=""
	elseif rs("tsbz")=1 then 
		tsbz="<img src='"&HOPE_InstallDir&"images/xinpin.gif'>"
	elseif rs("tsbz")=2 then 
		tsbz="<img src='"&HOPE_InstallDir&"images/youhui.gif'>"
	elseif rs("tsbz")=3 then 
		tsbz="<img src='"&HOPE_InstallDir&"images/jiangjia.gif'>"
	end if 
 %>
                      <%=tsbz%><br />
                      <font color="#999999">有效期:<%=rs("infostartdate")%>---<%=rs("infoenddate")%></font> <br />
                      <%
response.write""&left(noHtml(rs("content")),50)&"...<BR>"
response.write"<FONT color=#666666>"&rs("dateandtime")&"发布</FONT> <BR>"&vbCrlf

						
	'--是否使用的名片页------------------------------------------------------------
	   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 rs("corflag")=1 then 

	   if instr(rsmp("rolelist"),"qw")>0 then							
 
 if  is2weburl=1 then
 %>
                      <a href="http://<%=rs("user")%>.<%=weburl1%>"  target="_blank">
                      <%else%>
                      <a  href="<%=HOPE_InstallDir%>vipcom/<%=rs("user")%>/"  target="_blank">
                      <%end if

 else
 %>
                      <a  href="<%=HOPE_InstallDir%>Ptcom/<%=rs("user")%>.html"  target="_blank">
                      <% end if
  end if
  rsmp.close
  end if
  
  %>
                      <%=rs("qymc")%></a> </td>
                  <td width="3%">&nbsp;</td>
                  <td width="14%"><%
				  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="11%"  align="middle"><div align="center"> <font    color="red"> <%=rs("trust_score")%> </font> </div></td>
                  <td width="8%" align="center"><%If rs("tm")<>"" then%>
				  <a target=blank href=http://wpa.qq.com/msgrd?V=1&Uin=<%=rs("tm")%>Site=www.websen.net&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>
              </tbody>
            </table>
          <br />
            <%
icolor=icolor+1
if icolor>1 then icolor=0
rowcount=rowcount-1
rs.movenext
loop
end if
%>
            <br />
            <table width="750" 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/searchbuy.asp?sortid="&sortid&"&typeid="&typeid&"&typeid_2="&typeid_2&"&keywords="&keywords&"&country1="&country&"&province="&sf&"&city="&city&"&datetime="&datetime&"&show="&show&"")%></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
              </tbody>
          </table></td>
      </tr>
    </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
%>