<?php
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	printFooter();
	exit;
}
?><!--<?php
print <<<EOT
-->
<table border="0" cellspacing="0" cellpadding="0"  align="center" class="indextableborder1">
<tr> 
<td class="tdtit" colspan="6">{$lang['g_title_falg']} {$lang['board_permission_1']}</td>
</tr>
<tr><td height="25"  class="forumrow">{$lang['board_permission_2']}</td>
</tr>
</table>
<br />
<div class="tableborder">
<div class="tit1">
<div style="float:left;text-indent:50px;">{$lang['list_str1']}</div>
<div style="float:right;width:250px;color:#000">{$lang['board_permission_3']}</div>
</div>
<!--
EOT;
while($forum = $db->fetch_array($query)) {
	if($forum['child']> 0 ){
	$img='images/t_plus.gif';
	$child='('.$forum['child'].')';
	}else{
		$img='images/t_minus.gif';
		$child='';
	}
	if($forum['isgroupsetting']!='' && $forum['isgroupsetting']!=null && $forum['isgroupsetting']!='0'){
		$hascp=$lang['board_permission_6'];
		}else{
		$hascp='';
		}
if ($forum['parentid']==0){
print <<<EOT
--><div class="forumrow1" style="border-top:#E4E4EF 1px solid;text-indent:12px;height:24px;">
<div style="float:right;width:450px;text-indent:0px;height:24px;">
<form name="permission" action="?action=editpermission" method="post" style="margin : 0;">
<select name="groupid" size="1" style="margin-top: 2px;width:180px;">
<!--
EOT;
$selectedstr=' selected='.'"selected"';
foreach($usergroups as $group) {
if(in_array($forum['boardid'].'_'.intval($group['usergroupid']),$permission_list)){
	$hascp1=$lang['board_permission_4'];
	}else{
	$hascp1='';
	}
print <<<EOT
--><option value="{$group['usergroupid']}"{$selectedstr}>{$lang['sys_group_'.$group['parentgid']]} {$group['usertitle']}{$hascp1}</option>
<!--
EOT;
$selectedstr='';
}
print <<<EOT
--></select>
<input type="hidden" name="boardid" value="{$forum['boardid']}" />
<input type="submit" class="button" name="submit" value="{$lang['board_permission_5']}" />{$hascp}
</form>
</div>
<div style="float:left;"><img src="{$img}" alt="" style="margin-top:8px;margin-right:5px;"/></div>
<div style="float:left;text-indent:0px;"><b>{$forum['boardtype']}{$child}</b></div>
</div><!--
EOT;
}else{
$depth=$forum['depth'] * 14 + 14;
print <<<EOT
--><div class="forumrow" style="border-top:#E4E4EF 1px solid;text-indent:{$depth}px;">
<div style="float:right;width:450px;text-indent:0px;height:24px;">
<form name="permission" action="?action=editpermission" method="post" style="margin : 0;">
<select name="groupid" size="1" style="margin-top: 2px;width:180px;">
<!--
EOT;
$selectedstr=' selected='.'"selected"';
foreach($usergroups as $group) {
if(in_array($forum['boardid'].'_'.intval($group['usergroupid']),$permission_list)){
	$hascp1=$lang['board_permission_4'];
	}else{
	$hascp1='';
	}
print <<<EOT
--><option value="{$group['usergroupid']}"{$selectedstr}>{$lang['sys_group_'.$group['parentgid']]} {$group['usertitle']}{$hascp1}</option>
<!--
EOT;
$selectedstr='';
}
print <<<EOT
--></select>
<input type="hidden" name="boardid" value="{$forum['boardid']}" />
<input type="submit" class="button" name="submit" value="{$lang['board_permission_5']}" />{$hascp}
</form>
</div>
<div style="float:left;"><img src="{$img}" alt="" style="margin-top:8px;margin-right:5px;"/></div>
<div style="float:left;text-indent:0px;">{$forum['boardtype']}{$child}</div>
</div><!--
EOT;
}
}
print <<<EOT
--></div>
<!--
EOT;
?>-->