<!--<?php
include_once PrintEot('left');
if(!$action){print <<<EOT
-->
<div class="admin_info mb10">
    <h3 class="h1"><b>提示信息</b></h3>
    <div class="legend">
    <ol><li>可添加或刪除後台管理權限。</li><li>根據需求設置每個用戶組的後台管理權限。</li></ol>
    </div>
</div>
<h2 class="h1">用戶組後台權限管理</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr2">
		<td>用戶組</td>
		<td>操 作</td>
	</tr>
<!--
EOT;
foreach($setdb as $key => $value){print <<<EOT
-->
	<tr class="tr1 vt">
		<td class="td1">$value</td>
		<td class="td2"><a class="mr20" href="$basename&action=edit&gid=$key" title="">[編輯]</a><a href="$basename&action=delete&gid=$key" title="">[刪除]</a></td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
</div>
<form action="$basename&" method="post">
<input type="hidden" name="action" value="edit">
<h2 class="h1">添加後台權限</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr1 vt">
		<td class="td1">用戶組</td>
		<td class="td2"><select name="gid">$unsetdb</select></td>
	</tr>
</table>
</div>
<div class="tac mb10"><span class="btn"><span><button type="submit">提 交</button></span></span></div>
</form>
<!--
EOT;
}elseif($action=='edit'){print <<<EOT
-->
<h2 class="h1">{$ltitle[$gid]}的後台權限分配</h2>
<form action="$basename&" method="post">
<input type="hidden" name="action" value="edit">
<input type="hidden" name="step" value="2">
<input type="hidden" name="gid" value="$gid">
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
$editset
</table>
</div>
<div class="tac mb10"><span class="bt"><span><button type="button" onclick="CheckForm(this.form)">全 選</button></span></span>
<span class="btn"><span><button type="submit">提 交</button></span></span></div>
</form>
<script type="text/javascript">
var allcheck = true;
var checkvar = {{$checkvar}}
function CheckForm(obj){
	if (obj.id) {
		if (checkvar['chk_'+obj.id]=='undefined') {
			return false;
		}
		var newobj = obj.getElementsByTagName('input');
		var len = newobj.length;
		var checkall = checkvar['chk_'+obj.id];
	} else {
		var newobj = obj.elements;
		var len = newobj.length-2;
		var checkall = allcheck;
	}
	for (var i=0;i<len;i++) {
		if (newobj[i].type=='checkbox') newobj[i].checked = checkall;
	}
	if (obj.id) {
		if (checkall==true) {
			checkvar['chk_'+obj.id] = false;
			allcheck = true;
		} else {
			checkvar['chk_'+obj.id] = true;
			allcheck = false;
		}
	} else {
		if (checkall==true) {
			for (i in checkvar) {
				checkvar[i] = false;
			}
			allcheck = false;
		} else {
			for (i in checkvar) {
				checkvar[i] = true;
			}
			allcheck = true;
		}
	}
}
</script>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->