<!-- #Include File="Include/AMH_onlogin.asp" -->
<!-- #Include File="../Include/Cls_IpSys.asp" -->
<%
'=======================================================
' 欢迎使用《阿赛大型门户网站系统V2.0》，简称“AsaiMHV2”
' 技术支持、商业版咨询、官方唯一指定联系QQ“4941172”
' 官方网站：http://77ya.com      程序负责人：阿赛
'=======================================================

Admins = True
Index_Url="event"
Data_Name="AsaiMHEvent"
tit_fir="日志"
tit="管理日志"
'Call Format_Search("remark","username,nname",2,1)
Call AMH_Header(1)
%>
<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>
  </table>
</td></tr>
<tr><td colspan=2 align=center>
  <table border=0 cellspacing=0 cellpadding=2>
  <form action='?' method=get>
  <td>搜索（<%Response.Write tit_fir%>）关键字：</td>
  <td><input type=text name=keyword value='<%=Cls.Code_Query("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></select></td>
  <td><input type=submit value='搜索' class=btn></td>
  </tr>
  </form>
  </table>
</td></tr>
</table>
<%
Call AMH_Table(1)
Select Case Action
Case "delete"
	AsaiMHEvent_Delete()
Case "clear"
	AsaiMHEvent_Clear()
Case Else
	AsaiMHEvent_Main()
End Select
Call AMH_Ender(tit)

'//* 删除选中的日志 *//
Sub AsaiMHEvent_Delete()
	Dim sel_id,ddim,dnum,ni
	sel_id=Cls.Code_Form("sel_id")
	sel_id=Replace(sel_id," ","")
	If sel_id="" Then
		Call AsaiMHEvent_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 Cls.Exec("Delete From ["&Data_Name&"] Where DateDiff("&s_d&",tim,"&s_tim&")>5 or id="&ddim(i),0)
			ni=ni+1
		End If
	Next
	Call AMH_Msg("已成功删除 "&ni&" 条"&tit_fir&"！","?",1)
End Sub

'//* 清除全部日志 *//
Sub AsaiMHEvent_Clear()
	Call Cls.Exec("Delete From "&Data_Name,0)
	Call AMH_Msg("已成功清空"&tit_fir&"！","?",1)
End Sub

'//* 日志列表 *//
Sub AsaiMHEvent_Main()
	Dim remark, tim, tmp_sql
	Dim obj_page, obj_search
%>
<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='36%'><%Response.Write tit_fir%>操作内容</td>
<td class=td width='12%'>操作时间</td>
<td class=td width='12%'>登陆IP</td>
<td class=td width='6%'>属性</td>
<td class=td width='6%'><input type=checkbox name=sel_all value='yes' onclick="javascript:select_all(this.form);"></td>
</tr>
<%
	Set obj_search=New Cls_Search
	Call obj_search.format_search("remark","username,nname",2,1,0)
	tmp_sql=obj_search.inc_sql
	Set obj_search=nothing
	Set obj_page=New Cls_PageCute
	obj_page.pageurl="?"
	obj_page.nummer=nummer
	obj_page.page_t=1
	obj_page.page_p=5
	obj_page.page_unit="条"
	obj_page.page_tit=tit_fir
	obj_page.v_id="id"
	Call obj_page.p_init("*",Data_Name,tmp_sql,"id desc")
	SQL=obj_page.sql_count
	Set Rs=Cls.Exec(SQL,1)
	obj_page.rssum=Rs(0)
	Rs.Close
	Call obj_page.p_main("*",Data_Name,tmp_sql,"id desc")
	For i=1 To obj_page.page_num
		remark=Rs("remark")
		tim=Rs("tim")
%>
<tr align=center>
<td class=Gys><%Response.Write obj_page.page_now+i%></td>
<td><%Response.Write rs("nname")%></td>
<td><%Response.Write format_user_view(rs("username"),1,0)%></td>
<td align=left><%Response.Write remark%></td>
<td><font alt='操作时间：<%Response.Write Cls.time_type(tim,2)%>'><%Response.Write Cls.time_type(tim,3)%></font></td>
<td><a href='<%Response.Write Cls.Web_Dir%>Common/Ip_Address.asp?ip=<%Response.Write rs("IP")%>'><%Response.Write rs("IP")%></td>
<td><%Response.Write img_admin("sys",view_sys(rs("sys"),0))%></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=5>
  <table border=0 cellspacing=0 cellpadding=2>
  <tr class=tr1>
  <td><%Response.Write obj_page.page_var%></td>
  <td width=3></td>
  <td>分页：</td>
  <td><%Response.Write obj_page.page_cute%></td>
  </tr>
  </table>
</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);" class=btn>
</td>
</tr>
</form>
<%
	Set obj_page=Nothing
End Sub
%>
