<!--#include file="inc.asp"-->
<!--#include file="check.asp"-->
<%
act=request("act")
id=request("id")
if act="del" then
dim idarr
idArr=split(id)
for i = 0 to ubound(idarr)
id=idarr(i)
    dim sql  
    sql="delete from killip where id in ("&cstr(id)&")"
    conn.execute sql
    if err.Number<>0 then 
	err.clear 
	response.write "删 除 失 败 !<br>" 
    end if 
next
Response.write "<SCRIPT language=JavaScript>alert('删除成功！');window.location.href='?page="&request("page")&"';</SCRIPT>"
elseif act="save" then
if Request.form("ip")<>"" then
conn.Execute("insert into KillIP(IP) values('"&Request.form("ip")&"')")
conn.close
Set conn = Nothing
Response.write "<SCRIPT language=JavaScript>alert('添加成功！');window.location.href='?';</SCRIPT>"
else
Response.write "<SCRIPT language=JavaScript>alert('???没有东东\n\n添 加 失 败！');history.go(-1);</SCRIPT>"
end if
elseif act="add" then
call add()
else
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="images/Admin_Style.css">
<head>
<title>福建音乐视听网 管理中心</title>
<SCRIPT language=JavaScript>
<!--

function CheckAll(v)
	{
		var i;
		for (i=0;i<document.forms.elements.length;i++)
		{
			var e = document.forms.elements[i];
		        e.checked = v;
		}
	}
	
function OnDelete()
 {
		var del, a, i;
		del = new String("");
		for(i = 0; i < document.forms.elements.length ; i ++)
		{
			var e = document.forms.elements[i];
			if(e.name == 'checkbox')
			{
			   if ( e.checked == true)
			   {
		   		a = e.value;
				del = del + a + ";";
			   }
			};
		}

 if(del == "")
		{
			alert("请选择要删除的IP")

		}
else
		{
	if(confirm("确定要删除吗?")==true)

 {

document.forms.submit();
		}
		}
	}
function check()
{
   if (isNaN(go2to.page.value))
		alert("请正确填写转到页数！");
   else if (go2to.page.value=="") 
	     {
		alert("请输入转到页数！");
		 }
   else
		go2to.submit();
}
//-->
</SCRIPT>
<style type="text/css">
<!--
.style1 {
	color: #FF0000;
	font-weight: bold;
}
.style2 {
	color: #0000FF;
	font-weight: bold;
}
-->
</style>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr class="topbg"> 
    <td height="22" colspan="2"  align="center"><strong>IP 管 理</strong></td>
  </tr>
  <tr class="tdbg"> 
    <td width="70" height="30" ><strong>管理导航：</strong></td>
    <td><a href="0hao_sql.asp">SQL注入管理</a>&nbsp;| <a href="0hao_lockip.asp">IP 管 理</a>&nbsp;| <a href="?act=add">添加 IP</a>&nbsp; &nbsp; 非法SQL注入三次IP自动被锁定</td>
  </tr>
</table>
<br>
<div align="center">
  <% set rs=server.createobject("adodb.recordset") 
              if not isempty(request("page")) then   
	          pagecount=cint(request("page"))   
              else   
	          pagecount=1   
              end if
			  sql="select * from killip order by id desc"
              rs.open sql,conn,1,1         
              rs.pagesize=15
              if pagecount>rs.pagecount or pagecount<=0 then              
              pagecount=1              
              end if              
              %>
			    <%if rs.eof and rs.bof then%>   
                对不起，该栏目还没有任何IP
                <%else%>
  
</div>
<table width='100%' border="0" align="center" cellpadding="0" cellspacing="0">
  <form method="post" action="?act=del&page=<%=request("page")%>"><tr>
    
     <td><table width="100%" border="0" cellpadding="0" cellspacing="1" class="border">
       <tr bgcolor="bde9ff" class="title" height="22">
         <td width="5%" height="22" align="center"><strong>选中</strong></td>
         <td width="5%"  height="22" align="center"><strong>ID</strong></td>
         <td width="27%" align="center" ><strong>IP地址</strong></td>
         <td width="42%" align="center" >提交时间</td>
         <td width="21%" align="center" >类型</td>
         </tr>
          <%rs.AbsolutePage=pagecount 
					 do while not rs.eof %>
	   <tr class="tdbg" onMouseOut="this.style.backgroundColor='#f3f3f3'" onMouseOver="this.style.backgroundColor='#BFDFFF'">
         <td width="5%" align="center"><input name='id' type='checkbox' id="id" value='<%=cstr(rs("id"))%>'></td>
         <td width="5%" align="center"><%=rs("id")%></td>
         <td><%=rs("ip")%></td>
         <td><%=rs("url")%></td>
         <td align="center"></td>
         </tr>
	       <% i=i+1                                                                                                  
          rs.movenext                                                                                                  
          if i>=rs.PageSize then exit do 
		  loop                                                                    
         %>
     </table>
     <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"> <input type=checkbox name=chkall onclick=CheckAll(document.forms.chkall.checked) value="ON">
      选择本页所有
      <input name="submit"  type="submit" onClick="javascript:OnDelete()" value="  删 除  "></td>
  </tr>
