<!-- #include file="include/admin_onlogin.asp" -->
<!-- #include file="include/jk_ip_sys.asp" -->
<%
admins=true
nsort="event"
index_url="event"
data_name="admin_event"
tit_fir="日记"
tit="管理日记"
call format_search("remark","username,nname",2,1)
call admin_header(0,0)
%>
<tr><td align=center colspan=2 height=30>
  <table border=0>
  <form action='?' method=get>
  <tr>
  <td><a href='?'>所有<%response.write tit%></a></td>
  <td width=5></td>
  <td><a href='?action=clear' onclick="return click_return('清空所有<%response.write tit_fir%>',0);">清空所有<%response.write tit_fir%></a></td>
  <td width=10></td>
  <td>关键字：</td>
  <td><input type=text name=keyword value='<%response.write keyword%>' size=15 maxlength=20></td>
  <td><select name=sea_type size=1>
<option value='remark'>按<%response.write tit_fir%>内容</option>
<option value='nname'>按栏目</option>
<option value='username'>按管理员</option>
</select></td>
  <td><select name=sea_term sizs=1><option value='all'>满足所有条件</option><option value='only'>满足一个条件</option></seelct></td>
  <td><input type=submit value='搜索'></td>
  </tr>
  </form>
  </table>
</td></tr>
</table>
<%
call admin_table(1,0)

select case action
case "delete"
  call joekoe_chk_delete()
case "clear"
  call joekoe_chk_clear()
case else
  call joekoe_chk_main()
end select

call admin_ender(1)

sub joekoe_chk_delete()
  dim sel_id,ddim,dnum,ni
  sel_id=trim(request.form("sel_id"))
  sel_id=replace(sel_id," ","")
  if sel_id="" then
    call joekoe_chk_main()
    exit sub
  end if
  ddim=split(sel_id,",")
  dnum=ubound(ddim)
  ni=0
  for i=0 to dnum
    if isnumeric(ddim(i)) then
      call joekoe_cms.exec("delete from "&data_name&" where id="&ddim(i),0)
      ni=ni+1
    end if
  next
  call admin_msg("已成功删除 "&ni&" 条"&tit_fir&"！","?",1)
end sub

sub joekoe_chk_clear()
  call joekoe_cms.exec("delete from "&data_name,0)
  call admin_msg("已成功清空"&tit_fir&"！","?",1)
end sub

sub joekoe_chk_main()
  dim remark,tim
%>
<form name=sel_form action='?action=delete' method=post>
<tr align=center>
<td class=td width='6%'>序号</td>
<td class=td width='12%'>栏目</td>
<td class=td width='12%'>管理员</td>
<td class=td width='41%'><%response.write tit_fir%>操作内容</td>
<td class=td width='15%'>操作时间</td>
<td class=td width='8%'>属性</td>
<td class=td width='6%'><input type=checkbox name=sel_all value='yes' onclick="javascript:select_all(this.form);"></td>
</tr>
<%
  sql="select count(id) from "&data_name&sql_add
  set rs=joekoe_cms.exec(sql,1)
  rssum=rs(0)
  rs.close
  call format_pagecute()
  sql="select top "&nummer*viewpage&" * from "&data_name&sql_add&" order by id desc"
  call joekoe_cms.exec(sql,-1)
  rs.open sql,conn,1,1
  if int(viewpage)>1 then rs.move (viewpage-1)*nummer
  if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
  for i=1 to nums
    remark=rs("remark")
    tim=rs("tim")
%>
<tr align=center>
<td><%response.write (viewpage-1)*nummer+i%></td>
<td><%response.write rs("nname")%></td>
<td><%response.write format_user_view(rs("username"),1,0)%></td>
<td align=left><a alt='<%response.write tit_fir%>详细内容：<%response.write joekoe_cms.code_html(remark,1,0)%>'><%response.write joekoe_cms.code_html(remark,1,(20+tnum))%></a></td>
<td><font alt='操作时间：<%response.write joekoe_cms.time_type(tim,2)%>'><%response.write joekoe_cms.time_type(tim,3)%></font></td>
<td><%response.write img_admin("ip","IP："&rs("ip"))&"&nbsp;&nbsp;"&img_admin("sys",view_sys(rs("sys")))%></td>
<td><input type=checkbox name=sel_id value='<%response.write rs("id")%>'></td>
</tr>
<%
    rs.movenext
  next
  rs.close
%>
<tr class=tr1>
<td colspan=4>
现有<font class=red><%response.write rssum%></font>条<%response.write tit_fir%>，
每页<font class=red><%response.write nummer%></font>条，
页次：<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font>
分页：<%response.write jk_pagecute(nummer,thepages,viewpage,pageurl,5,"#ff0000")%>
</td>
<td colspan=3 align=center>
执行
<select name=sel_type size=1>
<option value='delete'>删除</option>
</select>
<input type=submit value='操作' onclick="return sel_click(this.form);">
</td>
</tr>
</form>
<%
end sub
%>