<!--<?php
include_once PrintEot('left');
if(empty($action)){
if(empty($job)){
print <<<EOT
-->
<ul class="nav3">
	<li><a href="$basename" class="two">用戶訪問權限</a></li>
	<li><a href="$basename&action=user">用戶管理權限</a></li>
	<li><a href="$basename&action=group">系統組或特殊組用戶</a></li>
</ul>
<div class="c"></div>
<h3><b>提示信息</b></h3>
<div class="tr5">可以給單個用戶指定版塊訪問權限!<br>當版塊設置為需要特殊頭餃才能訪問，但同時又需要對某單個用戶開放,可用此功能指定單個用戶的訪問權限!<br></div>
<div class="c"></div>

<form name="justdo" method="post" action="$basename" >
<h2>快捷操作</h2>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr3">
		<td>搜索用戶名︰<input type="text" class="input" name="soname">&nbsp;<input class="btn" type="button" value="搜　索" onclick="pwdo('so')" /></td>
		<td>添加用戶名︰<input type="text" class="input" name="addname">&nbsp;<input class="btn" type="button" value="添　加" onclick="pwdo('add')" /></td>
	</tr>
</table></form>
<br />
<form action="$basename" method="post">
<h2>版塊用戶訪問權限列表</h2>
<table width="100%" cellspacing="0" cellpadding="0">
<tr class="tr3 tac s3">
	<td width="5%"></td>
	<td width="5%">ID</td>
	<td width="15%">用戶名</td>
	<td width="60%">級別</td>
	<td class="tal">編輯</td>
</tr>
<!--
EOT;
$i=($page-1)*$db_perpage;
foreach($memberdb as $key=>$member){
$i++;
print <<<EOT
-->
<tr class="tr3 tac">
	<td><input id="id_$i" type="checkbox" name="selid[]" value="$member[uid]" onclick="pwJsCheck(this)" /></td>
	<td>$i</td>
	<td>$member[username]</td>
	<td>$member[level]</td>
	<td class="tal"><a class="fourm-two" title="編輯" href="$basename&action=$action&job=setright&uid=$member[uid]"><span class="edit"></span></a></td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>$pages
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="job" value="del" />
<br /><center><input class="btn" type="button" name="chkall" value="全 選" onclick="CheckAll(this.form)" />&nbsp;
<input type="submit" value="刪除所選項" class="btn" /></center></form><br/>
<script language="JavaScript">
function pwdo(t) {
	var url = '$basename&';
	if (t == 'so') {
		if (document.justdo.soname.value != '') {
			url += 'username=' + document.justdo.soname.value;
		} else {
			alert('請輸入用戶名！');
			return false;
		}
	} else if (t == 'add') {
		if (document.justdo.addname.value != '') {
			url += 'job=setright&username=' + document.justdo.addname.value;
		} else {
			alert('請輸入用戶名！');
			return false;
		}
	} else {
		return false;
	}
	window.location.href = url;
}
</script>
<!--
EOT;
}elseif($job=='setright'){print <<<EOT
-->
<ul class="nav3">
	<li><a href="$basename" class="two">用戶訪問權限</a></li>
	<li><a href="$basename&action=user">用戶管理權限</a></li>
	<li><a href="$basename&action=group">系統組或特殊組用戶</a></li>
</ul>
<div class="c"></div>
<h3><b>提示信息</b></h3>
<div class="tr5">可以給單個用戶指定版塊訪問權限!<br>當版塊設置為需要特殊頭餃才能訪問，但同時又需要對某單個用戶開放,可用此功能指定單個用戶的訪問權限!<br></div>
<div class="c"></div>
<form action="$basename" method="post">
<h2>版塊用戶訪問權限設置</h2>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr3"><td width="30%">用戶名</td><td><b>$username<b></td></tr>
	<tr class="tr3"><td>允許瀏覽版塊︰<br><br>(以下兩項設置，要此項開啟才有效!)<br><br>注︰選擇版塊時可使用 ‘Ctrl’ 鍵進行多選，也可使用 ‘Shift’ 鍵或拖動鼠標連續選擇多個版塊</td><td><select name="visit[]" size="16" multiple>$forum_visit</select></td></tr>
	<tr class="tr3"><td>允許發表主題︰</td><td><select name="post[]" size="16" multiple>$forum_post</select></td></tr>
	<tr class="tr3"><td>允許發表回復︰</td><td><select name="reply[]" size="16" multiple>$forum_reply</select></td></tr>
</table>
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="job" value="$job" />
<input type="hidden" name="uid" value="$uid" />
<input type="hidden" name="step" value="2" />
<br /><center><input type="submit" class="btn" value="提 交" /></center></form><br/>
<!--
EOT;
}}elseif($action=='user'){
if(empty($job)){print <<<EOT
-->
<ul class="nav3">
	<li><a href="$basename">用戶訪問權限</a></li>
	<li><a href="$basename&action=user" class="two">用戶管理權限</a></li>
	<li><a href="$basename&action=group">系統組或特殊組用戶</a></li>
</ul>
<div class="c"></div>
<h3><b>提示信息</b></h3>
<div class="tr5">可以給單個用戶指定版塊管理權限，而不需要修改該用戶原來所屬的用戶組頭餃!<br />添加用戶必須是屬于系統組或特殊組的用戶。<br /></div>

<h2>快捷操作</h2>
<div class="tr5">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr3">
		<td style="line-height:25px;">
			<form action="$basename" method="post">
				<input type="hidden" name="action" value="$action" />
				<b>搜索用戶管理權限</b><br />
				用戶名︰<input type="text" class="input" name="username" value="$username" />
				<br />用戶組︰<select name="gid">$groupcache</select>
				<br />版　塊︰<select name="fid">$forumcache</select><br /><input class="btn" type="submit" value="搜　索" style="margin:.5em 0 .5em 3.5em;">
			</form>
		</td>
		<td style="line-height:25px;">
			<form action="$basename" name="justdo" method="post">
				<input type="hidden" name="action" value="setright" />
				<input type="hidden" name="job" value="user" />
				<b>添加用戶管理權限</b><br />
				用　戶　名　︰<input type="text" class="input" name="pwuser" />&nbsp;系統組或特殊組用戶
				<br />權限作用版塊︰<select name="fid">$forumcache</select>
				<br /><input class="btn" type="button" value="添　加" onclick="pwdo()" style="margin:.5em 0 .5em 6.5em;">
			</form>
		</td>
	</tr>
</table></div>
<form name="rForm" action="$basename" method="post">
<h2>版塊用戶管理權限列表</h2>
<table cellspacing="0" cellpadding="0" width="100%">
	<tr class="tr3 tac s3">
		<td width="5%"></td>
		<td width="5%">ID</td>
		<td width="15%">用戶名</td>
		<td width="30%">級別</td>
		<td width="30%">版塊</td>
		<td class="tal">編輯</td>
		<td class="tal">刪除</td>
	</tr>
<!--
EOT;
$i=($page-1)*$db_perpage;
foreach ($u_d as $key => $value) {
$i++;
print <<<EOT
-->
	<tr class="tr3 tac">
		<td><input type="checkbox" name="selid[]" value="{$value[uid]}_{$value[fid]}_{$value[groupid]}" onclick="pwJsCheck(this)" /></td>
		<td>$i</td>
		<td><a href="$basename&action=$action&uid={$value[uid]}">{$value[username]}</a></td>
		<td><a href="$basename&action=$action&gid={$value[groupid]}">{$ltitle[$value[groupid]]}</a></td>
		<td><a href="$basename&action=$action&fid={$value[fid]}">{$forum[$value[fid]][name]}</a></td>
		<td class="tal"><a class="fourm-two" title="編輯" href="$basename&action=setright&job=user&uid=$value[uid]&fid=$value[fid]"><span class="edit"></span></a></td>
		<td><a class="fourm-two" href="$basename&action=delright&job=user&selid={$value[uid]}_{$value[fid]}_{$value[groupid]}"><span class="del" title="刪除"></span></a></td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>$pages

<input type="hidden" name="ids" value="{$uid}_{$fid}_{$gid}" />
<input type="hidden" name="action" value="" />
<input type="hidden" name="job" value="$action" />
<input type="hidden" name="all" value="" />
</form><br />
<center>
<span class="s3" id="checkall" style="display:none">全選所有查詢結果，共{$count}個選項
<input id="jscheck" type="checkbox" name="checkall" value="{$uid}_{$fid}_{$gid}" class="btn" onclick="pwSubmit(this)" /><br /></span>
<input id="jschkall" class="btn" type="button" name="chkall" value="全 選" onclick="pwSubmit(this)" />&nbsp;
<input id="jsedit" type="button" class="btn" value="編　輯" onclick="pwSubmit(this)"/>&nbsp;
<a id="jsdel" href="javascript:void(0)" onclick="pwSubmit(this)">刪　除</a>
</center><br/>
<script language="JavaScript">
function pwSubmit(_this){
	if (_this.id == 'jsedit') {
		document.rForm.action.value = 'batchright';
		document.rForm.submit();
	} else if (_this.id == 'jsdel') {
		if (confirm('確實要刪除選項嗎？')) {
			document.rForm.action.value = 'delright';
			document.rForm.submit();
		} else {
			return false;
		}
	} else if (_this.id == 'jscheck') {
		if (_this.checked) {
			document.rForm.all.value = _this.value;
		} else {
			document.rForm.all.value = '';
		}
	} else if (_this.id == 'jschkall') {
		var chk = CheckAll(document.rForm);
		if($jschk && chk){
			getObj('checkall').style.display='';
		}else{
			getObj('checkall').style.display='none';
		}
	} else {
		return false;
	}
}

function pwdo() {
	if (document.justdo.pwuser.value == '') {
		alert('請輸入用戶名！');
		return false;
	}
	if (document.justdo.fid.value == '') {
		alert('請選擇版塊！');
		return false;
	}
	document.justdo.submit();
}
</script>
<!--
EOT;
}}elseif($action=='group'){print <<<EOT
-->
<ul class="nav3">
	<li><a href="$basename">用戶訪問權限</a></li>
	<li><a href="$basename&action=user">用戶管理權限</a></li>
	<li><a href="$basename&action=group" class="two">系統組或特殊組用戶</a></li>
</ul>
<div class="c"></div>
<h3><b>提示信息</b></h3>
<div class="tr5">可以給單用戶組指定版塊管理權限，而不需要修改該用戶組里的全局管理權限!<br /></div>

<h2>快捷操作</h2>
<div class="tr5">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr5">
		<td>
			<form name="justdo" action="$basename" method="post">
				<input type="hidden" name="action" value="$action" />
				添加或搜索︰<select name="gid"><option value="">選擇用戶組</option>$groupcache</select>　AND　<select name="fid"><option value="">選擇版塊</option>$forumcache</select>&nbsp;
				<input class="btn" type="submit" value="搜　索">
				<input class="btn" type="button" value="添　加" onclick="pwdo()">
			</form>
		</td>
	</tr>
</table></div>

<form name="rForm" action="$basename" method="post">
<h2>版塊用戶組管理權限列表</h2>
<table cellspacing="0" cellpadding="0" width="100%">
	<tr class="tr3 tac s3">
		<td width="5%"></td>
		<td width="5%">ID</td>
		<td width="35%">用戶組</td>
		<td width="35%">版塊</td>
		<td class="tal">編輯</td>
		<td class="tal">刪除</td>
	</tr>
<!--
EOT;
$i=($page-1)*$db_perpage;
foreach ($g_d as $key => $value) {
$i++;
print <<<EOT
-->
	<tr class="tr3 tac">
		<td><input type="checkbox" name="selid[]" value="{$value[uid]}_{$value[fid]}_{$value[gid]}" onclick="pwJsCheck(this)" /></td>
		<td>$i</td>
		<td><a href="$basename&action=$action&gid={$value[gid]}">{$ltitle[$value[gid]]}</a></td>
		<td><a href="$basename&action=$action&fid={$value[fid]}">{$forum[$value[fid]][name]}</a></td>
		<td class="tal"><a class="fourm-two" title="編輯" href="$basename&action=setright&job=group&gid=$value[gid]&fid=$value[fid]"><span class="edit"></span></a></td>
		<td><a class="fourm-two" href="$basename&action=delright&job=group&selid={$value[uid]}_{$value[fid]}_{$value[gid]}"><span class="del" title="刪除"></span></a></td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>$pages
<input type="hidden" name="action" value="" />
<input type="hidden" name="job" value="$action" />
<input type="hidden" name="ids" value="{$uid}_{$fid}_{$gid}" />
<input type="hidden" name="all" value="0" />
</form><br />
<center>
<span class="s3" id="checkall" style="display:none">全選所有查詢結果，共{$count}個選項
<input id="jscheck" type="checkbox" name="checkall" value="1" class="btn" onclick="pwSubmit(this)"/><br /></span>
<input id="jschkall" class="btn" type="button" name="chkall" value="全 選" onclick="pwSubmit(this)" />&nbsp;
<input id="jsedit" type="button" class="btn" value="編　輯" onclick="pwSubmit(this)"/>&nbsp;
<a id="jsdel" href="javascript:void(0)" onclick="pwSubmit(this)">刪　除</a>
</center><br/>
<script language="JavaScript">
function pwSubmit(_this){
	if (_this.id == 'jsedit') {
		document.rForm.action.value = 'batchright';
		document.rForm.submit();
	} else if (_this.id == 'jsdel') {
		if (confirm('確實要刪除選項嗎？')) {
			document.rForm.action.value = 'delright';
			document.rForm.submit();
		} else {
			return false;
		}
	} else if (_this.id == 'jscheck') {
		if (_this.checked) {
			document.rForm.all.value = _this.value;
		} else {
			document.rForm.all.value = '0';
		}
	} else if (_this.id == 'jschkall') {
		var chk = CheckAll(document.rForm);
		if($jschk && chk){
			getObj('checkall').style.display='';
		}else{
			getObj('checkall').style.display='none';
		}
	} else {
		return false;
	}
}

function pwdo() {
	var url = '$basename&action=setright';
	if (document.justdo.gid.value!='') {
		url += '&gid=' + document.justdo.gid.value;
	} else {
		alert('請選擇用戶組！');
		return false;
	}
	if (document.justdo.fid.value!='') {
		url += '&fid=' + document.justdo.fid.value;
	} else {
		alert('請選擇版塊！');
		return false;
	}
	window.location.href = url;
}
</script>
<!--
EOT;
}elseif($action=='setright'){print <<<EOT
-->
<ul class="nav3">
	<li><a href="$basename">用戶訪問權限</a></li>
<!--
EOT;
if ($job=='user') {print <<<EOT
-->
	<li><a href="$basename&action=user" class="two">用戶管理權限</a></li>
	<li><a href="$basename&action=group">系統組或特殊組用戶</a></li>
<!--
EOT;
} else {print <<<EOT
-->
	<li><a href="$basename&action=user">用戶管理權限</a></li>
	<li><a href="$basename&action=group" class="two">系統組或特殊組用戶</a></li>
<!--
EOT;
}print <<<EOT
-->
</ul>
<div class="c"></div>

<form action="$basename&action=$action" method="post">
<input type="hidden" name="step" value="2" />
<input type="hidden" name="job" value="$job" />
<h2>
<!--
EOT;
if ($job=='user') {print <<<EOT
-->
用戶版塊權限配置
<!--
EOT;
} else {print <<<EOT
-->
用戶組版塊權限配置
<!--
EOT;
}print <<<EOT
-->
</h2>
<table cellspacing="0" cellpadding="0" width="100%">
	<tr class="tr5 tac tips ">
		<td colspan="3"><b>
<!--
EOT;
if ($job=='user') {print <<<EOT
-->
用戶名︰<span class="s3">$username</span><input type="hidden" name="uid" value="$uid" />
(<span class="s3">$grouptitle</span>)
<!--
EOT;
} else {print <<<EOT
-->
&nbsp;&nbsp;用戶組︰<span class="s3">$grouptitle</span><input type="hidden" name="gid" value="$gid" />
<!--
EOT;
}print <<<EOT
-->
&nbsp;&nbsp;所屬版塊︰<span class="s3">$f[name]</span><input type="hidden" name="fid" value="$fid" />
	</b></td></tr>
<!--
EOT;
foreach ($lang['right']['systemforum'] as $key => $value) {
eval("\$value[html] = \"".addcslashes($value['html'],'"')."\";");
print <<<EOT
-->
	<tr class="tr3">
		<td><input type="checkbox" name="othergroup[]" value="$key" onclick="pwJsCheck(this)" /></td>
		<td>$value[title]</td>
		<td>$value[html]</td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table><br />
<h2>高級設置</h2>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr3">
		<td width="63%" valign="top">版塊權限橫向操作<br><br>功能說明︰<br>右邊復選框顯示的版塊列表為該用戶或用戶組在版塊中單獨設置過管理權限。<br>利用此功能可將一個或多個權限設置同時應用到其它版塊中，不再需要逐個版塊設置，使操作更加簡便<br><br>操作說明︰<br>1. <font color=blue>選中</font>需要進行橫向操作的<font color=blue>權限設置前面的復選框</font><br>2. 在右邊的復選框中<font color=blue>選擇</font>需要進行橫向操作的<font color=blue>版塊</font><br>3. 然後提交即可完成版塊權限橫向操作<br><br>注︰<br>1. 選擇版塊時可使用 ‘Ctrl’ 鍵進行多選，也可使用 ‘Shift’ 鍵或拖動鼠標連續選擇多個版塊<br>2. 不使用此功能，請不要選中<font color=blue>權限設置前面的復選框</font>和右邊的復選框中<font color=blue>版塊</font></td>
		<td><select name="otherfid[]" size="16" multiple>$othersel</select></td>
	</tr>
</table>
<br /><center>
<input id="jschkall" class="btn" type="button" name="chkall" value="全 選" onclick="CheckAll(this.form)" />
<input type="submit" value="提 交" class="btn" />
</center><br/>
</form>
<!--
EOT;
}elseif($action == 'batchright'){print <<<EOT
-->
<ul class="nav3">
	<li><a href="$basename">用戶訪問權限</a></li>
<!--
EOT;
if ($job=='user') {print <<<EOT
-->
	<li><a href="$basename&action=user" class="two">用戶管理權限</a></li>
	<li><a href="$basename&action=group">系統組或特殊組用戶</a></li>
<!--
EOT;
} else {print <<<EOT
-->
	<li><a href="$basename&action=user">用戶管理權限</a></li>
	<li><a href="$basename&action=group" class="two">系統組或特殊組用戶</a></li>
<!--
EOT;
}print <<<EOT
-->
</ul>
<div class="c"></div>
<form name="rForm" action="$basename&action=$action" method="post">
<input type="hidden" name="step" value="2" />
<input type="hidden" name="job" value="$job" />
<input type="hidden" name="ids" value="{$suid}_{$sfid}_{$sgid}" />
<!--
EOT;
if ($all) {print <<<EOT
-->
<input type="hidden" name="all" value="1" />
<!--
EOT;
}print <<<EOT
-->
<h2>
<!--
EOT;
if ($job=='user') {print <<<EOT
-->
批量用戶版塊權限配置
<!--
EOT;
} else {print <<<EOT
-->
批量用戶組版塊權限配置
<!--
EOT;
}print <<<EOT
-->
</h2>
<table cellspacing="0" cellpadding="0" width="100%">
	<tr class="tr5 tac tips">
		<td colspan="3">
<b>以下選中的權限將批量修改
<!--
EOT;
if ($suid || $sfid || $sgid) {print <<<EOT
-->
屬于
<!--
EOT;
if ($suid) {print <<<EOT
-->
<span class="s3">$username</span>
<!--
EOT;
}if ($sgid) {print <<<EOT
-->
<span class="s3">{$ltitle[$sgid]}</span>
<!--
EOT;
}if ($sfid) {print <<<EOT
-->
<span class="s3">{$forum[$sfid][name]}</span>
<!--
EOT;
}print <<<EOT
-->
的
<!--
EOT;
}print <<<EOT
-->
用戶版塊權限</b>
<!--
EOT;
if(!$all){print <<<EOT
-->
<b>，<a href="#list" class="s3" onclick="getObj('list').style.display='';">查看詳細用戶列表</span></b>
<!--
EOT;
}print <<<EOT
-->
	</td></tr>
<!--
EOT;
foreach ($lang['right']['systemforum'] as $key => $value) {
if (!isset(${$key.'_Y'}) && !isset(${$key.'_N'})) ${$key.'_N'} = 'checked';
eval("\$value[html] = \"".addcslashes($value['html'],'"')."\";");
print <<<EOT
-->
	<tr class="tr3">
		<td><input id="check_$key" type="checkbox" name="othergroup[]" value="$key" onclick="pwJsCheck(this)" /></td>
		<td>$value[title]</td>
		<td>$value[html]</td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<br /><center>
<input id="jschkall" class="btn" type="button" name="chkall" value="全 選" onclick="CheckAll(this.form)" />
<input type="submit" value="提 交" class="btn" onclick="return pwSubmit(this.form);" />
</center><br/>
<!--
EOT;
if (!$all) {print <<<EOT
-->
<a name="list"></a>
<div class="tt" id="list" style="display:none">
<!--
EOT;
if ($job == 'user') {print <<<EOT
-->
<h2><a href="javascript:scroll(0,0);" class="fr" style="cursor:pointer;" onclick="getObj('list').style.display='none';">頂端</a>以上選中的權限設置，將批量應用到以下用戶所在版塊的個人管理權限</h2>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr3 tac s3">
		<td width="5%">ID</td>
		<td width="15%">用戶名(級別)</td>
		<td width="30%">版塊</td>
	</tr>
<!--
EOT;
$i=0;
foreach ($u_d as $key => $value) {
$i++;
print <<<EOT
-->
	<tr class="tr3 tac">
		<td>$i<input type="hidden" name="selid[]" value="{$value[uid]}_{$value[fid]}_{$value[gid]}" /></td>
		<td>{$value[username]}({$ltitle[$value[groupid]]})</td>
		<td>{$forum[$value[fid]][name]}</td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<!--
EOT;
}elseif($job == 'group'){print <<<EOT
-->
<h2>版塊用戶組管理權限列表</h2>
<table cellspacing="0" cellpadding="0" width="100%">
	<tr class="tr3 tac s3">
		<td width="5%">ID</td>
		<td width="15%">用戶組</td>
		<td width="30%">版塊</td>
	</tr>
<!--
EOT;
$i=0;
foreach ($g_d as $key => $value) {
$i++;
print <<<EOT
-->
	<tr class="tr3 tac">
		<td>$i<input type="hidden" name="selid[]" value="{$value[uid]}_{$value[fid]}_{$value[gid]}" /></td>
		<td>{$ltitle[$value[gid]]}</td>
		<td>{$forum[$value[fid]][name]}</td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<!--
EOT;
}print <<<EOT
-->
</div>
<!--
EOT;
}print <<<EOT
-->
</form>
<script type="text/javascript">
	var form = document.rForm;
	for (var i=0;i<form.elements.length-2;i++){
		var e = form.elements[i];
		if(e.type=='radio'){
			e.onclick = function(){
				getObj('check_'+this.name.replace(/group\[([a-z]+)\]/,'$1')).checked = true;
				pwJsCheck(this);
			}
		}
	}
	function pwSubmit(form){
		for (var i=0;i<form.elements.length-2;i++){
			var e = form.elements[i];
			if(e.type=='checkbox'){
				if (e.checked == true) {
					return true;
				}
			}
		}
		alert('請在左邊框中選擇要修改的權限選項');
		return false;
	}
</script>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->