<!--{template 'head'}-->
<!--{if $action=='manage'}-->
<style>
table.tableborder td{padding:8px 5px}
</style>
<table cellpadding="1" cellspacing="1" border="0" align=center class="tableborder" >
	<tr>
		<td class="tablerow"><b>管理选项：</b>
			<a href="###" onclick="return qmeCms.dialogView.get('添加禁止IP', 'plugin.php?plugin=banned&action=add', {width:560});">添加禁止IP</a> 
		</td>
	</tr>
</table>
<table cellpadding="0" cellspacing="0" class="tableborder" id="mytable">
	<tr align="center">
		<td width="30" class="tablerowhighlight"></td>
		<td width="150" class="tablerowhighlight">起始IP</td>
		<td width="150" class="tablerowhighlight">结束IP</td>
		<td width="130" class="tablerowhighlight">添加时间</td>
		<td width="130" class="tablerowhighlight">过期时间</td>
		<td width="80" class="tablerowhighlight">状态</td>
		<td class="tablerowhighlight">操作</td>
	</tr>
	<!--{if $data}-->
	<!--{loop $data $val}-->
	<tr class="item" id="item-{$val[id]}">
		<td class="tablerowl"><input type="checkbox" name="ids[]"  id="ids_{$val[id]}" value="{$val[id]}"></td>
		<td align="center">
			<!--{echo long2ip($val['start'])}-->
		</td>
		<td align="center">
			<!--{echo long2ip($val['end'])}-->
		</td>
		<td align="center">
			<!--{echo qbase::formatTime('Y-n-d H:i', $val['dateline'])}-->
		</td>
		<td align="center">
			<!--{echo qbase::formatTime('Y-n-d H:i', $val['exptime'])}-->
		</td>
		<td align="center">
			<!--{if $val['status']}-->正常<!--{else}--><font color="red">已过期</font><!--{/if}-->
		</td>
		<td align="center">
			<a href="###"  onclick="return qmeCms.dialogView.get('修改禁止IP', 'plugin.php?plugin=banned&action=edit&id={$val[id]}', {width:560});">修改</a> | 
			<a onclick="return makeSure();" href='plugin.php?plugin=banned&action=delete&id={$val[id]}'>删除</a>
		</td>
	</tr>
	<!--{/loop}-->
	<!--{else}-->
	<tr>
		<td colspan="7"><p style="padding:25px;text-align:center">还没有相关数据</p></td>
	</tr>
	<!--{/if}-->
	<tr>
		<td class="tablerow" colspan="7"><p style="text-align:left;padding-left:12px;color:#666">添加的禁止IP行数过多，会影响系统的性能</p></td>
	</tr>
</table>
<!--{elseif $action == 'add' || $action == 'edit'}-->
<form name="ajaxForm" id="ajaxForm" action="plugin.php?plugin=banned&action={$action}&id={$id}" method="post">
	<!--{if $action == 'add'}-->
	<div class="modify-cate">
		<label for="type__0">禁止单个IP</label> <input type="radio" checked value="0" name="type" id="type__0" /> 
		<input type="text" size="3" maxlength="3" name="ip0[]" class="f-text" style="text-align:center;margin-left:20px" /> 
		<input type="text" size="3" maxlength="3" name="ip0[]" class="f-text" style="text-align:center" /> 
		<input type="text" size="3" maxlength="3" name="ip0[]" class="f-text" style="text-align:center" /> 
		<input type="text" size="3" maxlength="3" name="ip0[]"  class="f-text" style="text-align:center" />
	</div>
	<div class="modify-cate">
		<label for="type__1">禁止连续IP</label> <input type="radio" value="1" name="type" id="type__1" /> 
		<input type="text" size="3" maxlength="3" name="ip1_start[]" class="f-text" style="text-align:center;margin-left:20px" /> 
		<input type="text" size="3" maxlength="3" name="ip1_start[]" class="f-text" style="text-align:center" /> 
		<input type="text" size="3" maxlength="3" name="ip1_start[]" class="f-text" style="text-align:center" /> 
		<input type="text" size="3" maxlength="3" name="ip1_start[]"  class="f-text" style="text-align:center" />
		到
		<input type="text" size="3" maxlength="3" name="ip1_end[]" class="f-text" style="text-align:center;" /> 
		<input type="text" size="3" maxlength="3" name="ip1_end[]" class="f-text" style="text-align:center" /> 
		<input type="text" size="3" maxlength="3" name="ip1_end[]" class="f-text" style="text-align:center" /> 
		<input type="text" size="3" maxlength="3" name="ip1_end[]"  class="f-text" style="text-align:center" />
	</div>
	<!--{else}-->
	<div class="modify-cate">
		<input type="text" size="3" maxlength="3" name="ip_start[]" value="{$ip_start[0]}" class="f-text" style="text-align:center;" /> 
		<input type="text" size="3" maxlength="3" name="ip_start[]" value="{$ip_start[1]}" class="f-text" style="text-align:center" /> 
		<input type="text" size="3" maxlength="3" name="ip_start[]" value="{$ip_start[2]}" class="f-text" style="text-align:center" /> 
		<input type="text" size="3" maxlength="3" name="ip_start[]" value="{$ip_start[3]}"  class="f-text" style="text-align:center" />
		到
		<input type="text" size="3" maxlength="3" name="ip_end[]" value="{$ip_end[0]}" class="f-text" style="text-align:center;" /> 
		<input type="text" size="3" maxlength="3" name="ip_end[]" value="{$ip_end[1]}" class="f-text" style="text-align:center" /> 
		<input type="text" size="3" maxlength="3" name="ip_end[]" value="{$ip_end[2]}" class="f-text" style="text-align:center" /> 
		<input type="text" size="3" maxlength="3" name="ip_end[]" value="{$ip_end[3]}" class="f-text" style="text-align:center" />
	</div>
	<!--{/if}-->
	<div class="modify-cate">
		<label for="lasttime">禁止时长</label> <input  type="text" class="f-text" size="10" name="lasttime" value="{$item['lasttime']}" /> 小时 (填0表示永久)
	</div>
	<p style="color:#666">禁止时长是按照该ip增加或者修改时间计算的</p>
</form>
<script type="text/javascript" reload="1">
(function(){	
	var A = arguments;
	qmeCms.dialogView.setSubmit(true, "提交", function(){
		qmeCms.dialogView.setSubmit(true, "提交....", function(){});
		Form.send('ajaxForm', function(resp){
			var json = evaljson(resp);
			if(json['status'] == 200){
				qmeCms.dialogView.setMessage(json['message']);
				qmeCms.dialogView.setSubmit(false, "", function(){});
				window.location.href = window.location.href.split('#')[0];
			}else{
				alert(json['message']);
				A.callee();
			}
		});
	});
})();
</script>
<!--{/if}-->
<!--{template 'foot'}-->
