<!--#include file="../conn/conn.asp"-->
<!--#include file="../inc/safe.asp"-->
<!--#include file="../inc/classcount.asp"-->
<%
sortid=replace_text(request("sortid"))
typeid=replace_text(request("typeid"))
keywords=replace_text(request("keywords"))
show=replace_text(request("show"))
country=Replace_Text(request("country1"))
sf=Replace_Text(request("province"))
city=Replace_Text(request("city"))
datetime=replace_text(request("datetime"))

sql="select info.*,corporation.id,corporation.flag as corflag,corporation.qymc,corporation.country,corporation.sf,corporation.city,corporation.web,corporation.url,corporation.trust_score from info,corporation where corporation.id=info.gsid and info.flag=1"
if Chkrequest(sortid) then sql=sql&" and info.sortid="&sortid&""
if Chkrequest(typeid) then sql=sql&" and info.typeid="&typeid&""
if keywords>"" then sql=sql&" and info.keywords like '%"&keywords&"%'"
if country>"" then sql=sql&" and corporation.country='"&country&"'"
if sf>"" then sql=sql&" and corporation.sf='"&sf&"'"
if city>"" then sql=sql&" and corporation.city='"&city&"'"

if datetime>"" then
if datetime="no" then 
sql=sql&" and info.dateandtime<getdate()-90"
else
sql=sql&" and info.dateandtime>=getdate()-"&datetime&""
end if
end if

if show="trust_score" then
sql=sql&" order by corporation.trust_score desc"
else
sql=sql&" order by info.info_id desc"
end if

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

msg_per_page=20 '定义每页显示记录条数
%>
<%
Function showproductcount()
if Chkrequest(sortid) then
if Getsearchprosortcount>=0 then showproductcount=Getsearchprosortcount
elseif Chkrequest(typeid) then
if Getsearchprotypecount>=0 then showproductcount=Getsearchprotypecount
else
if Getsearchprocount>=0 then showproductcount=Getsearchprocount
end if
End Function

