<%
  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>
<link href="<%=HOPE_InstallDir%>skins/skin1/images/css.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="<%=HOPE_InstallDir%>hc360/hcB2B.css" type="text/css" />
<style type="text/css">
<!--
.STYLE4 {
	color: #FFFFFF;
	font-weight: bold;
}
.STYLE5 {color: #FFFFFF}
.STYLE6 {color: #FF3300}
.STYLE11 {font-weight: bold}
.STYLE12 {color: #0066FF}
.STYLE13 {color: #3399FF}
.style1 {	color: #800000;
}
-->
</style>
<script language="javascript">
function checkval()
{
 var  str=document.form1.keywords.value;
 if(str.replace(/\s+/g,"")==""||str=="请输入关键字")
	{
	alert("请输入关键字！");
	document.form1.keywords.focus();
	return false;
}
}
</script><SCRIPT language=javascript> 
<!-- Hide 
function killErrors() { 
return true; 
} 
window.onerror = killErrors; 
 // --> 
</SCRIPT> 


</head>
 <%  
     bigc=Replace_Text(Request("bigc"))
     smallc=Replace_Text(Request("smallc"))
     keywords=Replace_Text(Request("keywords"))
      set rs=server.createobject("adodb.recordset")
	 Sql="select * from Websen_help WHere  id<>0 "

	  if keywords="" then
	 Sql="select top 10 * from Websen_help WHere  id<>0 "
  	  end if
	if keywords<>"" then 
	sql=sql&"  and (showname like '%"&keywords&"%'  or content like '%"&keywords&"%') "
	end if
	if smallc<>"" then
	if smallc<>"all" then
	sql=sql&"   and  typeid="&smallc&""
	end if
	end if
	if bigc<>"" then 
	if bigc<>"all" then
	sql=sql&"   and   sortid="&bigc&""
	end if
	end if
	sql=sql&"  order by dateandtime desc"
	rs.open sql,conn,1,1
  %>
<div align="center">
<body leftMargin=0 topMargin=0  >
<!--#include file="../inc/headseacher.asp"--><br>
<table width="970" 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%>help/">帮助信息</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="970" 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("sortid")&"-"&rs("typeid")&"-"&rs("id")&".html"
 %>
		<table width="98%" height="30" border="0" align="center" cellpadding="5" cellspacing="0" >
        <tr >
          <td width="51%" bgcolor="#EFEFEF"  style="border-bottom:1px solid #ccccc;">
		 ┝ <a href="<%=HOPE_InstallDir%>help/bin/detail/<%=likeName%>" target=_blank> <strong style="font-size:14px;">
  <%
 	 Set re = New RegExp
	 re.Pattern ="("&keywords&")"
	 re.IgnoreCase = True
	 re.Global=True
	 result = re.Replace(rs("showname"), "<font color=red>$1</font>")
	 Response.write result 
   %>
		 </strong></a>		  </td>
          <td width="49%" 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")),keywords,"<font style='color:Red;'>"&keywords&"</font>")
		else
			Response.write replace(left(nohtml(rs("Content")),230),keywords,"<font style='color:Red;'>"&keywords&"</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 "<p align='center' class='contents'> "  
		If CurrentPage<2 Then  
			Response.Write "<font class='contents'>首页 上一页</font> "  
		Else  
			Response.Write "<a href=?page=1&keywords="&keywords&"&bigc="&bigc&"&smallc="&smallc&" class='contents'>首页</a> "  
			Response.Write "<a href=?page="&CurrentPage-1&"&keywords="&keywords&"&bigc="&bigc&"&smallc="&smallc&" class='contents'>上一页</a> "  
		End If
		If n-currentpage<1 Then  
			Response.Write "<font class='contents'>下一页 尾页</font>"  
		Else  
			Response.Write "<a href=?page="&(CurrentPage+1)&"&keywords="&keywords&"&bigc="&bigc&"&smallc="&smallc&" class='contents'>"  
			Response.Write "下一页</a> <a href=?page="&n&"&keywords="&keywords&"&bigc="&bigc&"&smallc="&smallc&" 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&"种信息 " 
  		End Function  
  %>
  		  </td>
        </tr>
 <%end if%>
       </table>
 </td>
    </tr>
</table>
<br />
  <!--#include file="../inc/end.asp"-->
</body>
</html>
 <%
	rs.close
	set rs=nothing
	rsa.close
	conn.close
	set conn=nothing
%>