</table>
</td>
</tr></form></table>

<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr align="right">
    <% if rs.pagecount=1 then %>
    <td height="30" colspan="2"><font color="#000000">共有[<font color="#ff0000"><%=rs.recordcount%></font>]条 以下是[<font color="red">1～<%=rs.recordcount%></font>]条</font></td>
  </tr>
  <tr>
    <%else%>
    <td width="38%" align="center" valign="middle"><font color="#000000">
      <% page_start=(pagecount-1)*rs.pagesize
            if pagecount=1 then page_start=1
		    page_end=rs.pagesize*pagecount
		    if pagecount*rs.pagesize=>rs.recordcount then page_end=rs.recordcount end if%>
      共有[<font color="#ff0000"><%=rs.recordcount%></font>]条记录 以下是[<font color="red"><%=page_start%>～<%=page_end%></font>]条</font></td>
    <td width="62%" height="30" align="right"><font color="#000000">
      <% response.write"<form name=go2to form method=Post action='lockip.asp'>"                                             
		     if pagecount=1 then                                                        
			 response.write "<font color='#000064'>首页 上一页</font>&nbsp;"
			 else                                                        
             response.write "<a href=?page=1><font color='0000BE'>首页</font></a>&nbsp;" 
	         response.write "<a href=?page="+cstr(pagecount-1)+"><font color='0000BE'>上一页</font></a>&nbsp;"
			 end if                                             
             if rs.PageCount-pagecount<1 then                                                        
             response.write "<font color='#000064'>下一页 尾页</font>"                                                    
			 else                                                        
             response.write "<a href=?page="+cstr(pagecount+1)+"><font color='0000BE'>下一页</font></a>&nbsp;"
			 response.write "<a href=?page="+cstr(rs.PageCount)+"><font color='0000BE'>尾页</font></a>"           
             end if 
			 response.write "<font color='000064'>&nbsp;页次:<font color=blue>"&pagecount&"</font>/"&rs.pagecount&"页</font>" 
			response.write "<font color='000064'> 转到第<input type='text' name='page' size=2 maxLength=3 style='font-size: 9pt; color:#0E96DF; position: relative; height: 18' value="&PageCount&">页</font>&nbsp;"                               
			response.write "<input class=button type='button' value='确 定' onclick=check() style='font-family: 宋体; font-size: 9pt; color: #000073; position: relative; height: 19'>" %>
    </font></td>
  <tr>
    <td height="6" colspan="4" valign="bottom"><font color="#000000">&nbsp; </font></td>
  </tr>
  <% end if %>
</table>
<% end if
 end if
sub add%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="images/Admin_Style.css">
<head>
<title>福建音乐视听网 管理中心</title>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr class="topbg"> 
    <td height="22" colspan="2"  align="center"><strong>IP 管 理</strong></td>
  </tr>
  <tr class="tdbg"> 
    <td width="70" height="30" ><strong>管理导航：</strong></td>
    <td><a href="0hao_sql.asp">SQL注入管理</a>&nbsp;| <a href="0hao_lockip.asp">IP 管 理</a>&nbsp;| <a href="?act=add">添加 IP</a>&nbsp; &nbsp; 非法SQL注入三次IP自动被锁定</td>
  </tr>
</table>
<br>
<table width='95%' border="0" align="center" cellpadding="0" cellspacing="0">
  <form name=forms method="post" action="?act=save">
 <tr><td>
    <input name='ip' type='type' value=''>
</td></tr><tr><td>
<input class=submit type='submit' value='确 定'></td></tr></form></table>
<%end sub%>
</body>
</html>