<!--#include file="Inc/Cls_DB.asp" -->
<!--#include file="Inc/Const.asp" -->
<!--#include file="Inc/Function.asp" -->
<%
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
'==============================================================================
'软件名称：风讯网站信息管理系统
'当前版本：Foosun Content Manager System 
'最新更新：2004.12
'==============================================================================
'商业注册联系：028-85098980-601,602 技术支持：028-85098980-606、607,客户支持：608
'产品咨询QQ：159410,655071,66252421
'技术支持:所有程序使用问题，请提问到bbs.foosun.net我们将及时回答您
'程序开发：风讯开发组 & 风讯插件开发组
'论坛支持：风讯在线论坛(http://bbs.foosun.net)
'官方网站：www.Foosun.net  演示站点：test.cooin.com    
'网站建设专区：www.cooin.com
'==============================================================================
'免费版本请在新闻首页保留版权信息，并做上本站LOGO友情连接
'==============================================================================
%>
<!--#include file="Inc/Function.asp" -->
<%
if request("keyword")="" then
%>
<script luanage=javascript>
history.back()
alert("请输入新闻关键字!!!")
</script>
<%
response.end
end if
Dim Temp_DummyDir
If SysRootDir <> "" then
	Temp_DummyDir = "/" & SysRootDir
Else
	Temp_DummyDir = ""
End If
strpage=trim(request.querystring("page"))
		if len(strpage)=0 then
		strpage="1"
		end if
set Rs = server.CreateObject ("ADODB.RecordSet")
if request("SClass")<>"" then
   Sclass="and ClassID = '"&Replace(request("SClass"),"'","")&"'"
else
   Sclass=""
end if

if request("BeginDate")<>"" and request("EndDate")<>"" then
	if isdate(request("BeginDate"))=false or isdate(request("EndDate"))=false then
	%>
	<script luanage=javascript>
	history.back()
	alert("请输入正确的日期格式!!!")
	</script>
	<%	
	end if
   Dtime="and AddDate >= #"&formatdatetime(request("BeginDate"))&"# and AddDate <= #"&formatdatetime(request("EndDate"))&"#"
else
   Dtime=""
end if

If Request("condition")="title" then
	Sql = "select * from News where DelTF=0 and AuditTF=1 "&Sclass&" "&Dtime&" and  Title like '%"&Replace(request("keyword"),"'","''")&"%'"
elseif Request("condition")="content" then
	Sql = "select * from News where DelTF=0 and AuditTF=1 "&Sclass&" "&Dtime&" and content like '%"&Replace(request("keyword"),"'","''")&"%'"
elseif Request("condition")="author" then
	Sql = "select * from News where DelTF=0 and AuditTF=1 "&Sclass&" "&Dtime&" and Author like '%"&Replace(request("keyword"),"'","''")&"%'"
end if
	Rs.Open Sql,Conn,1,3
%>
<title>搜索结果</title>
<head><style type="text/css">
<!--
.MainMenuBGStyle {
	background-repeat: no-repeat;
	background-position: right center;
}
-->
</style>
</head>
<link href="../CSS/css.css" rel="stylesheet">

<body bgcolor="#FFFFFF">
<table width="70%" border="0" align="center" cellpadding="8" cellspacing="1" class="tabbgcolor">
  <tr class="tabbgcolorliWhite"> 
      <td width="78%" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="6">
        <tr>
          <td><font color="#999999">&lt;!---请自己设置您的模板-----&gt;</font></td>
        </tr>
        <tr> 
          <td>以下为关键字<font color="#FF0000"><strong><%=request("KeyWord")%></strong></font>的相关内容</td>
        </tr>
      </table>
      <%
if Rs.eof and Rs.bof then
	Response.write "<p align='center'> 未找到符合你条件的<font color=#ff0000>"&Request.Form("keyword")&"</font>信息</p>"
	Else
	rs.pagesize=20
	rs.absolutepage=cint(strpage)
	select_count=rs.recordcount
	select_pagecount=rs.pagecount
	 for i=1 to rs.pagesize
		if rs.eof then
		exit for
		end if
	%>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="31" bgcolor="#FFFFFF">·
		  <%
		  dim ClassCName1,RssearchObj
		  Set RssearchObj = Conn.Execute("Select ClassCName,ClassEName ,SaveFilePath,FileExtName from NewsClass where Classid = '" & rs("ClassID") &"'")
		  ClassCName1="<a href="& Temp_DummyDir & RssearchObj("SaveFilePath")&"/"& RssearchObj("ClassEName") &"/index."&RssearchObj("FileExtName")&" target=""_blank"">「"& RssearchObj("ClassCName") &"」</a> "
			%> 
            <%if Rs("HeadNewsTF")=1 then%>
            <%=ClassCName1%><a href="<%=Rs("HeadNewsPath")%>" target="_blank"><font color="#FF0000"><B><%=Rs("title")%></B></font></a>[标]  <font color=#999999><%=Rs("AddDate")%></font>
            <%else%>
            <%=ClassCName1%><a href="<%= Temp_DummyDir & RssearchObj("SaveFilePath")&"/"&RssearchObj("ClassEName")&"/"&Rs("FileName")&"."&Rs("FileExtName")%>" target="_blank"><%=Rs("title")%></a>  <font color=#999999><%=Rs("AddDate")%></font> 
            <%end if%>
             </td>
        </tr>
      </table> 
      <%
	  rs.movenext
	 next
end if
	%>
      <br>
      <br>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>   <%
	   response.write"&nbsp;&nbsp;共<b>"& select_pagecount &"</b>页<b>" & select_count &"</b>条记录，本页是第<b>"& strpage &"</b>页。"
		if int(strpage)>1 then
		    response.Write"&nbsp;&nbsp;&nbsp;<a href=?page=1&condition="&Replace(request("condition"),"'","''")&"&Sclass="&Replace(request("Sclass"),"'","''")&"&keyword="&Replace(request("keyword"),"'","''")&"&BeginDate="&Replace(request("BeginDate"),"'","''")&"&EndDate="&Replace(request("EndDate"),"'","''")&">第一页</a>&nbsp;"
		    response.Write"&nbsp;&nbsp;&nbsp;<a href=?page="&cstr(cint(strpage)-1)&"&condition="&Replace(request("condition"),"'","''")&"&Sclass="&Replace(request("Sclass"),"'","''")&"&keyword="&Replace(request("keyword"),"'","''")&"&BeginDate="&Replace(request("BeginDate"),"'","''")&"&EndDate="&Replace(request("EndDate"),"'","''")&">上一页</a>&nbsp;"
			end if
			if int(strpage)<select_pagecount then
			response.Write"&nbsp;&nbsp;&nbsp;<a href=?page="&cstr(cint(strpage)+1)&"&condition="&Replace(request("condition"),"'","''")&"&Sclass="&Replace(request("Sclass"),"'","''")&"&keyword="&Replace(request("keyword"),"'","''")&"&BeginDate="&Replace(request("BeginDate"),"'","''")&"&EndDate="&Replace(request("EndDate"),"'","''")&">下一页</a>"
			response.Write"&nbsp;&nbsp;&nbsp;<a href=?page="& select_pagecount &"&condition="&Replace(request("condition"),"'","''")&"&Sclass="&Replace(request("Sclass"),"'","''")&"&keyword="&Replace(request("keyword"),"'","''")&"&BeginDate="&Replace(request("BeginDate"),"'","''")&"&EndDate="&Replace(request("EndDate"),"'","''")&">最后一页</a>&nbsp;"
			end if
			response.Write"<br>"
       %></td>
        </tr>
      </table></td>
    </tr>
  </table>
</body>
</html>