<!-- #include file="include/adovbs.inc" -->
<!-- #include file="include/dataconn.asp" -->
<!-- #include file="include/checksession.asp" -->
<!-- #include file="include/168soft_SqlIn.Asp" -->
<%
URL						= Request.ServerVariables("URL")
Action					= Request("Action")

' Call Main()
If Action="del" Then
	Call Delip()
ElseIf Action="lock" Then
	Call lockIP()
ElseIf Action="unlock" Then
	Call UnLockip()
ElseIf Action="Logout" Then
	Call Logout()
Else
	Call Main()
End If

Sub Delip()
dim id 
id = clng(request("id"))
conn.execute("delete from SqlIn where id="&id)
Call Main()
End sub

Sub Lockip()
id = clng(request("id"))
conn.execute("update SqlIn set Kill_ip=true where id="&id)
Call Main()
End sub

Sub UnLockip()
id = clng(request("id"))
conn.execute("update SqlIn set Kill_ip=False where id="&id)
Call Main()
End sub

Sub Main()
%>
<link rel="stylesheet" href="include/e1.css" type="text/css">
  <style type="text/css">
<!--

table {
	font: 14px Tahoma, Verdana, "宋体";
}
a:link, a:visited {
	text-decoration: none;
	color: #036;
	font-family: Tahoma, Verdana, "宋体";
}
a:hover {
	text-decoration: none;
	color: #F90;
	font-family: Tahoma, Verdana, "宋体";
}
-->
</style>
<script language=JavaScript>
<!--
var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// --> 
</script>
<script>
	function makesure()
	{
		return(confirm("此操作将删除此锁定记录，删除后此IP将不再被锁定\n你确定要删除吗？"))
	}
</script>	
    
<p align="center"><font color="#336699" size="4"><strong>安 全 管 理</strong></font></p>
<table align="center" bgcolor="#AAAAAA" border="0" cellpadding="0" cellspacing="0" width="95%"><tr>
<td>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1">
        <tr align=center class="tdTitle">
<%
sql="select * from SqlIn order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
	response.write "<td>暂  无  系 统 被 攻 击 锁 定 记 录</td>"
else
'分页的实现 
listnum=10
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum
i=0
nn=request("page")
if nn="" then
n=0
else
nn=nn-1
n=listnum*nn
end if%>
<td width="2%" height=20><strong><font color="#FFFFFF">行</font></strong></td>
<td width="10%"><font color=#FFFFFF><strong>操作ＩＰ</strong></font></td>
 <td width="10%">是否锁定</td>
 <td width="18%">操作时间</td>
 <td width="10%">提交方式</td>
 <td width="10%">提交数据</td>
 <td width="10%">操作</td>
</tr>
<%do while not rs.eof and i<listnum
n=n+1%>
        <tr align=center bgcolor="#FFFFFF" height=20> 
          <td><%=n%></td>
          <td><%=rs("SqlIn_IP")%>
</td>
          <td> 
            <%	if rs("Kill_ip")=true then 
			response.write "<font color='red'>已锁定</font>"
		else
			response.write "<font color='green'>已解锁</font>"
		end if
	%></td>
          <td><%=rs("SqlIn_TIME")%></td>
          <td><%=rs("SqlIn_FS")%></td>
          <td><%=rs("SqlIn_SJ")%></td>
          <td><a onclick="return makesure();" href=<%=URL%>?action=del&id=<%=rs("id")%>>删除</a>&nbsp; 
            <%	if rs("Kill_ip")=true then 
			response.write "<a href="&URL&"?action=unlock&id="&rs("id")&">解锁IP</a>"
		else
			response.write "<a href="&URL&"?action=lock&id="&rs("id")&">锁定IP</a>"
		end if
	%>
 
 </td>
</tr>
<%rs.movenext 
i=i+1 
j=j-1
loop%>
        <tr bgcolor="#FFFFFF"> 
          <%filename=URL%>
          <td colspan=9 align=right><%=Rs.recordcount%> 条记录&nbsp;&nbsp;<%=listnum%> 条记录/页&nbsp;&nbsp;共 <%=rs.pagecount%> 页 
      <% if page=1 then %>
      <%else%>
      <a href=<%=filename%>><strong>|<<</strong></a>
      <a href=<%=filename%>?page=<%=page-1%>><strong><<</strong></a>
      <a href=<%=filename%>?page=<%=page-1%>><b>[<%=page-1%>]</b></a>
      <%end if%><% if rs.pagecount=1 then%><%else%><b>[<%=page%>]</b><%end if%>
	  <% if rs.pagecount-page <> 0 then %>
      <a href=<%=filename%>?page=<%=page+1%>><b>[<%=page+1%>]</b></a>
      <a href=<%=filename%>?page=<%=page+1%>><strong>>></strong></a>
      <a href=<%=filename%>?page=<%=rs.pagecount%>><strong>>>|</strong></a>
	  <%end if%></td>
<%end if%></tr> 
</table>
</TD>
</TR>
</TABLE>
<%
end sub
%>