<%@ Page Inherits="Dvbbs.bbs.UI.Admin.admin_refuseip" %>
<%@ Register tagPrefix="Dvbbs" namespace="Dvbbs.Controls" assembly="Dvbbs.Web"%>
<%@ Register tagPrefix="bbs" tagName="AdminHeader" src="controls/admin_header.ascx"%>
<%@ Register tagPrefix="bbs" tagName="AdminFooter" src="controls/admin_footer.ascx"%>
<bbs:AdminHeader title="管理受限IP" runat="server" />
<script language="javascript">
function chkPost()
{
	var f = document.forms[0];
	if (!f.startip.value.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/))
	{
		alert('请正确填写起始IP');
		f.startip.focus();
		return false;
	}
	if (!f.endip.value.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/))
	{
		alert('请正确填写结束IP');
		f.endip.focus();
		return false;
	}
	return true;
}
function doSearch()
{
	var obj = document.getElementById("searchip");
	if (!obj.value.match(/^[\d\*]+\.[\d\*]+\.[\d\*]+\.[\d\*]+$/))
	{
		alert('请按照说明正确输入要搜索的IP');
		obj.focus();
		return false;
	}
	location.href = 'admin_user_search.aspx?ip=' + obj.value + '&action=search';
}
</script>
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0" ID="Table1">
	<tr>
		<td colspan="2" class="title">登录受限的IP范围限定</td>
	</tr>
	<tr>
		<td class="left" width="30%">删除？</td>
		<td class="right" width="70%">登陆受限的IP范围</td>
	</tr>
	<asp:Repeater enableviewstate="false" id="loglist" runat="server">
		<ItemTemplate>
			<tr>
				<td class="left"><Dvbbs:Anchor id="logremove" text="删除" onclick="return confirm('确定要删除这条记录吗？')" runat="server" /></td>
				<td class="right"><Dvbbs:Span id="logiprange" runat="server" /></td>
			</tr>
		</ItemTemplate>
	</asp:Repeater>
</table>
<br />
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0" ID="Table2">
	<tr>
		<td colspan="2" class="title">注册受限的IP范围限定</td>
	</tr>
	<tr>
		<td class="left" width="30%">删除？</td>
		<td class="right" width="70%">注册受限的IP范围</td>
	</tr>
	<asp:Repeater enableviewstate="false" id="reglist" runat="server">
		<ItemTemplate>
			<tr>
				<td class="left"><Dvbbs:Anchor id="regremove" text="删除" onclick="return confirm('确定要删除这条记录吗？')" runat="server" /></td>
				<td class="right"><Dvbbs:Span id="regiprange" runat="server" /></td>
			</tr>
		</ItemTemplate>
	</asp:Repeater>
</table>
<br />
<form id="addnew" runat="server">
	<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0" ID="Table3">
		<tr>
			<td colspan="2" class="title">新添受限IP范围</td>
		</tr>
		<tr>
			<td class="left" width="30%">起始IP</td>
			<td class="right" width="70%"><asp:TextBox id="startip" maxlength="15" onFocus="IEvent('focus',this);" onBlur="IEvent('blur',this)"
					onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" runat="server" /></td>
		</tr>
		<tr>
			<td class="left">结束IP</td>
			<td class="right"><asp:TextBox id="endip" maxlength="15" onFocus="IEvent('focus',this);" onBlur="IEvent('blur',this)"
					onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" runat="server" /></td>
		</tr>
		<tr>
			<td class="left">受限范围</td>
			<td class="right"><asp:DropDownList id="DenyRange" runat="server">
					<asp:ListItem value="0" selected="true">登陆限制</asp:ListItem>
					<asp:ListItem value="1">注册限制</asp:ListItem>
				</asp:DropDownList></td>
		</tr>
		<tr>
			<td class="bottom" align="center" colspan="2">
				<input type="submit" id="save" onFocus="IEvent('focus',this);" onBlur="IEvent('blur',this)"
					onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" class="button"
					value="添 加" onclick="return chkPost()" />
			</td>
		</tr>
	</table>
</form>
<br />
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0" ID="Table4">
	<tr>
		<td class="title" colspan="2">按IP搜索会员</td>
	</tr>
	<tr>
		<td class="left" width="30%">输入IP搜索会员</td>
		<td class="right" width="70%"><input type="text" name="searchip" maxlength="15" onFocus="IEvent('focus',this);" onBlur="IEvent('blur',this)"
				onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" />
			&nbsp;&nbsp; <input type="button" onFocus="IEvent('focus',this);" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)"
				onMouseOut="IEvent('mouseout',this)" class="button" value="搜 索" onclick="doSearch()" />
			&nbsp;
			<br />
			<span> 可以使用通配符*， 如221.224.52.*，221.224.*.*</span>
		</td>
	</tr>
</table>
<bbs:AdminFooter runat="server" />