<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
<META NAME="copyright" CONTENT="Copyright 2006-2009" />
<META NAME="Author" CONTENT="迅易网站建设开发、www.ameav.com" />
<META NAME="Keywords" CONTENT="" />
<META NAME="Description" CONTENT="" />
<TITLE>会员列表</TITLE>
<link rel="stylesheet" href="Images/CssAdmin.css">
<script language="javascript" src="../Script/Admin.js"></script>
</HEAD>

<!--#include file="../Include/ConnSiteData.asp" -->
<!--#include file="../Include/Const.asp" -->
<!--#include file="Ameav_SqlIn.Asp" -->
<!--#include file="CheckAdmin.asp"-->
<!--#include file="lockipfun.asp"-->
<%
if Instr(session("AdminPurview"),"|61,")=0 then 
  response.write ("<font color='red')>你不具有该管理模块的操作权限，请返回！</font>")
  response.end
end if
'========判断是否具有管理权限
%>
<% 
dim ipid,ipcls
ipid=Request.QueryString("id")
ipcls=Request.QueryString("cls")
Select case ipcls
case ""
case "del"
    conn.execute("Delete  From ameav_stopip Where id="&ipid)
Response.Write "<script language=javascript>alert(""IP删除成功！"");location.href=""admin_ip.asp"";</script>"
Response.End
case "open"
    conn.execute("Update ameav_stopip set viw=0 Where id="&ipid)
Response.Write "<script language=javascript>alert(""IP已开通！"");location.href=""admin_ip.asp"";</script>"
Response.End
case "close"
    conn.execute("Update ameav_stopip set viw=1 Where id="&ipid)
Response.Write "<script language=javascript>alert(""IP已禁止！"");location.href=""admin_ip.asp"";</script>"
Response.End
end Select

if Request.Form("Submit")="提交" then
dim oneip,endip
oneip=trim(Request.Form("oneip"))
endip=trim(Request.Form("endip"))

call fishadminip(oneip)
call fishadminip(endip)

    Set rs = Server.CreateObject("ADODB.RecordSet")
	sql="Select * from ameav_stopip"
	Rs.open sql,conn,2,3
	Rs.addnew
	rs("oneip")=fishadmincip(oneip)
	rs("endip")=fishadmincip(endip)
	rs("ip1")=oneip
	rs("ip2")=endip
	rs("rdate")=now()
	rs("viw")=1
	rs.update
	rs.close
Response.Write "<script language=javascript>alert(""IP添加成功！"");location.href=""admin_ip.asp"";</script>"
Response.End
end if

stop_ip= Request.ServerVariables("HTTP_X_FORWARDED_FOR") 
If  stop_ip= "" Then  stop_ip= Request.ServerVariables("REMOTE_ADDR")
%>
<style type="text/css">
<!--
.unnamed1 {
	font-size: 12px;
	line-height: 20px;
}
-->
</style>
</head>
<body>

  <TABLE width="100%" height=0 border=0 align=center cellPadding=0 cellSpacing=0 class="unnamed1" style="border-collapse:collapse" >
    <tr bgcolor="#E4F2FA"> 
      <td height="25" colspan="3" align="left" bgcolor="#6298E1"> 
      <b><font color="#FFFFFF">欢迎您，管理员！您当前IP：<%=stop_ip%>　</font></b></td>
    </tr>
</table>
<form name="form1" method="post" action="">
  <TABLE width="100%" height=0 border=0 align=center cellPadding=0 cellSpacing=0 class="unnamed1" style="border-collapse:collapse" >
    <tr> 
      <td width="20%"><div align="right"><b>添加封锁IP段:</b></div></td>
      <td width="30%"><input name="oneip" type="text" id="oneip"></td>
      <td width="30%" height="25"><input name="endip" type="text" id="endip"></td>
 <td width="20%"><input type="submit" name="Submit" value="提交"></td>
    </tr>
  </table>
  <br>
</form>

<% set rs=conn.execute("select * from ameav_stopip")%>

<TABLE width="100%" height=0 border=0 align=center cellPadding=0 cellSpacing=0 class="unnamed1" style="border-collapse:collapse" >
  <TBODY>
    <TR > 
      <TD  height=25 bgcolor="#8DB5E9" class="jd_title" > 
      <div align="left"><b>添加封锁IP段:</b></div></TD>
    </TR>
    <TR> 
      <TD  align=middle valign="top" > <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"  class="unnamed1">
          <tr>
            <td>状态</td>
            <td>起始</td>
            <td>终止</td>
            <td>时间</td>
            <td height="25">操作</td>
          </tr>
          <tr> 
            <td height="2" colspan="5" bgcolor="#E4F2FA" class="jd_title"></td>
          </tr>
<%
ipi=0
do while not rs.eof 
ipi=ipi+1
%>

<tr>
<td>

<% 
if rs("viw")=0 then
Response.write("<font color='#009900'>")
end if
if rs("viw")=1 then
Response.write("<font color='#000000'>")
end if

Response.write("●</font>")
%>
</td>
            <td><%=rs("ip1")%></td>
            <td><%=rs("ip2")%></td>
            <td><%=rs("rdate")%></td>
            <td height="25">
              <a href="?cls=open&id=<%=rs("id")%>">开通</a> 
              <a href="?cls=close&id=<%=rs("id")%>">禁止</a> 
<a href="?cls=del&id=<%=rs("id")%>" onClick="return confirm('删除一个IP段？！\n\n该操作不可恢复！可以设为开通,保留这个段.\n\n要删除请按[确定]\n\n不小心按错按[取消]反回！')">删除</a>            </td>
          </tr>
          <tr> 
            <td height="1" class="jd_title" colspan="5" bgcolor="#E4F2FA"></td>
          </tr>
<% 
rs.movenext
loop
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
          <tr> 
            <td colspan="5">&nbsp;</td>
          </tr>
          <tr> 
            <td height="25" colspan="5"><div align="center"><font color="#009900">●开通 </font>　<font color="#FF0000"> ●禁止</font></div></td>
          </tr>
        </table>
</TD>
    </TR>
  </TBODY>
</TABLE>
</body>
</html>