<!-- #include file="../conn.asp" -->
<!-- #include file="../const.asp" -->
<%call chksunzom()%>
<html>
<head>
<title><%=dianming%> - 登陆日志</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/sunzom.css" rel="stylesheet" type="text/css">

</HEAD>
<BODY>
<script>
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }
</script>
<%
if instr(quanxs,"x9t")<=0 then call sunzomqx()

if request("submit1")<>"" then
id=replace(request("id")," ","")
id=split(id,",")
for i=0 to UBound(id)
  sql="delete from rizi where id="&id(i)
  conn.execute(sql)
  rznr=rznr&","&id(i)
next
conn.execute("insert into rizi(username,class,address,rznr) values('"&nowuser&"','删除日志','"&userip&"','"&rznr&"')")
response.redirect "rizi.asp"
end if
if request("submit2")<>"" then
  sql="delete from rizi where 1=1"
  conn.execute(sql)
conn.execute("insert into rizi(username,class,address,rznr) values('"&nowuser&"','删除日志','"&userip&"','全部日志')")
response.redirect "rizi.asp"
end if
if request("submit3")<>"" then
  sql="delete from rizi where now()-logindate>30"
  conn.execute(sql)
conn.execute("insert into rizi(username,class,address,rznr) values('"&nowuser&"','删除日志','"&userip&"','30天前日志')")
response.redirect "rizi.asp"
end if

'取得当前页码
currentpage=request("page")
'response.write currentpage
'response.end
if currentpage<1 or currentpage="" then
  currentpage="1"
end if
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
<td><img src="../images/r_1.gif" alt="" /></td>
<td width="100%" background="../images/r_0.gif">
  <table cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>&nbsp;登陆日志</td>
	  <td align="right">
	    <input type="button" value="删除所有日志" onClick="if (confirm('此操作无法恢复！！！请慎重！！！\n\n确定要删除所有日志吗？')==true) {window.location.href='?submit2=ok'}" class="button">
	    <input type="button" value="删除30天之前的日志" onClick="if (confirm('此操作无法恢复！！！请慎重！！！\n\n确定要删除所有日志吗？')==true) {window.location.href='?submit3=ok'}" class="button">&nbsp;</td>
    </tr>
  </table>
</td>
<td><img src="../images/r_2.gif" alt="" /></td>
</tr>
<tr>
<td></td>
<td>
<form name="form1" action="">
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
  <tr align="center">
    <td class="category" height="30">登陆用户</td>
    <td class="category">时间</td>
    <td class="category">主题</td>
	<td class="category">登陆IP</td>
    <td class="category">内容</td>
    <td class="category">删除</td>
  </tr>
  <%
  set rs_huiyuan =server.createobject("ADODB.RecordSet")
  sql="select * from rizi order by id desc"
  	
  rs_huiyuan.open sql,conn,1,3
  if not rs_huiyuan.eof then
  rs_huiyuan.pagesize=maxrecord
  rs_huiyuan.absolutepage=currentpage
  for currentrec=1 to rs_huiyuan.pagesize
    if rs_huiyuan.eof then
      exit for
    end if
  %>
  <tr onMouseOver="this.className='highlight'" onMouseOut="this.className=''">
    <td align="center" height="25"><%=rs_huiyuan("username")%></td>
    <td align="center"><%=rs_huiyuan("logindate")%></td>
	<td align="center"><%=rs_huiyuan("class")%></td>
	<td align="center"><%=rs_huiyuan("address")%></td>
    <td align="center" title="<%=rs_huiyuan("rznr")%>"><%=left(rs_huiyuan("rznr"),50)%></td>
    <td align="center"><input type="checkbox" name="ID" value="<%=rs_huiyuan("id")%>" style="border:0"></td>
  </tr>
  <%
    rs_huiyuan.movenext
  next
  else
  %>
  <tr align="center" onMouseOver="this.className='highlight'" onMouseOut="this.className=''">
    <td colspan="6" height="25" align="center" style="color:red"><b>没有找到记录</b></td>
  </tr>
  <%
  end if
  %>
  
  
  
  <%
  if rs_huiyuan.recordcount>0 then 
  %> 
  <tr>
    <td colspan="6" height="30" class="category">
	<table cellpadding=0 cellspacing=0 width="100%">
	<tr>
	<td align="left" style="color:#FF0000;">　</td>  
	<td align="right">
	  &nbsp;&nbsp;
      <%=rs_huiyuan.recordcount%>&nbsp;条信息&nbsp; 共&nbsp;<%=rs_huiyuan.pagecount%>&nbsp;页&nbsp;
  <%
  nowstart=currentpage-3
  if nowstart<1 then
    nowstart=1
  end if
  nowend=currentpage+3
  if nowend>rs_huiyuan.pagecount then
    nowend=rs_huiyuan.pagecount
  end if
  response.write "&nbsp;<a href='?page=1' class='page'>最前页</a>&nbsp;"
  for ipage=nowstart to nowend
    if cstr(ipage)=cstr(currentpage) then
      response.write "&nbsp;<span style='font-weight:bold;color:#5858E6'>" & ipage &"</span>&nbsp;"
    else
      response.write "&nbsp;[&nbsp;<a href='?page="&ipage&"' class='page'>" & ipage &"</a>&nbsp;]&nbsp;"
    end if
  next
  response.write "&nbsp;<a href='?page="&rs_huiyuan.pagecount&"' class='page'>最后页</a>&nbsp;"
%>
    <%if fla38="1" or request.Cookies("sunzom_id")="1" then%>
	<input name="chkall" type="checkbox" id="chkall" value="select" onClick="CheckAll(this.form)" style="border:0"> 全选
	<input type="submit" name="submit1" value="删 除" onClick="return confirm('此操作无法恢复！！！请慎重！！！\n\n确定要删除所选择的记录吗？')" class="button">
	<%end if%>
  </td>
  </tr></table></td></tr>
<%end if%> 
</table>
</form>
</td>
<td></td>
</tr>
<tr>
<td><img src="../images/r_4.gif" alt="" /></td>
<td></td>
<td><img src="../images/r_3.gif" alt="" /></td>
</tr>
</table>
</body>
</html>