<?php include $this->admin_tpl('meta');?>
<title>权限管理 - YzmCMS内容管理系统</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</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="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<form action="" method="post">
	<table class="table table-border table-bordered table-bg table-hover permission">
		<thead>
			<tr class="text-c">
				<th class="text-l">权限名称</th>
			</tr>
		</thead>
		<tbody>
			 <?php echo $menus;?>
		</tbody>
	</table>
	<input type="hidden" name="roleid" value="<?php echo $roleid?>"></input>
	<div class="cl pd-5 bg-1 bk-gray"> <span class="l"><input class="orderbutton btn-primary radius" name="dosubmit" value="提交" type="submit"></span></div>
	</form>
</div>
<?php include $this->admin_tpl('footer');?>
<script type="text/javascript">
  function checknode(obj){
      var chk = $("input[type='checkbox']");
      var count = chk.length;
      var num = chk.index(obj);
      var level_top = level_bottom =  chk.eq(num).attr('level')
      for (var i=num; i>=0; i--){
		  var le = chk.eq(i).attr('level');
		  if(eval(le) < eval(level_top)) {
			  chk.eq(i).attr("checked",'checked');
			  var level_top = level_top-1;
		  }
      }
      for (var j=num+1; j<count; j++){
		  var le = chk.eq(j).attr('level');
		  if(chk.eq(num).attr("checked")=='checked') {
			  if(eval(le) > eval(level_bottom)) chk.eq(j).attr("checked",'checked');
			  else if(eval(le) == eval(level_bottom)) break;
		  }else {
			  if(eval(le) > eval(level_bottom)) chk.eq(j).attr("checked",false);
			  else if(eval(le) == eval(level_bottom)) break;
		  }
      }
  }
</script>
</body>
</html>