<%@ codepage ="936" %>
 <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="81"
	dir="../err.asp" 
  %>
  <!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include file="../../inc/FileSystem.asp"-->
 <!--#include file="../rolecheck.asp"-->


<LINK href="../css/style.css" rel=stylesheet type=text/css> 
<SCRIPT language=javascript1.2 src="../css/iXs_Main.js"></SCRIPT>
  <script>
	var checkflag="false";
	function check(field){
	   if(checkflag=="false"){
		for(i=0;i<field.length;i++){
		field[i].checked=true;}
		checkflag="true";
		return "解除全选"; }
		else {
		for(i=0;i<field.length;i++) {
		field[i].checked=false;}
		checkflag="false";
		return "选择全部";
		}
	 }
	 function isok()
	 {
	 var i=confirm("确定要删除吗?");
	 if(i)
	 {
	 return true;
	
    }
	else
	{
	return false;
	}
	 }
</script>
<title>帮助信息管理</title>
<%
if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim log_id
for i = 0 to ubound(idarr)
log_id=clng(idarr(i))
AdminContent=GetLogValue(127)
EndLogin=127
Call SendAdminLog(username,EndLogin,AdminContent)
call deleteannounce(log_id)
next
else
AdminContent=GetLogValue(127)
EndLogin=127
Call SendAdminLog(username,EndLogin,AdminContent)
call deleteannounce(clng(idlist))
end if
end if
keywords=replace_text(request("keywords"))
if request("sortid")<>"" then
 sortid=Replace_Text(request("sortid"))
 end if
if request("typeid")<>"" then
 typeid=Replace_Text(request("typeid"))
 end if

set rs=server.createobject("adodb.recordset") 
sql="select * from Yixiang_help"
if sortid<>"" then sql=sql&" where sortid="&sortid&""
if typeid<>"" then sql=sql&" and typeid="&typeid&""
if keywords<>"" then sql=sql&" and showname like '%"&keywords&"%'"

sql=sql&" order by ID desc"
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1 

msg_per_page=20 '定义每页显示记录条数
%>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder"> 
  <tr> 
     <th height=25 colspan="2" class="tableHeaderText">帮助信息管理 </th> 
  </tr> 
  <tr> 
     <td  colspan="2"   height="20"><font color="#666666">温馨提示：
         ①类别直接与发布的信息相关联，删除类别可能会影响到以前发布的帮助信息。</font> </td> 
   </tr> 
  <tr> 
     <td width="10%" height=25 class="forumRowHighlight"> <B>操作选项</B></td> 
         <FORM name=searchForm action="index.asp" method=post  ><td class="forumRowHighlight">
       关键字：<input name="keywords" type="text" value="<%=keywords%>">
&nbsp;商机类别：
<select name="sortid" size="1">  
<%
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from Yixiang_help_sort"
rs1.open sql1,conn,1,1
if not rs1.eof then
do while not rs1.eof
response.write "<option value='"&rs1("sortid")&"'>"&rs1("sort")&"</option>"&chr(13)+chr(10)
rs1.movenext
loop
rs1.close
end if
%>
</select> <input type="submit" value="立刻查找" id=submit name=submit>
         </td></form>
  </tr><Tr><td colspan="2" height="1"  bgcolor="#CCCCCC"></td></Tr>
  <tr>
    <td height=25 class="forumRowHighlight">&nbsp;</td>
	 <td class="forumRowHighlight"><a href="index.asp">管理帮助信息</a> | <a href="addhelp.asp">添加帮助信息</a> | <a href="sort.asp">管理帮助类别</a> | <a href="Admin_Class_Ok.asp?action=add_help_sort">添加帮助类别</a> | [<a href="javascript:location.reload()">刷新页面</a>] </td> 
  </tr> 
</table>
<SCRIPT LANGUAGE='JavaScript' SRC='/js/search.js' TYPE='text/javascript'></script>
<!--#include file="../../inc/headpage.asp"-->
  <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
<Form name="search" method="POST" action="index.asp">
  <tr><td colspan="5">			<%
if rs.eof then
response.Write"<br><br><div align='center'>暂无数据信息</div><br><br>"
else
%> </td></tr>
    <TR height=25 class=bodytitle>
