<?php include $this->admin_tpl('meta');?>
<title>角色管理 - YzmCMS内容管理系统</title>
</head>
<body>
<nav class="breadcrumb"><i class="yzm-iconfont yzm-iconai-home"></i> 首页 <span class="c-gray en">&gt;</span> 管理员管理 <span class="c-gray en">&gt;</span> 角色管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="yzm-iconfont yzm-iconshuaxin"></i></a></nav>
<div class="page-container">
	<div class="cl tb-top"> <span class="l"><a href="javascript:;" onclick="yzm_open('添加角色','<?php echo U('add');?>','600','350')" class="btn btn-primary radius"><i class="yzm-iconfont yzm-icontianjia"></i> 添加角色</a></span></div>
	<table class="table table-border table-bg table-hover">
		<thead>
			<tr class="text-c">
				<th>ID</th>
				<th>角色名称</th>
				<th>角色描述</th>
				<th>系统角色</th>		
				<th>是否禁用</th>
				<th>管理操作</th>
			</tr>
		</thead>
		<tbody>
			<?php 
			   foreach($data as $val){
			 ?>
			<tr class="text-c">
				<td><?php echo $val['roleid'];?></td>
				<td><?php echo $val['rolename'];?></td>
				<td><?php echo $val['description'] ? $val['description'] : '无';?></td>
				<td><?php echo $val['system'] ? '是' : '否';?></td>
				<td><?php echo $val['disabled'] ? '<span class="label radius">已禁用</span>' : '<span class="label label-success radius">已启用</span>';?></td>
				<td class="td-manage">
				<?php if($val['roleid']==1) { ?>
					<span class="btn-mini btn-disabled ml-5">权限管理</span>
					<a title="成员管理" href="<?php echo U('admin_manage/init/',array('roleid'=>$val['roleid']));?>"  class="btn-mini btn-success ml-5" style="text-decoration:none">成员管理</a>
					<span class="btn-mini btn-disabled ml-5">编辑</span>
					<span class="btn-mini btn-disabled ml-5">删除</span>
				<?php } else { ?>
					<a title="权限管理" href="<?php echo U('role_priv',array('roleid'=>$val['roleid']));?>"  class="btn-mini btn-primary ml-5" style="text-decoration:none">权限管理</a>
					<a title="成员管理" href="<?php echo U('admin_manage/init/',array('roleid'=>$val['roleid']));?>"  class="btn-mini btn-success ml-5" style="text-decoration:none">成员管理</a>
					<a title="编辑" href="javascript:;" onclick="yzm_open('角色编辑','<?php echo U('edit',array('roleid'=>$val['roleid']));?>','600','350')"  class="btn-mini btn-secondary ml-5" style="text-decoration:none">编辑</a>
					<a title="删除" href="javascript:;" onclick="yzm_confirm('<?php echo U('delete',array('roleid'=>$val['roleid']));?>', '确定要删除【<?php echo $val['rolename'];?>】角色吗？', 1)"  class="btn-mini btn-danger ml-5" style="text-decoration:none">删除</a>
				<?php } ?>
				</td>
			</tr>
			<?php 
			   }		 
			?>	
		</tbody>
	</table>
</div>
<?php include $this->admin_tpl('footer');?>
</body>
</html>