<%
  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="../manage/makehtml/index/temp_inc.asp"-->
<title><%=WebName%>--商业资讯  </title>
<link href="<%=HOPE_InstallDir%>skins/skin1/images/css.css" rel="stylesheet" type="text/css">
<link rel='stylesheet' href="../News/new.css" type='text/css'/>
<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>
<body>
 <%  
     newstype=Replace_Text(Request("newstype"))
     newstj=Replace_Text(Request("newstj"))
     txtitle=Replace_Text(Request("txtitle"))
     selectnew=Replace_Text(Request("selectnew"))
	if Replace_Text(Request("keywords"))<>"" then 
	txtitle=Replace_Text(Request("keywords"))
	end if
 	keywords=txtitle    '用于统计最近搜索词
     set rs=server.createobject("adodb.recordset") 
	 Sql="select * from Websen_news WHere  newsid<>0 "
	 if keywords="" then
	 Sql="select  top 10 * from Websen_news WHere  newsid<>0 "
	 end if

	if txtitle<>"" then 
	sql=sql&"  and (title 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
  %>


<!--#include file="../inc/headtop.asp"-->
<table width="952" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>
<table width="952" 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="952" border="1" bordercolor="#EFEFEF" align="center" cellpadding="0" cellspacing="0">
    <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>
<div class="nav_950">   
<!--#include file="../inc/end.asp"-->
</div>
</body>
</html>
 <%
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
%>