<TD width="391" height="29" align="left" class=bodytitle><font color="ff6600"><b>标题</b></font></td>
<TD width="193" align="left" class=bodytitle><font color="ff6600"><b>所属类别</b></font></td>
<TD width="88" align="center" class=bodytitle><font color="ff6600"><b>发布日期</b></font></td>
<TD width="195" align="center" class=bodytitle><font color="ff6600"><b>操作</b></font></td>
<TD width="61" align="center" class=bodytitle><input type='submit' value='删除' onclick="return isok();"></td>
</TR>
<%
do while not rs.eof and rowcount > 0%> 
<TR height="20"> 
<TD align="left" class=forumRow>
<a href="<%=HOPE_InstallDir%>help/bin/detail/<%=rs("sortid")%>-<%=rs("typeid")%>-<%=rs("id")%>.html"  target="_blank">
<% Set re = New RegExp
re.Pattern ="("&keywords&")"
re.IgnoreCase = True
re.Global=True
result = re.Replace(rs("showname"), "<font color=red>$1</font>")%><%=result%></a></td>
<TD align="left" class=forumRow><%
set rs3=server.CreateObject("adodb.recordset")
sql3="select sortid,sort from Yixiang_help_sort where sortid="&rs("sortid")
rs3.open sql3,conn,1,1
if not rs3.eof then
  response.write"<a href='index.asp?sortid="&rs3("sortid")&"'>"&rs3("sort")&"</a>"
  rs3.close
end if
%> > <%
set rs5=server.CreateObject("adodb.recordset")
sql5="select typeid,typename from Yixiang_help_type where typeid="&rs("typeid")
rs5.open sql5,conn,1,1
 if not rs5.eof then 
response.write"<a href='index.asp?sortid="&rs("sortid")&"&typeid="&rs5("typeid")&"'>"&rs5("typename")&""
 rs5.close
end if
title=""
if rs("html_pass")=0 then 
	title="还没有生成静态，点击生成"
else 
	title="已经生成静态，点击更新生成操作"
end if
%></td>
<TD width="88" align="center" class=forumRow><%=FormatDate(rs("dateandtime"),2)%>　</td>
<TD align="center" class=forumRow><a href="edit.asp?id=<%=rs("id")%>">修改</a>/生成页面(
		  <a href="../../manage/makehtml/help/makedetail.asp?all=help&selAnnounce=<%=rs(0)%>" title="<%=title%>">
		  <%if rs("html_pass")=0 then response.write("未生成") else response.write("已生成") end if%></a>)</td>
<TD width="61" align="center" class=forumRow><input type='checkbox' name='selAnnounce' value='<%=cstr(rs("ID"))%>'></td>
</TR>
<%
icolor=icolor+1
if icolor>1 then icolor=0
rowcount=rowcount-1
rs.movenext
loop
end if
%>
<TR height="20" bgcolor="#ffffff">
  <TD colspan="5" align="left" class=forumRow><div align="right">
  <input type="submit" name="mobanbtn" value=" 批量默认模版页生成 " onclick="javascript:document.getElementById('search').action='../../manage/makehtml/help/makedetail.asp?all=help';"> 
  <input type=button value=" 全部选定 " onClick="this.value=check(this.form)"></div></td>
  </TR>
<TR height="20" bgcolor="#ffffff">
  <TD class=forumrowHighLight align="center" colspan="5"><b><%=listPages("index.asp?sortid="&sortid&"&keywords="&keywords&"")%></b></td>
</TR></form>
  </TABLE>
  <%
sub deleteannounce(id)
dim rs,sql
	Set RsHelp=Conn.Execute("Select id,sortid,typeid from yixiang_help Where id="&id&"")
		if NOt RsHelp.Eof Then 
			ttid=RsHelp("id")
			sortid=RsHelp("sortid")
			typeid=RsHelp("typeid")
		End if
		FileName=HOPE_InstallDir&"help/bin/detail/"&sortid&"-"&typeid&"-"&ttid&".html"
		  Call FileDel(FileName)
		 
		RsHelp.Close
		Set RsHelp=NOthing
set rs=server.createobject("adodb.recordset")
sql="delete from [Yixiang_help] where id="&cstr(id)
conn.execute sql
if err.Number<>0 then
err.clear
response.write "删 除 失 败 !<br>"
end if
End sub
%>
<!--#include file="../copy.asp" -->