Function showcorporationcount()			
if Chkrequest(sortid) then
if Getsearchcorsortcount>=0 then showcorporationcount=Getsearchcorsortcount
elseif Chkrequest(typeid) then
if Getsearchcortypecount>=0 then showcorporationcount=Getsearchcortypecount
else
if Getsearchcorcount>=0 then showcorporationcount=Getsearchcorcount
end if
End Function
%>
<!--#include file="../inc/headpage.asp"-->
<style type="text/css">
<!--
.searchbar1 {BORDER-TOP: #f1f1f1 3px solid;  FONT-WEIGHT: bold; BACKGROUND: #e7e7e7; BORDER-BOTTOM: #bebebe 3px solid; FONT-FAMILY: 宋体; padding-top:3px}
.companybar1 {background:url("/seller/images/search_bg.gif");border:#999999 solid;border-width:1 1 0 1;height:29px;border-bottom:#666666 3 solid;text-align:center;font:bold 14px;padding-top:4px;}
.orangeborder {border:#CC3300 2 solid;padding-left: 15px}
.cate {padding-left: 14px;font-size:12px;LINE-HEIGHT: 150%;}
.smalltoppad3 {padding-top:3px}
-->
</style>
<!--#include file="headall.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<br>
<table width="98%"  border="0" align="center" cellpadding="10" cellspacing="0"  class=outborder>
  <tr>
    <td bgcolor="E7E7E7">
      <table width="100%"  border="0" cellspacing="0" cellpadding="2">
        <tr>
          <td> <b>“<font color=FF0000><%=keywords%></font>”的供求商机共 <%if totalrec>0 then response.write""&totalrec&"" else response.write"0" end if%>  条</b><br>          </td>
          <td align=right class=S> <a href="/staric/index.asp"><img src="../images/trust1.gif" width=22 height=14 border=0  align=absmiddle></a> <font color=939393>商贸通会员 | <img src="../images/brand.gif" width=21 height=23 align=absmiddle> 网上有名</font> 
        </tr>
      </table>
      <table width="100%"  border="0" cellspacing="0" cellpadding="3">
        <tr>
          <td width=165 class="buttoncolor M" nowrap>
            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>&nbsp;</td>
                <td><div align="left"><b><font color=FFFFFF>供求信息 </font><font color=#ffffff>
                  <%if totalrec>0 then response.write"("&totalrec&")" else response.write"(0)" end if%>
                </font></b></div></td>
              </tr>
          </table></td>
          <td rowspan=3 class="orangeborder" bgcolor=#FFFFFF>
            <table width="100%"  border="0" cellspacing="0" cellpadding="7">
              <tr>
                <td> <img src="../images/icon_point.gif" border=0 width=18 height=19  align=absmiddle> <span class="text13">
                  <%if datetime="1" then
		    response.write"<A href='searchall.asp?sortid="&sortid&"&typeid="&typeid&"&keywords="&keywords&"'>所有供求信息</a>"
		    else
		    response.write" "
			end if%>
                  <%response.write"<A href='searchsale.asp?sortid="&sortid&"&typeid="&typeid&"&keywords="&keywords&"'>供应信息</A>"%>
                </span><span class="text13"> </span><img src="../images/icon_point.gif" border=0 width=18 height=19  align=absmiddle> <span class="text13">
                <%response.write"<A href='searchbuy.asp?sortid="&sortid&"&typeid="&typeid&"&keywords="&keywords&"'>求购信息</A>"%>
                </span><img src="../images/icon_point.gif" border=0 width=18 height=19  align=absmiddle><span class="text13">
                <%if datetime="1" then
		    response.write"<FONT style='BACKGROUND-COLOR: #fafbb9'><B>今日最新供求信息</B></FONT>"
		    else			
			response.write"<A href='searchall.asp?sortid="&sortid&"&typeid="&typeid&"&keywords="&keywords&"&country1="&country&"&province="&sf&"&city="&city&"&datetime=1&show="&show&"'>今日最新供求信息</A>"
			end if%>
                </span> <img src="../images/icon_point.gif" border=0 width=18 height=19  align=absmiddle> <b><a href="../member/tradeinfo/add_info.asp">发布求购信息</a> <img src="../images/icon_point.gif" border=0 width=18 height=19  align=absmiddle> <a href="../member/myemail/orderbegin.asp" class=red>按关键字定阅</a></b></td>
              </tr>
              <tr>
                <td><TABLE cellSpacing=0 cellPadding=0 border=0>
                  <FORM name=frmAreaSearch action="?sortid=<%=sortid%>&typeid=<%=typeid%>&keywords=<%=keywords%>" method=post>
                    <TBODY>
                      <TR>
                        <TD class=text13 noWrap>过滤信息： 时间
                            <SELECT name="datetime">
                              <OPTION 
              value=90 selected>显示所有未过期</OPTION>
                              <OPTION value=1>显示今日最新</OPTION>
                              <OPTION value=3>显示最近3天</OPTION>
                              <OPTION value=5>显示最近5天</OPTION>
                              <OPTION value=10>显示最近10天</OPTION>
                              <OPTION 
              value=30>显示最近30天</OPTION>
                              <OPTION value=60>显示最近60天</OPTION>
                              <OPTION value=180>显示最近半年</OPTION>
                              <OPTION 
            value="no">显示所有过期</OPTION>
                            </SELECT>
          地区
          <SELECT style="WIDTH: 90px" 
            onchange=javascript:changeCountry1(this); name=country1>
          </SELECT>
          <SELECT style="WIDTH: 60px" 
            onchange=changeProvince(this); name=province>
            <OPTION value="" 
              selected>省份</OPTION>
          </SELECT>
          <SELECT name=city>
            <OPTION value="" 
              selected>地级</OPTION>
          </SELECT>
          <input name="imageField" type="image" src="../seller/images/search.gif" align="top" width="65" height="22" border="0">
</TD>
                      </TR>
                  </FORM>
                </TABLE>
				            <SCRIPT language=javascript src="../js/area.js"    
      purpose="INITIALIZER"></SCRIPT>
	        <SCRIPT language=javascript>
<!--
    //设置国家1的缺省值
    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.frmAreaSearch.DateTime[i].value =='<%=datetime%>'){
            document.frmAreaSearch.DateTime[i].selected = true;
        }
    }
-->
</SCRIPT>				</td>
              </tr>
          </table></td>
        </tr>
        <tr>
          <td class="nobianbuttonborder M blackbordernobottom" nowrap><table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>&nbsp;</td>
                <td><div align="left"><b><a href="searchproduct.asp?sortid=<%=sortid%>&typeid=<%=typeid%>&keywords=<%=keywords%>">产品目录</a></b> <b>(<%=showproductcount%>)</b></div></td>
              </tr>
          </table></td>
        </tr>
        <tr>
          <td class="nobianbuttonborder M blackbordernobottom"  nowrap>
            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>&nbsp;</td>
                <td><div align="left"><b><a href="searchcor.asp?keywords=<%=keywords%>&sortid=<%=sortid%>&typeid=<%=typeid%>">相关公司</a></b> <b>(<%=showcorporationcount%>)</b></div></td>
              </tr>
          </table></td>
        </tr>
    </table></td>
  </tr>
</table>
<br>
<table width="98%"  border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td width="170" valign="top" style="BORDER-BOTTOM: #FFFFFF 20px solid;">  <table width="170"  border="0" cellspacing="0" cellpadding="5" class="outborder">
      <tr>
        <td bgcolor=#B8B8B8>
          <table width="170"  border="0" cellspacing="0" cellpadding="5" class="outborder">
            <tr>
              <td height="117" class="searchbar1">
			  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><img src="../seller/images/img_search.gif"></td>
                  </tr>
                </table>                     
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <form name=searchForm action="../select.asp" 
    onSubmit="javascript:if(doSearch()==false) return false;" method=post><tr>
                    <td>
	<table width="100%"  border="0" cellspacing="0" cellpadding="3">
                    <tr>
                        <td colspan="2">
                          <input type="text" name="keywords" value="<%=keywords%>" size="23">                        </td>
						</tr>
                    <tr>
                      <td>
                        <select name="which" class="text13">
                          <option value="all" selected>供求信息</option>
                          <option value="sale">供应信息</option>
                          <option value="buy">求购信息</option>
                          <option value="productshow">产品目录</option>
                          <option value="corporation">公司库</option>
                          <option value="news">行业资讯</option>
                      </select></td>
                      <td>
                        <input name="imageField2" type="image" src="../images/serch.gif" align="top" width="65" height="22" border="0"></td>
                    </tr>
                    <tr>
                      <td colspan="2"><img src="../images/icon_point.gif" width="18" align="absmiddle"> <a href="../help/Search_Answer.asp"><b>如何搜索</b></a></td>
                    </tr>
                </table>
                    </td>
                  </tr></form>
                </table></td>
            </tr>
          </table>
		  <script language='JavaScript' src='../js/search.js' type='text/javascript'></script>
          <br>
<table  border="0" cellspacing="0"  width="170" cellpadding="5" class="orangeborder3">
      <tr>
        <td height=28 class="searchbar1">&nbsp;"<font color=red><%=keywords%></font>"相关的搜索</td>
      </tr>
      <tr>
        <td class="S" bgColor=#FFFFFF><span class=lh15>
<%sql="select top 20 * from search_Keyword where [KW_Word] like '%["&keywords&"]%'"
Set rssearch= Server.CreateObject("ADODB.Recordset") 
rssearch.open sql,conn,1,1
if rssearch.eof then
response.write" 暂无<font color=red>"&keywords&"</font>的相关搜索"
else
do while not rssearch.eof
response.write"<a href='searchall.asp?sortid="&sortid&"&keywords="&rssearch("KW_Word")&"'>"&rssearch("KW_Word")&"</a>&nbsp;&nbsp;"
rssearch.movenext
loop
end if%>
</span></td>
      </tr>
</table>
<br>
          <%
if not(rs.eof and rs.bof) then
%>
          <table  border="0" cellspacing="0"  width="170" cellpadding="5" class="outborder">
            <tr>
              <td height=28 class="searchbar1">&nbsp;搜索结果分类</td>
            </tr>
            <tr>
              <td class="text13" bgcolor=#FFFFFF>
                <%
if Chkrequest(sortid) then
sortsql="select class_2.typeid,class_2.typename,class_1.* from class_2,class_1 where class_2.sortid="&sortid&" and class_1.sortid=class_2.sortid"
set rssort=conn.execute(sortsql)
if rssort.eof then
response.write"暂无信息"
else
if Getsearchsortcount4>0 then response.write"<b><A href='searchall.asp?sortid="&sortid&"&keywords="&keywords&"'>"&rssort("sort")&"</A> ("&Getsearchsortcount4&")</b><br>"
do while not rssort.eof
response.write"<span class=lh13>"
if Getsearchtypecount4>0 then response.write"·<a href='searchall.asp?typeid="&rssort("typeid")&"&keywords="&keywords&"' class='s'>"&rssort("typename")&"</a> ("&Getsearchtypecount4&")<br>"
rssort.movenext    
loop
end if
rssort.close
set rssort=nothing


elseif Chkrequest(typeid) then
typesql="select class_2.typeid,class_2.typename,class_1.* from class_2,class_1 where class_2.typeid="&typeid&" and class_1.sortid=class_2.sortid"
set rstype=conn.execute(typesql)
if rstype.eof then
response.write"暂无信息"
else
if Getsearchsortcount5>0 then response.write"<b><A href='searchall.asp?sortid="&rstype("sortid")&"&keywords="&keywords&"'>"&rstype("sort")&"</A> ("&Getsearchsortcount5&")</b><br><span class=lh15>"
if Getsearchtypecount>0 then response.write"·<a href='searchall.asp?typeid="&rstype("typeid")&"&keywords="&keywords&"' class='s'>"&rstype("typename")&"</a> ("&Getsearchtypecount&")<br>"
end if
rstype.close
set rstype=nothing

else

sortsql="select * from class_1"   
set rssort=conn.execute(sortsql)
if rssort.eof then
response.write"暂无信息"
else
do while not rssort.eof
response.write"<span class=lh15>"
if Getsearchsortcount>0 then response.write" <b><A href='searchall.asp?sortid="&rssort("sortid")&"&keywords="&keywords&"'>"&rssort("sort")&"</A> ("&Getsearchsortcount&")</b><br>"
typesql="select * from class_2 where sortid="&rssort("sortid")&""
set rstype=conn.execute(typesql)
if rstype.eof then
response.write"暂无信息"
else
do while not rstype.eof
if Getsearchtypecount>0 then response.write"·<a href='searchall.asp?typeid="&rstype("typeid")&"&keywords="&keywords&"' class='s'>"&rstype("typename")&"</a> ("&Getsearchtypecount&")<br>"
rstype.movenext    
loop
end if
rstype.close
set rstype=nothing
rssort.movenext
loop
end if
rssort.close
set rssort=nothing
end if
%>
                <br>
              </td>
          </table>
          <%
end if
%>
        </td>
      </tr>
    </table></td>    
<td width="10">&nbsp;</td>
    <td valign=top>
<%
if rs.eof then
response.Write"<div align='center'>暂无信息</div>"
else
%>
     <table width=100% border="0" cellspacing="1" cellpadding="0" height=40>
        <tr>
          <td bgcolor=E7E7E7 align=center width=15% class=S><img src='../images/arrow_19X19.gif' width="19" height="19" align="top"><font color=666666>图片</font></td>
          <td bgcolor=E7E7E7 align=center width=40% class=S><font color=666666>供求信息/公司</font></td>
          <td bgcolor=E7E7E7 align=center width=10% class=S>
            <table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width=22 align=center><a href="javascript:win=window.open('../help/trust_score.asp','contact','width=550,height=450,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no');win.focus();"><img src="../images/icon_trust_score_help.gif" alt="什么是商贸通指数" width="19" height="19" border="0"></a></td>
                <td>
                <%response.write"<A href='searchall.asp?sortid="&sortid&"&country1="&country&"&province="&sf&"&city="&city&"&datetime="&datetime&"&show=trust_score'class=S><font color=666666>按商贸通<br>指数排序</font></A>"%></td>
              </tr>
          </table></td>
          <td bgcolor=E7E7E7 align=center width=10% class=S><font color=666666>产地</font></td>
          <td bgcolor=E7E7E7 align=center width=10% class=S><font color=666666>在线留言</font></td>
        </tr>
      </table>
	  <%do while not rs.eof and rowcount > 0%>
<TABLE width="100%" height=85 border=0 align="center" cellPadding=0 cellSpacing=1>
  <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 align=middle width=15%>
      <TABLE class=porductborder height=64 cellSpacing=0 cellPadding=0 width=64 
      border=0>
        <TBODY>
        <TR>
          <TD align=middle>
		  <%if rs("picture")<>"nopicture.gif" then%><A class=s 
      href="/tradeinfo/info.asp?info_id=<%=rs("info_id")%>" 
      target=_blank><IMG src="../picture/<%=rs("picture")%>" onload="javascript:if(this.height>this.width){this.height=64}else{this.width=64}" border=0> </A>
				<%else%>
		  <FONT class=C 
      color=#cecfce>无图</FONT><%end if%></TD></TR></TBODY></TABLE></TD>
      <TD width="40%" class=cate>
	  <% if rs("type")="买" then
	  response.write"<A class=M href='../seller/info.asp?info_id="&rs("info_id")&"' target=_blank>"
	  elseif rs("type")="卖" then
	  response.write"<A class=M href='../tradeinfo/info.asp?info_id="&rs("info_id")&"' target=_blank>"
	  end if%>	  <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>")%><%=result%></SPAN></A> 
	  <BR>
	  <%
	  if rs("type")="卖" then
	  if rs("corflag")=1 then
	  %>
	  <A href="../<%=rs("url")%>" target=_blank><FONT color=#666666><%=rs("qymc")%></font></A>
	  <%else%>
	  <A href="../noshinecompany/index.asp?id=<%=rs("id")%>" target=_blank><FONT color=#666666><%=rs("qymc")%></font></A>
	  <%
	  end if
	  end if
	  %>	   <FONT color=#666666><%=rs("dateandtime")%> <BR>
              <%
			  if rs("type")="卖" then
			  if rs("corflag")=1 then
			  %>
              <A href="../<%=replace(rs("url"),"index","tradeinfo")%>" target=_blank><FONT color=#666666>该会员所有供应信息</FONT></A> 
              <%
			  end if
			  end if
			  %>
            </FONT></TD>
      <TD align=middle width=10%><div align="center">
            <%if rs("corflag")=1 then%>
            <IMG height=14 alt=商贸通指数 
      src="../images/trust1.gif" width=22 align=absMiddle 
      border=0><BR>
              <A class=numb title=商贸通指数 
      href="javascript:win=window.open('../help/trust_score.asp','contact','width=550,height=550,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no');win.focus();"><FONT 
      style="FONT-WEIGHT: bold; FONT-SIZE: 13px; FONT-FAMILY: Verdana"><%=rs("trust_score")%></FONT></A> 
              <%end if%>
			  <%if rs("corflag")=0 then%>
			  <table  border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td><span class="S">普通<br>会员</span></td>
                </tr>
              </table>
			  <%end if%>
      
      </div></TD>
    <TD class=s align=middle width=10%><div align="center">
          <%if rs("country")="中国" then response.write""&rs("sf")&""&rs("city")&"" else response.write""&rs("country")&"" end if%> 
        </div></TD>
    <TD class=s align=middle width=10%><div align="center"><a href="../member/getprice/message.asp?info_id=<%=rs("info_id")%>" target="_blank"><img src="../images/list_mytlogo_offline.gif" width="26" height="26" border="0"></a><br>
          <a href="../member/getprice/message.asp?info_id=<%=rs("info_id")%>" target="_blank" class="S">发送留言</a></div></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=100% border=0 align="center" cellPadding=1 cellSpacing=0 style="BORDER-TOP: #9C9A9C 1px solid;BORDER-Bottom: #9C9A9C 1px solid">
   <TBODY>
     <TR>
       <TD>
         <TABLE cellSpacing=0 cellPadding=4 width="100%" 
        border=0>
           <TBODY>
             <TR>
               <TD class=m align=middle><%=listPages("smalllist.asp?sortid="&sortid&"&country1="&country&"&province="&sf&"&city="&city&"&datetime="&datetime&"&show="&show&"")%> </TD>
             </TR>
           </TBODY>
       </TABLE></TD>
     </TR>
   </TBODY>
 </TABLE></td>
  </tr>
</table>	      
<!--#include file="../inc/end.asp"-->
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>