<?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 type="text/javascript" src="admin/template/js/admin.js"></script>
<script src="images/js/menu.js"></script>
</head>
<body>
<div id="wrap">
	<div class="tab">
		<ul>
			<li><a href="javascript:void(0);" class="on">管理员管理</a></li>
			<li><a href="?file=admin&action=add">添加管理员</a></li>			
		</ul>
	</div>
	<div class="main">
		<fieldset>
		<legend>操作提示</legend>
		网站创始人拥有最大权限，不能被撤销或者删除。
		</fieldset>
		<table cellspacing="0" class="datalist" id="list">
		<tr>
			<th width="104" class="firstcol">管理员名称</th>
			<th width="98">所属角色</th>
			<th width="75">最后登录IP</th>
			<th width="58">登陆次数</th>
			<th width="72">账号状态</th>
			<th width="80">同时登陆</th>
			<th width="56">管理</th>
		</tr>
		<?php if($result){foreach($result as $val){if($val['id']!=ADMIN_FOUNDERS || $_userid=ADMIN_FOUNDERS){?>
		<tr>
			<td width="104" align="center"><?php echo $val['username'];?></td>
			<td width="98" align="left"><?php echo $val['role'];?> <?php if($val['memberid']!=ADMIN_FOUNDERS){?><a href="javascript:void(0);" onclick="javascript:poptemplate('admin','roleid',<?php echo $val['memberid'];?>,'<?php echo $val['roleid'];?>','admin');" title="设置管理角色"><u>设置</u></a><?php }?></td>
			<td width="75" align="center"><?php echo $val['loginip'];?></td>
			<td width="58" align="center"><?php echo $val['logintimes'];?> 次</td>
			<td width="72" align="center"><?php echo $val['disabled']?'<font color="#666666">已禁用</font> <a href="'.ADMIN_FILE.'?file=admin&action=lock&disabled=0&id='.$val['id'].'"><u>启用</u></a>':'已启用 <a href="'.ADMIN_FILE.'?file=admin&action=lock&disabled=1&id='.$val['id'].'"><u>禁用</u></a>';?></td>
			<td width="80" align="center"><?php echo $val['allowmultilogin']?'允许 <a href="'.ADMIN_FILE.'?file=admin&action=allowmultilogin&allowmultilogin=0&id='.$val['id'].'"><u>禁止</u></a>':'禁止 <a href="'.ADMIN_FILE.'?file=admin&action=allowmultilogin&allowmultilogin=1&id='.$val['id'].'"><u>允许</u></a>';?></td>
			<td width="56" align="center"><a href="<?php echo ADMIN_FILE;?>?file=admin&action=edit&id=<?php echo $val['id'];?>">编辑</a> <a href="<?php echo ADMIN_FILE;?>?file=admin&action=delete&delete=1&roleid=<?php echo $val['roleid'];?>&id=<?php echo $val['id'];?>">撤销</a></td>
		</tr>
		<?php }}?>
		<?php }else{?>
		<tr><td colspan="7">目前尚未添加任何管理员...</td></tr>	
		<?php }?>
		</table>
	</div>
</div>
</body>
</html>