  <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="07"
	dir="../err.asp" 
  %>
  <!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
  <!--#include file="../rolecheck.asp"-->

<html>
<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>
<body style="font-size: 9pt">
 <%
 
	HOPE_action=Trim(Request("HOPE_action"))
if HOPE_action="Modify" then 
	Conn.execute("Delete From  Websen_IPSet WHere ID="&Trim(Request("HOPE_ID"))&"")
	Call HOPE_err("操作成功","当前IP地址已经解除锁定","返回","HOPE_Ipset.asp")
	Response.end
end if	
if HOPE_action="Add" then 
	HOPE_IP=Trim(Request("HOPE_IP"))
	HOPE_SM=Trim(Request("HOPE_SM"))
	
	if HOPE_IP="" then 
		Call HOPE_err("操作错误","锁定的IP地址不能为空!","返回上一页","javascript:history.go(-1)")
		Response.end
	end if
	HOPE_IPSum=ubound(Split(HOPE_IP,"|"))
	HOPE_IPSum=Cint(HOPE_IPSum)
	
	
	
	if HOPE_IPSum>0 then 
		HOPE_IP=Split(HOPE_IP,"|")
		
		HOPE_I=""
			for i=0 to HOPE_IPSum
								
			Set rs=Server.Createobject("Adodb.recordset")
				Sql="Select * From Websen_IPSet Where HOPE_IP='"&HOPE_IP(i)&"'"
				rs.open sql,conn,1,3
				
				if  rs.eof then 
					rs.addnew()
							rs("HOPE_IP")=HOPE_IP(i)
							rs("HOPE_Time")=now()
							rs("HOPE_admin")=session("globalecmaster")
							rs("HOPE_SM")=Trim(HOPE_SM)
					rs.update()
					HOPE_I=HOPE_I&HOPE_IP(i)&"<br>"
				else
					Call HOPE_err("操作错误","此IP已经添加到锁定目录中","返回上一页","javascript:history.go(-1)")
					Response.end
				end if
		next
		Call HOPE_err("操作成功","<span style='color:red'>"&HOPE_I&"</span>以上IP已经锁定!","返回","HOPE_IPset.asp")
		Response.end
	else
		Set rs=Server.Createobject("Adodb.recordset")
			Sql="Select * From Websen_IPSet Where HOPE_IP='"&HOPE_IP&"'"
			rs.open sql,conn,1,3
			if not rs.eof then 
				Call HOPE_err("操作错误","此IP已经添加到锁定目录中","返回上一页","javascript:history.go(-1)")
				Response.end
			end if
			
			rs.addnew()
					rs("HOPE_IP")=HOPE_IP
					rs("HOPE_Time")=now()
					rs("HOPE_admin")=session("globalecmaster")
					rs("HOPE_SM")=Trim(HOPE_SM)
			rs.update()
			Call HOPE_err("操作成功",""&HOPE_IP&"-IP已经锁定!","返回","HOPE_IPset.asp")
			Response.end
		
	end if
	
		rs.close
		set rs=nothing
	
end if
	
		'Call HOPE_err("操作成功","IP锁定成功!","返回上一页","javascript:history.go(-1)")


Set rs=Server.Createobject("Adodb.recordset")
			Sql="Select * From Websen_IPSet"
			rs.open sql,conn,1,3
			
%>


<TABLE width="100%" border="0" align=center cellpadding="0" cellspacing="1" class="tableBorder">
<form method="POST" action="HOPE_IPset.asp?HOPE_action=Add" name="form">
  <tr> 
     <th height=25 colspan="2" class="tableHeaderText">添加屏蔽IP地址</th> 
  </tr>
<TR ALIGN="center">
<TD>
  <TABLE width="100%" height="101" border="0" cellpadding="2" cellspacing="1" bordercolorlight="#CEE7FF" bordercolordark="#CEE7FF" style="border-collapse: collapse">
<TR> 
<TD width="170" align="right" class="Forumrow" height="12"><b>IP地址：</b></TD>
<TD height="12" class="Forumrow">&nbsp;<input name="HOPE_IP" type="text" class="smallInput" id="HOPE_IP" size="80"> 
* 格式:(127.0.0.1 <span style="color:red">|</span> 127.0.0.1)</TD>
</TR>
<TR>
  <TD align="right" height="4" class="Forumrow"><b>操作人：</b></td>
  <TD width="784" height="4" valign="middle" class="Forumrow">&nbsp;<span style="background-color:#0099CC;color:#FFFFFF;"><%=session("globalecmaster")%></span></TD>
</TR>
<TR> 
<TD height="52" align="right" class="Forumrow"><b>备注：</b></TD>
<TD class="Forumrow">&nbsp;<textarea name="HOPE_SM" cols="100" rows="8" id="HOPE_SM" style="color:red">非法登录
</textarea></TD>
</TR>
<TR height="40">
<TD colspan="2" align="center" class="Forumrow" height="28"> <input type="submit" name="Submit" value=" 提　交  保  存" class="smallInput">&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" name="Submit2" value=" 重　填" class="smallInput"> 
</TR>
</TABLE></TD>
</TR></FORM>

</TABLE>


<TABLE width="100%" border="0" align=center cellpadding="0" cellspacing="1" class="tableBorder">
  <tr>
    <th height=25 colspan="2" class="tableHeaderText">屏蔽IP地址列表</th>
  </tr>
  <TR ALIGN="center">
    <TD>
        <%if not  rs.eof then%>
		
	  <TABLE width="100%" height="14" border="0" cellpadding="2" cellspacing="1" bordercolorlight="#CEE7FF" bordercolordark="#CEE7FF" style="border-collapse: collapse">
	  
        <TR>
         <%
		  j=0
		  do while not rs.eof
		  	j=j+1
		   %> 
		  <TD height="12" align="left" class="Forumrow">
		  	<%=rs("HOPE_IP")%>&gt;&gt;&nbsp;<a href="HOPE_IPset.asp?HOPE_action=Modify&HOPE_ID=<%=rs("ID")%>">解除</a>
		  </TD>
		  <%
		  	if j mod 5=0 then Response.write "</TR>"
		  	if rs.eof then exit do
		  rs.movenext
		  loop
		  %>
        
    </TABLE>
		<%else
			Response.write "<br><br>暂时没有屏蔽IP列表<br><br>"
		end if
		
			rs.close
			set rs=nothing
		%>
	</TD>
  </TR>
</TABLE>
</html>