<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%
  data_path="../" 'ACC连接数据库路径，对SQL无效 %>
<!--#include file="../conn/conn.asp"-->
<!--#include file="../inc/safe.asp"-->
 <!--#include file="../manage/makehtml/index/temp_inc.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=WebName%>--商业资讯  </title>
<style type="text/css">
<!--
.style1 {	color: #800000;
}
.tdc{
 
	filter:	progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=#FFFFFF, EndColorStr=#EEEEEE);
}
-->
</style>
<script language="javascript">
function checkval()
{
 var  str=document.sform.txtitle.value;
 if(str.replace(/\s+/g,"")==""||str=="请输入关键字")
	{
	alert("请输入关键字！");
	document.sform.txtitle.focus();
	return false;
}
}
</script><SCRIPT language=javascript> 
<!-- Hide 
function killErrors() { 
return true; 
} 
window.onerror = killErrors; 
 // --> 
</SCRIPT> 
</head>
 <%  
     newstype=Replace_Text(Request("newstype"))
     newstj=Replace_Text(Request("newstj"))
     txtitle=Replace_Text(Request("txtitle"))
	 
	if Replace_Text(Request("keywords"))<>"" then 
	txtitle=Replace_Text(Request("keywords"))
	end if
 	keywords=txtitle    '用于统计最近搜索词
     set rs=server.createobject("adodb.recordset") 
	 Sql="select * from Yixiang_news WHere  newsid<>0 "
	 if keywords="" then
	 Sql="select  top 10 * from Yixiang_news WHere  newsid<>0 "
	 end if

	if txtitle<>"" then 
	sql=sql&"  and (title like '%"&txtitle&"%'  or content like '%"&txtitle&"%') "
	end if
	if newstj<>"" then
	sql=sql&"   and  Tjnews="&newstj&""
	end if
	if newstype<>"" then 
	if newstype<>"all" then
	sql=sql&"   and   Typeid="&newstype&""
	end if
	end if
	sql=sql&"  order by newsID desc"
	rs.open sql,conn,1,1
  %>
 <%
HOPE_className=10
HOPE_className_new=10
HOPE_searchName="News_search.asp"
keywords=Replace_Text(request("keywords"))
if keywords<>"" then
	HOPE_classKeywords=keywords
else
	HOPE_classKeywords="请输入你感兴趣的行业资讯"
end if
%>
        <!--#include file="../inc/head1.asp"-->
