<?php
	!defined('DIRCMS_MANAGE') && exit('Access Denied!');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>管理员管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" href="admin/template/css/style.css" />
<script type="text/javascript" src="images/js/jquery.min.js"></script>
<script src="images/js/check.func.js"></script>
<script language="javascript" type="text/javascript">
var priarr=new Array();
<?php 
$r=explode(',',$categorypriv);
foreach($r as $k => $v)
{
	echo 'priarr['.$k.']='.$v.";\n";
}
?>
function in_array(val,arr)  
{
	for(var i=0;i<arr.length;i++)   
	if(arr[i]==val) return true;
	return false;
}
$(document).ready(function(){
	checkForm(0);
	var sel = document.getElementById('categorypriv');
	for(var i=0;i<sel.options.length;i++)
	{
		var opval=sel.options[i].value;
		if(in_array(opval,priarr))
		{
			sel.options[i].selected=true;
		}
	}
});
</script>
</head>
<body>
<div id="wrap">
	<div class="tab">
		<ul>
			<li><a href="?file=admin&action=manage">管理员管理</a></li>
			<li><a href="javascript:void(0);" class="on">编辑管理员</a></li>			
		</ul>
	</div>
	<div class="main">
	<fieldset>
		<legend>操作提示</legend>
		1：管理员名称不能被修改； 2：所属角色必须选择。
	</fieldset>
	<form action="" method="post" name="myform">
	<input type="hidden" name="do_submit" value="1" />
	<input type="hidden" name="memberid" value="<?php echo $memberid;?>" />
	<table cellspacing="0" class="sub">
		<tr>
			<td width="100" align="right">管理员名称：</td>
			<td>
			<input type="text" value="<?php echo $username;?>" datatype="limit" min="1" max="80" readonly="1" class="input" size="20" />
			</td>
		</tr>
		<tr>
			<td align="right">安全策略：</td>
			<td>
			<input type="checkbox" <?php echo $allowmultilogin?' checked="checked"':'';?> class="checkbox" value="1" name="newadmin[allowmultilogin]" />允许多人同时使用此帐号登录
			</td>
		</tr>
		<tr>
			<td align="right">所属角色：</td>
			<td>
			<?php echo $roleselect;?>
			</td>
		</tr>
		<tr>
			<td align="right">栏目权限：</td>
			<td>
			<?php echo $catid_select;?>
			<span>按着 Ctrl 可以多选,超级管理员不用选择即拥有全部权限</span>
			</td>
		</tr>
		<tr>
			<td align="right">启用帐号：</td>
			<td>
			<input type="radio" value="0" class="radio" <?php echo !$disabled?' checked="checked"':'';?> name="newadmin[disabled]" />启用 
			<input type="radio" value="1" class="radio" <?php echo $disabled?' checked="checked"':'';?> name="newadmin[disabled]" />禁用
			</td>
		</tr>
		<tr class="bg2"><td></td><td><input type="button" class="button" onclick="doSubmit(this);" value="保存管理员" /> <input type="button" class="button" onclick="window.location.href='<?php echo ADMIN_FILE;?>?file=admin&action=manage'" value="取消返回" /></td></tr>
	</table>
	</form>

	</div>
</div>
</body>
</html>