  <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="112"
	dir="../err.asp" 
  %>
  <!--#include file="../../conn/conn.asp"-->
  <!--#include file="../rolecheck.asp"--><head> 
<title>后台管理LOG日志</title> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head> 
<LINK href="../css/style.css" rel=stylesheet type=text/css>
<SCRIPT language=javascript>
function unselectall(){
    if(document.myform.chkAll.checked){
 document.myform.chkAll.checked = document.myform.chkAll.checked&0;
    }
}
function CheckAll(form){
  for (var i=0;i<form.elements.length;i++){
    var e = form.elements[i];
    if (e.Name != 'chkAll'&&e.disabled==false)
       e.checked = form.chkAll.checked;
    }
  }
 	</SCRIPT>
	<% 
 	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))
	call deleteannounce(log_id)
	next
	
	else
	
	call deleteannounce(clng(idlist))
	end if
	end if 
	 
	%>
<body style="font-size: 9pt">


<table cellpadding=2 cellspacing=1 border=0 width=98% class=tableBorder align=center>
  <TR>
    <TH class=tableHeaderText colSpan=2 height=25>网站后台日志管理</TH>
  </TR>
</table>
<%
SQL="SELECT * from Websen_web_manage_log order by dat desc" 
 Set rs=Server.CreateObject("ADODB.RecordSet") 
	rs.Open sql,conn,1,1 
                Const MaxPerPage=15
   				dim totalPut   
   				dim CurrentPage
   				dim TotalPages
   				dim j
   				dim sql
    				if Not isempty(request("page")) then
      				currentPage=Cint(request("page"))
   				else
      				currentPage=1
   				end if
if rs.eof then
%>
<table width="98%" border="1"  bordercolor="#2178EA" align="center" cellpadding="0" cellspacing="0" style="border-collapse:collapse">
<tr><td align="center" height="40" bgcolor="#FAFAFA">暂时没有记录!</td></tr></table>
<%
 
end if


 if not rs.eof then
 totalPut=rs.recordcount

      				if currentpage<=1 then
          				currentpage=1
      				end if

      				if (currentpage-1)*MaxPerPage>totalput then
	   					if (totalPut mod MaxPerPage)=0 then
	     					currentpage= totalPut / MaxPerPage
	   					else
	      					currentpage= totalPut / MaxPerPage + 1
	   					end if
      				end if

       				if currentPage=1 then
            			showContent
            			showpage totalput,MaxPerPage,"dispcont.asp"
       				else
          				if (currentPage-1)*MaxPerPage<totalPut then
            				rs.move  (currentPage-1)*MaxPerPage
            				dim bookmark
            				bookmark=rs.bookmark
            				showContent
             				showpage totalput,MaxPerPage,"dispcont.asp"
        				else
	        				currentPage=1
           					showContent
           					showpage totalput,MaxPerPage,"dispcont.asp"
	      				end if
	   				end if
					end if
					sub showContent
       			dim i
	   			i=0
			 
  
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="2">
 <Form name="form" method="POST" action="dispcont.asp"> 

 <tr>
    <td width="5%" class="forumRowHighlight">选中</td>
    <td width="5%" class="forumRowHighlight">编号</td>
    <td width="18%" class="forumRowHighlight">最后登陆后台时间</td>
    <td width="20%" class="forumRowHighlight">最后登陆IP</td>
    <td width="12%" class="forumRowHighlight">登陆后台次数</td>
    <td width="17%" class="forumRowHighlight">首次登陆后台日期</td>
    <td width="8%" class="forumRowHighlight">登陆用户</td>
	    <td width="8%" class="forumRowHighlight">登陆结果</td>
	    <td width="7%" class="forumRowHighlight"  align=center>IP锁定</td>
  </tr> 
  <%
  
 do while not rs.eof 
 
	csi=csi+rs("cs") 
	if rs("cs")=1 then cs1=cs1+1 
	if datevalue(rs("dat"))=date then 
	csdat1=csdat1+1 
	end if
%>
 
 
 <tr> 
 <td class=forumRow><input name='selAnnounce' type='checkbox' value=<%=cstr(rs("log_id"))%>></td>  
 <td class=forumRow><%=rs("log_id")%></td>  
 <td class=forumRow><%=rs("dat")%></td>  
 <td class=forumRow><%=rs("IP")%></td>  
 <td class=forumRow><%=rs("CS")%></td>  
 <td class=forumRow><%=rs("DAT1")%> </td> 
 <td class=forumRow><%=rs("admin_username")%> </td> 
 <td class=forumRow style='color:red;'>
 <%
if rs("EndLogin")=1 then 
	Response.write "<span style='color:red;'>登录成功</span>"
else
	Response.write "<span style='color:#6666FF;'>登录失败</span>"
end if
%></td>
  <td width="20%" class="forumRowHighlight" align=center><a href="HOPE_IPset.asp?HOPE_IP=<%=rs("IP")%>&HOPE_action=Add">锁定</a></td>

 </tr> 
 <%
rs.movenext 
i=i+1
			if i>=MaxPerPage then Exit Do
loop 
				rs.close
		set rs=nothing
  
 
%> 
 
	<tr><td class=forumrowHighLight colspan=9>请选择要删除的事件，<input name='chkAll' type='checkbox' id='chkAll' onclick='CheckAll(this.form)' value='checkbox'>全选 <input type=submit name=act value=删除日志  onclick="{if(confirm('您确定执行的操作吗?')){this.document.even.submit();return true;}return false;}">　
	</td>
	</tr></form> 
</table>

 
<%end sub%>
<% 
	sub deleteannounce(log_id)
	dim rs,sql
	 
	conn.execute="delete from [Websen_web_manage_log] where log_id="&log_id
	 
	End sub
	Function showpage(totalnumber,maxperpage,filename)  
							Dim n
							
							If totalnumber Mod maxperpage=0 Then  
								n= totalnumber \ maxperpage  
							Else
								n= totalnumber \ maxperpage+1  
							End If
							
							Response.Write "<form method=Post action="&filename&"  >"  
							Response.Write "<p align='center' class='contents'> "  
							If CurrentPage<2 Then  
								Response.Write "<font class='contents'>首页 上一页</font> "  
							Else  
								Response.Write "<a href="&filename&"?page=1 class='contents'>首页</a> "  
								Response.Write "<a href="&filename&"?page="&CurrentPage-1&"  class='contents'>上一页</a> "  
							End If
							
							If n-currentpage<1 Then  
								Response.Write "<font class='contents'>下一页 尾页</font>"  
							Else  
								Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&" class='contents'>"  
								Response.Write "下一页</a> <a href="&filename&"?page="&n&" class='contents'>尾页</a>"  
							End If  
								Response.Write "<font class='contents'> 页次：</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "  
								Response.Write "<font class='contents'> 共有"&totalnumber&"记录,每页显示"&maxperpage&"条记录 " 
								 
								Response.Write "&nbsp; </form>"  
							End Function  
	
%>
  </td>
  </tr>
</table>
<!--#include file="../copy.asp"-->