<div align="center">
 <table cellspacing="0" cellpadding="0" width="<%=HOPE_PageWidth%>" align="center" border="0" style="text-align:left;">
   <tbody>
     <tr>
       <td height="3"></td>
     </tr>
     <tr>
       <td><table cellspacing="0" bordercolordark="#ffffff" cellpadding="0" width="100%" bordercolorlight="#cccccc" border="1">
           <tbody>
             <tr>
               <td height="22"><table cellspacing="0" cellpadding="0" width="100%" border="0">
                   <tbody>
                     <tr>
                       <td width="23%"><img height="25" src="<%=HOPE_InstallDir%>search/images/so.gif" width="176" /></td>
                       <td width="77%"><% response.Write("&nbsp;<b><font color=red>→</font></b> 〖<a href='"&HOPE_InstallDir&"search/searchproduct.asp'>产品搜索</a>〗 〖<a href='"&HOPE_InstallDir&"search/searchCom.asp'>公司搜索</a>〗 〖<a href='"&HOPE_InstallDir&"search/searchhelp.asp'>帮助搜索</a>〗 〖<a href='"&HOPE_InstallDir&"search/searchsale.asp'>供应搜索</a>〗 〖<a href='"&HOPE_InstallDir&"search/searchbuy.asp'>求购搜索</a>〗 〖<a href='"&HOPE_InstallDir&"corporation/sitemap.html' target=_blank>行业类别导航</a>〗")%>
					 &nbsp;&nbsp;<a href='<%=HOPE_InstallDir%>search/searchnear.asp'><font color="#0099CC"><b>模糊搜索</b></font></a></td>
                     </tr>
                   </tbody>
               </table></td>
             </tr>
             <tr>
               <td bgcolor="#eeeeee" height="28"><div align="center">
                   <table border="0" cellpadding="0" cellspacing="0" width="<%=HOPE_PageWidth%>"  align="center">
                     <form name="sform" method="post" action="<%=HOPE_InstallDir%>search/News_search.asp" onSubmit="return checkval();">
                       <tr>
                         <td width="110" height="40">&nbsp;&nbsp;<strong>行业资讯搜索</strong> </td>
						 <td width="668" bgcolor="#FAFAFA"   >
                          &nbsp;&nbsp;类别: 
     <select size="1" name="newstype" >
    <option value="all" > 全部 </option>
   <%
  Set rsnty=Server.CreateObject("adodb.recordset")
  sqlnty="select * from yixiang_newsType"
  rsnty.open sqlnty,conn,1,1
  if not rsnty.eof then
  do while not rsnty.eof 
  %>
      <option value="<%=rsnty("typeid")%>"> <%=rsnty("type")%> </option>
     <%
  rsnty.movenext 
  loop
  rsnty.close  
  end if
  %>
 </select>
  <select size="1" name="newstj">
		   <option value="0" >全部</option>
		   <option value="1" >推荐</option>
		 </select>
		 <input  type="text"  name="txtitle" maxlength="16" value="请输入关键字"  onfocus="if(this.value=='请输入关键字'){this.value='';}"  onblur="this.value=this.value.replace(/\s/g,'')" >
		 <input  type="submit" value="我要搜索" name="newsbtn"  style=" border-color:#ffffff">	   </td>
   </tr> 
   </form>	  <tr><td colspan="2">
     &nbsp;&nbsp;<b><font color="#0099CC">最近搜索词</font></b>: <%=Replace(Request.Cookies("zhuyongjian"),",","&nbsp;&nbsp;<font color=#E7E7E7>|</font>&nbsp;&nbsp;")%> </td>
                       </tr>	
                   </table>
                   <table border="0" width="<%=HOPE_PageWidth%>" align="center" cellpadding="0" cellspacing="0">
                   </table>
               </div></td>
             </tr>
           </tbody>
       </table></td>
     </tr>
     <tr>
       <td height="5"></td>
     </tr>
   </tbody>
 </table>
 <table width="<%=HOPE_PageWidth%>" height="23" border="0" align="center" cellpadding="0" cellspacing="0" background="<%=HOPE_InstallDir%>skins/skin2/images/news_1.jpg">
    <tr> 
      <td width="5">  </td>
      <td><strong> 当前位置：<a href="<%=HOPE_InstallDir%>">首页</a> > <a href="<%=HOPE_InstallDir%>info/">行业资讯</a> >  <span style="color:red;">搜索结果:共有<%=rs.recordcount%>条;<%if   keywords<>"" then%>关键字:<%=keywords%><%end if%></span></strong></td>
    </tr>
</table>
  <table width="100" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td height="2"></td>
    </tr>
  </table>
  <table width="<%=HOPE_PageWidth%>" border="1" bordercolor="#EFEFEF" align="center" cellpadding="0" cellspacing="0" style="text-align:left;">
    <tr> 
      <td valign="top"><br>
		
			<table width="100%" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
   <%
    Const MaxPerPage=15
	dim totalPut   
	dim CurrentPage
	dim TotalPages
	dim j
	dim sql
   if Not Isnumeric(request("page")) then
		currentPage=1
	else
		currentPage=Cint(request("page"))
	end if
     if rs.eof then
 %>
	    <tr>
          <td width="100%"  height="100" align="center">暂时没有你搜索的内容&nbsp;&nbsp;<a href="#" onClick="history.back(-1);">返回</a></td>
        </tr>
