<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="content-type" content="text/html;charset=utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<title>Office 515158.com OA办公系统</title>
        <link rel="stylesheet" type="text/css" href="template/style2015/content/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="template/style2015/content/css/bootstrap-modal.css" />
		        <link rel="stylesheet" type="text/css" href="template/style2015/content/css/bootstrap.css"> 
				<link rel="stylesheet" type="text/css" href="template/style2015/bootstrap/css/bootstrap-datetimepicker.css"> 
        <link rel="stylesheet" type="text/css" href="template/style2015/content/css/base.css">
		<link rel="stylesheet" type="text/css" href="template/style2015/content/css/style.css">
		<script type="text/javascript" src="template/style2015/content/js/jquery.min.js"></script>
		<script type="text/javascript" src="template/style2015/content/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="template/style2015/content/js/bootstrap-modal.js"></script>
		<script type="text/javascript" src="template/style2015/content/js/bootstrap-modalmanager.js"></script>

   </head>
	<body >
	<div class="tabbable work-nav"> <!-- Only required for left/right tabs -->
				<ul id="myTab" class="nav nav-tabs">
					<li class="active">
						<a href="admin.php?ac=usergroup&fileurl=mana">权限组管理</a>
					</li>
				    <li >
						<a href="admin.php?ac=home&fileurl=mana">门户权限设置</a>
					</li>
				</ul>
			</div>
<div class="search_area">
    <form method="get" action="admin.php" name="searchs" class="form-horizontal">
		<input type="hidden" name="ac" value="usergroup" />
		<input type="hidden" name="do" value="list" />
		<input type="hidden" name="fileurl" value="mana" />
        <div class="form-search form-search-top" style="text-align:left;padding-left:20px;">
		
			<div class="adv-select-label">名称：</div>
			<input type="text" name="groupname" size="15"
	value="" style="width:220px;" />
		
            <button id="do_search" type="button" style="margin-left:10px;" onClick="document:searchs.submit();" class="btn btn-primary">查 询</button>
           <!-- <button  onClick="formview()" type="button" class="btn">切换更多查询</button> -->
        </div>
       
    </form>
</div>


	
	
		
	<div class="content" >
		<div style="padding-top:5px;">
			
			
			<div id="folder-grid" class="grid-view">
				<div class="toolbar"  style="margin-left:10px;">
													<a style="margin-right:5px;" class="btn btn-primary" onClick="javascript:window.location='admin.php?ac=<?php echo $ac?>&fileurl=<?php echo $fileurl?>&do=add'">新增权限组</a>
												<a class="btn btn-danger" onClick="javascript:document:update.submit();" style="margin-right:5px;">
							清理权限组
						</a>
				</div>
				<div style="float:right; text-align:right; margin-right:20px;">
				<?php echo newshowpage($num,$pagesize,$page,$url);?></div>
				<table class="items table table-striped" style="margin-bottom:0px;">
					<thead>
						<tr>
							<th style="width:10px" id="folder-grid_c0">
							<input type="checkbox" value="1"  onClick="check_all(this);" class="icon-checkbox-unchecked" /> 
							</th>
							<th style="width:100%;">名称</th>
							<th style="width: 110px;">类型</th>
							<th style="width: 100px;">用户数量</th>
							<th style="width: 130px;text-align:center;">操作</th>
						</tr>
					</thead>
					</table>
					<div style="position:absolute; height:64%; width:100%;overflow:auto; ">
					<table class="items table table-striped" style="margin-top:0px;">
				    <tbody>
<form name="update" method="post" action="admin.php?ac=<?php echo $ac?>&fileurl=<?php echo $fileurl?>">
		<input type="hidden" name="do" value="update" />
<?php foreach ($result as $row) {?>
		<tr class="odd">
						<td class="notopen" style="width:10px">
						<input type="checkbox" name="id[]" value="<?php echo $row['id']?>" <?php echo ($row['type'] == 'system' ? 'disabled="disabled"' : '')?> class="checkbox" />						</td>
						
						
						<td style="width:100%;">
						<?php echo $row['groupname']?></td>
						<td style="width:110px;"><?php echo ($row['type'] == 'system' ? '<span style="color:green">系统用户组</span>' : '自定义用户组')?></td>
						<td style="width:100px;"><?php echo $row['usercount']?></td>
						
						
						<td style="width: 120px; text-align:center; vertical-align:middle;"  class="notopen"><a href="admin.php?ac=<?php echo $ac?>&fileurl=<?php echo $fileurl?>&do=edit&id=<?php echo $row['id']?>">编辑</a>
						</td>
						</tr>
<?php }?>	
</form>								
					</tbody>
					
				</table>
			</div>
				
			</div>
		</div>
	</div>
<script>
function check_all(ck) {
	if ($(ck).attr('checked')) {
		$('#folder-grid tbody input[name="id[]"]').each(function() {
			$(this).attr('checked','checked');
			$(this).parent().parent().addClass('highlight');
		});
	} else {
		$('#folder-grid tbody input[name="id[]"]').each(function() {
			$(this).removeAttr('checked');
			$(this).parent().parent().removeClass('highlight');
		});
	}
}
</script>	
		
	</body>
</html>