<!-- #include file="include/con_forum.asp" -->
<%
'****************************************************
' 阳光情缘 2006V3.0      Power by sdsun.com.cn
' Email: 27072320@qq.com  , sdsun163@163.com
' Web: http://www.sdsun.com.cn
' Copyright (C) 2006 sdsun.com.cn All Rights Reserved.
'****************************************************
if not isnumeric(forumid) then
  call format_redirect("forum.asp")
end if
%>
<!-- #include file="include/con_forum_fir.asp" -->
<!-- #include file="include/con_forum_list.asp" -->
<!-- #include file="include/jk_page_cute.asp" -->
<!-- #include file="include/jk_pagecute.asp" -->
<%
dim secrecy_u,nummer,nums,rssum,page,viewpage,thepages
secrecy_u=false
nummer=dim_num(0)
nums=nummer
page=1
ftit="事件"

call forum_first()
if int(format_mid_num(28))=1 or forum_config(2)=1 then secrecy_u=true
call web_head(0,0,h_var3,0,0)
call forum_load()
'----------------------------中间 开始----------------------------
call forum_grade()
call forum_top(tit)
if trim(request.querystring("online"))="view" then 
  call forum_user_online()
end if

select case action
case "delete"
  call forum_event_delete()
case else
  call forum_event_body()
end select

response.write vbcrlf&ukong
'----------------------------中间 结束----------------------------
call forum_end()
call web_end(0,0)

sub forum_event_body()
  dim temp1,sql_add,pageurl,tim
  pageurl="?forum_id="&forumid&"&action="&action&"&"
  temp1=""
  sql_add=""
  sql="select count(id) from bbs_event where forum_id="&forumid&sql_add
  set rs=joekoe_cms.exec(sql,1)
  rssum=rs(0)
  rs.close
%>
<table cellspacing=1 cellpadding=1 class=table>
<form name=del_form action='?forum_id=<%=forumid%>&action=delete' method=post>
<tr align=center height=20>
<td width='4%' class=td>序号</td>
<% if forum_power_true(forumpower)=true then %>
<td width='58%' class=td>事件内容(查看所有事件记录)</td>
<%else%>
<td width='64%' class=td>事件内容(查看所有事件记录)</td>
<% end if %>
<td width='11%' class=td>操作用户</td>
<td width='12%' class=td>操作时间</td>
<td width='11%' class=td>操作人</td>
<% if forum_power_true(forumpower)=true then %>
<td width='4%' class=td>操作</td>
<%else%>
<% end if %>
</tr>
<%
  call format_pagecute()
  sql="select top "&nummer*viewpage&" * from bbs_event where forum_id="&forumid&sql_add&" order by id desc"
  call joekoe_cms.exec("",-1)
  rs.open sql,conn,1,1
  if rs.eof then
    nums=0
  else
    if int(viewpage)>1 then
      rs.move (viewpage-1)*nummer
    end if
    if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
  end if
  for i=1 to nums
    tim=rs("tim")
    response.write vbcrlf&"<tr class=bg_td align=center height=25>" & _
		   vbcrlf&"<td class=bg_tds>"&(viewpage-1)*nummer+i&"</td>" & _
		   vbcrlf&"<td align=left>"&joekoe_cms.code_html(rs("remark"),1,0)&"</td>" & _
		   vbcrlf&"<td class=bg_tds>"&format_user_name(rs("o_user"),1,"")&"</td>" & _
		   vbcrlf&"<td><font class=gray alt='"&tim&"'>"&joekoe_cms.time_type(tim,3)&"</font></td>" & _
		   vbcrlf&"<td class=bg_tds>"
    if secrecy_u=true then
      if login_mode<>"admin" then
       response.write "<font class=gray>保密</font>"
      else
        response.write format_user_name(rs("username"),1,"")
      end if
    else
      response.write format_user_name(rs("username"),1,"")
    end if
    response.write "</td>"
    if forum_power_true(forumpower)=true then
	  response.write "<td><input type=checkbox name=sel_id value='"&rs("id")&"' class=bg_td></td>"
	end if
	response.write "</tr>"
    rs.movenext
  next
  rs.close
%>
</table>
<table cellspacing=1 cellpadding=1 class=table>
<tr height=25 class=bg_3 bgcolor="#f7f7f7">
<td width='75%' >
&nbsp;共有 <font class=red><%response.write rssum%></font> 条事件&nbsp;
页次：<font class=red><%response.write viewpage&"</font>/<font class=red>"&thepages%></font>&nbsp;
分页：<% response.write jk_pagecute(nummer,thepages,viewpage,pageurl,10,"#ff0000") %>
</td>
<% if forum_power_true(forumpower)=true then %>
<td align=right><input type=submit value='删除所选' onclick="return sel_click(this.form);">&nbsp;&nbsp;&nbsp;&nbsp;全选&nbsp;<input type=checkbox name=sel_all value='yes' onclick="javascript:select_all(this.form);">&nbsp;</td>
<% end if %>
</tr>
</form>
</table>
<%
end sub

sub forum_event_delete()
  if forum_power_true(forumpower)=false then exit sub
  dim sel_id,sdim,snum
    sel_id=trim(request.form("sel_id"))
    sel_id=replace(sel_id," ","")
    if sel_id="" then
      call web_js_msg(1,"没有可删除的"&ftit&"！","?forum_id="&forumid)
    end if
  
  sdim=split(sel_id,",")
  snum=ubound(sdim)
  for i=0 to snum
    if isnumeric(sdim(i)) then
        sql="delete from bbs_event where id="&sdim(i)
      call joekoe_cms.exec(sql,0)
    end if
  next
  erase sdim
  call web_js_msg(1,"已从"&ftit&"中成功删除"&(snum+1)&"条记录！","?forum_id="&forumid)
end sub
'****************************************************
' 阳光情缘 2006V3.0      Power by sdsun.com.cn
' Email: 27072320@qq.com  , sdsun163@163.com
' Web: http://www.sdsun.com.cn
' Copyright (C) 2006 sdsun.com.cn All Rights Reserved.
'****************************************************
%>