<%
      else
		totalPut=rs.recordcount

		if currentpage<1 then
			currentpage=1
		end if

		if (currentpage-1)*MaxPerPage>totalput then
			if (totalPut mod MaxPerPage)=0 then
				currentpage= totalPut \ MaxPerPage
			else
				currentpage= totalPut \ MaxPerPage + 1
			end if
		end if

		if currentPage=1 then
			showContent
			showpage totalput,MaxPerPage,"News_search.asp"
		else
			if (currentPage-1)*MaxPerPage<totalPut then
				rs.move  (currentPage-1)*MaxPerPage
				dim bookmark
				bookmark=rs.bookmark
				showContent
				showpage totalput,MaxPerPage,"News_search.asp"
			else
				currentPage=1
				showContent
				showpage totalput,MaxPerPage,"News_search.asp"
			end if
		end if
 %>
        <tr>
          <td align="center">
 <%
	sub showContent
		dim i
		i=0
	do while not rs.eof 
	 likeName=rs("typeID")&"-"&rs("NEwsID")&".html"
 %>
		<table width="98%" height="30" border="0" align="center" cellpadding="5" cellspacing="0" >
        <tr >
          <td width="66%" bgcolor="#EFEFEF"  style="border-bottom:1px solid #ccccc;">
		 ┝ <a href="<%=HOPE_InstallDir%>info/detail/<%=likeName%>" target=_blank> <strong style="font-size:14px;">
  <%
 	 Set re = New RegExp
	 re.Pattern ="("&keywords&")"
	 re.IgnoreCase = True
	 re.Global=True
	 if rs("Title")<>"" then 
	 result = re.Replace(rs("Title"), "<font color=red>$1</font>")
	 else
	 result=""
	 end if
	 Response.write result 
   %>
		 </strong></a>		  </td>
          <td width="34%" valign="bottom" bgcolor="#EFEFEF"  style="border-bottom:1px solid #ccccc;"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td align="center">发布时间:<%=rs("dateandtime")%></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td colspan="2">
            <table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td>
<%
  		if len(rs("Content"))<100 then 
			 Response.write replace(nohtml(rs("Content")),txtitle,"<font style='color:Red;'>"&txtitle&"</font>")
		else
			Response.write replace(left(nohtml(rs("Content")),230),txtitle,"<font style='color:Red;'>"&txtitle&"</font>")&"..."
 	end if
 %>
		 </td>
              </tr>
            </table>		
 		  </td>
        </tr>
      </table>
 <%
		i=i+1
		if i>=MaxPerPage then Exit Do
		rs.movenext
	  loop
      End Sub   
      Function showpage(totalnumber,maxperpage,filename)  
		Dim n
		If totalnumber Mod maxperpage=0 Then  
			n= totalnumber \ maxperpage  
		Else
			n= totalnumber \ maxperpage+1  
		End If
		 
		Response.Write "<form method=Post action=?selectm="&selectm&"&selectkey="&selectkey&" >"  
		Response.Write "<p align='center' class='contents'> "  
		If CurrentPage<2 Then  
			Response.Write "<font class='contents'>首页 上一页</font> "  
		Else  
			Response.Write "<a href=?page=1&txtitle="&txtitle&"&SeType="&SeType&" class='contents'>首页</a> "  
			Response.Write "<a href=?page="&CurrentPage-1&"&txtitle="&txtitle&"&SeType="&SeType&" class='contents'>上一页</a> "  
		End If
		If n-currentpage<1 Then  
			Response.Write "<font class='contents'>下一页 尾页</font>"  
		Else  
			Response.Write "<a href=?page="&(CurrentPage+1)&"&txtitle="&txtitle&"&SeType="&SeType&" class='contents'>"  
			Response.Write "下一页</a> <a href=?page="&n&"&txtitle="&txtitle&"&SeType="&SeType&" class='contents'>尾页</a>"  
		End If  
			Response.Write "<font class='contents'> 页次：</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "  
			Response.Write "<font class='contents'> 共有"&totalnumber&"种信息 " 
		 
			Response.Write "&nbsp; </form>"  
		End Function  
  %>
  		  </td>
        </tr>
 <%end if%>
       </table>
 </td>
    </tr>
</table>
  <br />
  <!--#include file="../inc/end.asp"-->
</body>
</html>
 <%
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
%>