<!--<?php
include_once gettpl('top');
if (empty($action)){
print <<<EOT
-->
<form action="$basename&" method="post">
	<input type="hidden" name="action" value="menedit">
	<table class="tableborder f-w98 f-m0a">
		<tr>
			<td class="header" colspan="6">会员组编辑</td>
		</tr>
		<tr class="field f-tac">
			<td>ID</td>
			<td>头衔</td>
			<td>等级图片号</td>
			<td>升级点数需求</td>
			<td>编辑</td>
			<td>删除</td>
		</tr>
<!--
EOT;
foreach($groupdb['member'] as $member){
$key=$member[gid];
print <<<EOT
-->
		<tr class="f-tac">
			<td>$member[gid]</td>
			<td><input type="text" size="40" name="memtitle[$key]" value="$member[grouptitle]"></td>
			<td>
				<input type="text" size="3" name="mempic[$key]" value="$member[groupimg]" onchange="getimg(this)">
				<img src="$imgpath/$stylepath/level/$member[groupimg].gif" title="选择等级图片" />
			</td>
			<td><input type="text" size="10" name="mempost[$key]" value="$member[grouppost]"></td>
			<td ><input type="button" value="权限" onclick="location.href='$basename&action=editgroup&gid=$key'"></td>
			<td><input type="button" value="删除" onclick="location.href='$basename&action=delgroup&delid=$key'"></td>
		</tr>
<!--
EOT;
}print <<<EOT
-->
	</table>
	<br />
	<center><input type="submit" value="提 交"></center>
</form>
<br />
<form action="$basename&" method="post">
	<input type="hidden" name="action" value="addmengroup">
	<table class="tableborder f-w50 f-m0a">
		<tr>
			<td class="header" colspan="2">新增会员组</td>
		</tr>
		<tr class="f-tal">
			<td width="40%"> 头衔</td>
			<td><input type="text" size="40" name="newtitle"></td>
		</tr>
		<tr>
			<td>等级图片号</td>
			<td><input type="text" size="40" name="newpic"></td>
		</tr>
		<tr>
			<td>升级点数需求</td>
			<td><input type="text" size="40" name="newpost"></td>
		</tr>
	</table>
	<br />
	<center><input type="submit" value="提 交"></center>
</form>
<br />
<form action="$basename&" method="post">
	<input type="hidden" name="action" value="defedit">
	<table class="tableborder f-w98 f-m0a">
		<tr>
			<td class="header" colspan="4">默认用户组</td>
		</tr>
		<tr class="field f-tac">
			<td>ID</td>
			<td>头衔</td>
			<td>等级图片号</td>
			<td>编辑</td>
		</tr>
<!--
EOT;
foreach($groupdb['default'] as $default){
$key=$default[gid];
print <<<EOT
-->
		<tr class="f-tac">
			<td>$default[gid]</td>
			<td><input type="text" size="40" name="memtitle[$key]" value="$default[grouptitle]"></td>
			<td>
				<input type="text" size="3" name="mempic[$key]" value="$default[groupimg]" onchange="getimg(this);">
				<img src="$imgpath/$db_defaultstyle/level/$default[groupimg].gif" title="选择等级图片" />
			</td>
			<td><input type="button" value="权限" onclick="location.href='$basename&action=editgroup&gid=$key'"></td>
		</tr>
<!--
EOT;
}
print <<<EOT
-->
	</table>
	<br />
	<center><input type="submit" value="提 交"></center>
</form>
<br />
<form action="$basename&" method="post">
	<input type="hidden" name="action" value="sysedit">
	<table class="tableborder f-w98 f-m0a">
		<tr>
			<td class="header" colspan="5">系统组编辑</td>
		</tr>
		<tr class="field f-tac">
			<td>ID</td>
			<td>头衔</td>
			<td>等级图片号</td>
			<td>编辑</td>
			<td>删除</td>
		</tr>
<!--
EOT;
foreach($groupdb['system'] as $sys){
$key=$sys[gid];
print <<<EOT
-->
		<tr class="f-tac">
			<td>$sys[gid]</td>
			<td><input type="text" size="40" name="memtitle[$key]" value="$sys[grouptitle]"></td>
			<td>
				<input type="text" size="3" name="mempic[$key]" value="$sys[groupimg]" onchange="getimg(this);">
				<img src="$imgpath/$db_defaultstyle/level/$sys[groupimg].gif" title="选择等级图片" />
			</td>
			<td><input type="button" value="权限" onclick="location.href='$basename&action=editgroup&gid=$key'"></td>
			<td>
<!--
EOT;
if($key>4){
print <<<EOT
-->
				<input type="button" value="删除" onclick="location.href='$basename&action=delgroup&delid=$key'">
<!--
EOT;
}
print <<<EOT
-->
			</td>
		</tr>
<!--
EOT;
}
print <<<EOT
-->
	</table>
	<br />
	<center><input type="submit" value="提 交"></center>
</form>
<br />

<form action="$basename&" method="post">
	<input type="hidden" name="action" value="addadmingroup">
	<table class="tableborder f-w50 f-m0a">
		<tr>
			<td class="header" colspan="2">新增系统组</td>
		</tr>
		<tr class="f-tal">
			<td width="40%">头衔</td>
			<td><input type="text" size="40" name="newtitle"></td>
		</tr>
		<tr class="f-tal">
			<td>等级图片号</td>
			<td><input type="text" size="40" name="newpic"></td>
		</tr>
	</table>
	<br />
	<center><input type="submit" value="提 交"></center>
</form>
<br />

<form action="$basename&" method="post">
	<input type="hidden" name="action" value="specedit">
	<table class="tableborder f-w98 f-m0a">
		<tr>
			<td class="header" colspan="5">特殊组编辑</td>
		</tr>
		<tr class="field f-tac">
			<td>ID</td>
			<td>头衔</td>
			<td>等级图片号</td>
			<td>编辑</td>
			<td>删除</td>
		</tr>
<!--
EOT;
foreach($groupdb['special'] as $spec){
$key=$spec[gid];
print <<<EOT
-->
		<tr class="f-tac">
			<td>$spec[gid]</td>
			<td><input type="text" size="40" name="memtitle[$key]" value="$spec[grouptitle]"></td>
			<td>
				<input type="text" size="3" name="mempic[$key]" value="$spec[groupimg]" onchange="getimg(this);">
				<img src="$imgpath/$db_defaultstyle/level/$spec[groupimg].gif" title="选择等级图片" />
			</td>
			<td><input type="button" value="权限" onclick="location.href='$basename&action=editgroup&gid=$key'"></td>
			<td><input type="button" value="删除" onclick="location.href='$basename&action=delgroup&delid=$key'"></td>
		</tr>
<!--
EOT;
}
print <<<EOT
-->
	</table>
	<br />
	<center><input type="submit" value="提 交"></center>
</form>
<br />

<form action="$basename&" method="post">
	<input type="hidden" name="action" value="addspecgroup">
	<table class="tableborder f-w50 f-m0a">
		<tr>
			<td class="header" colspan="2">新增特殊组</td>
		</tr>
		<tr class="f-tal">
			<td width="40%">头衔</td>
			<td><input type="text" size="40" name="newtitle"></td>
		</tr>
		<tr class="f-tal">
			<td>等级图片号</td>
			<td><input type="text" size="40" name="newpic"></td>
		</tr>
	</table>
	<br />
	<center><input type="submit" value="提 交"></center>
</form>
<script language="javascript">
	function getimg(_this) {
		$(_this).next("img").attr("src", "$imgpath/$db_defaultstyle/level/" + _this.value + ".gif");
	}
</script>
<!--
EOT;
}elseif($action=='editgroup'){
print <<<EOT
-->
<script type="text/javascript">
function level_jump(admin_file) {
	var gid = $("select[name='selectfid']").val();
	location.href = admin_file + "?adminjob=level&action=editgroup&gid=" + gid;
}
</script>
<form action="$basename&" method="post" name="mod">
	<table class="tableborder f-w98 f-m0a">
		<tr>
			<td class="header f-tac" colspan="2">用户组编辑</td>
		</tr>
		<tr>
			<td width="50%">用户组头衔</td>
			<td>
				<select name="selectfid" onchange="level_jump('$admin_file')">
					$groupselect
				</select>
<!--
EOT;
if($gp_gptype=='member' && !$default){
print <<<EOT
-->
				<font color="red">独立用户组权限</font> -- <a href="$basename&action=setdef&gid=$gid">点击采用默认用户组权限</a>
<!--
EOT;
}print <<<EOT
-->
			</td>
		</tr>
	</table>
	<input type="hidden" name="action" value="editgroup">
	<input type="hidden" name="gid" value="$gid">
	<input type="hidden" name="gptype" value="$gp_gptype">
	<input type="hidden" name="step" value="2">
	<br />
	<table class="tableborder f-w98 f-m0a">
		<tr>
			<td class="header f-tac" colspan="2">基本权限</td>
		</tr>
		<tr>
			<td width="60%">是否允许浏览影片</td>
			<td>
				<label><input type="radio" value="1" $allowread_1 name="group[allowread]">是</label>
				<label><input type="radio" value="0" $allowread_0 name="group[allowread]">否</label>
			</td>
		</tr>
		<tr>
			<td>是否允许播放影片</td>
			<td>
				<label><input type="radio" value="1" $allowplay_1 name="group[allowplay]">是</label>
				<label><input type="radio" value="0" $allowplay_0 name="group[allowplay]">否</label>
			</td>
		</tr>
		<tr>
			<td>是否允许免费播放收费影片</td>
			<td>
				<label><input type="radio" value="1" $allowplayvip_1 name="group[allowplayvip]">是</label>
				<label><input type="radio" value="0" $allowplayvip_0 name="group[allowplayvip]">否</label>
			</td>
		</tr>		
		<tr>
			<td>是否允许发布影片</td>
			<td>
				<label><input type="radio" value="1" $allowpost_1 name="group[allowpost]">是</label>
				<label><input type="radio" value="0" $allowpost_0 name="group[allowpost]">否</label>
			</td>
		</tr>
		<tr>
			<td>发布的影片是否需要管理员审核（此项只有开启栏目影片审核时才有效）</td>
			<td>
				<label><input type="radio" value="1" $atccheck_1 name="group[atccheck]">是</label>
				<label><input type="radio" value="0" $atccheck_0 name="group[atccheck]">否</label>
			</td>
		</tr>
		<tr>
			<td>是否允许发表评论</td>
			<td>
				<label><input type="radio" value="1" $allowrp_1 name="group[allowrp]">是</label>
				<label><input type="radio" value="0" $allowrp_0 name="group[allowrp]">否</label>
			</td>
		</tr>
		<tr>
			<td>发布的评论是否需要管理员审核（此项只有开启栏目评论审核时才有效）</td>
			<td>
				<label><input type="radio" value="1" $rpcheck_1 name="group[rpcheck]">是</label>
				<label><input type="radio" value="0" $rpcheck_0 name="group[rpcheck]">否</label>
			</td>
		</tr>
		<tr>
			<td>是否允许编辑自己发布的影片</td>
			<td>
				<label><input type="radio" value="1" $alloweditatc_1 name="group[alloweditatc]">是</label>
				<label><input type="radio" value="0" $alloweditatc_0 name="group[alloweditatc]">否</label>
			</td>
		</tr>
		<tr>
			<td>是否允许删除自己发布的影片</td>
			<td>
				<label><input type="radio" value="1" $allowdelatc_1 name="group[allowdelatc]">是</label>
				<label><input type="radio" value="0" $allowdelatc_0 name="group[allowdelatc]">否</label>
			</td>
		</tr>
		<tr>
			<td>是否允许自定义头衔</td>
			<td>
				<label><input type="radio" value="1" $allowhonor_1 name="group[allowhonor]">是</label>
				<label><input type="radio" value="0" $allowhonor_0 name="group[allowhonor]">否</label>
			</td>
		</tr>
		<tr>
			<td>是否允许查看会员资料</td>
			<td>
				<label><input type="radio" value="1" $allowprofile_1 name="group[allowprofile]">是</label>
				<label><input type="radio" value="0" $allowprofile_0 name="group[allowprofile]">否</label>
			</td>
		</tr>
		<tr>
			<td>是否允许用户使用自定义头像</td>
			<td>
				<label><input type="radio" value="1" $allowseticon_1 name="group[allowseticon]">是</label>
				<label><input type="radio" value="0" $allowseticon_0 name="group[allowseticon]">否</label>
			</td>
		</tr>
		<tr>
			<td>是否允许用户使用头像上传功能</td>
			<td>
				<label><input type="radio" value="1" $allowupicon_1 name="group[allowupicon]">是</label>
				<label><input type="radio" value="0" $allowupicon_0 name="group[allowupicon]">否</label>
			</td>
		</tr>
		<tr>
			<td>是否允许用户发布出售影片</td>
			<td>
				<label><input type="radio" value="1" $allowsell_1 name="group[allowsell]">是</label>
				<label><input type="radio" value="0" $allowsell_0 name="group[allowsell]">否</label>
			</td>
		</tr>
		<tr>
			<td>是否允许发送短消息</td>
			<td>
				<label><input type="radio" value="1" $allowmessage_1 name="group[allowmessage]">是</label>
				<label><input type="radio" value="0" $allowmessage_0 name="group[allowmessage]">否</label>
			</td>
		</tr>
		<tr>
			<td>最大短消息数目</td>
			<td>
				<input type="text" value="$gp_maxmsg" name="group[maxmsg]">
			</td>
		</tr>
	</table>
<!--
EOT;
if($gp_gptype=='special'){print <<<EOT
-->
	<br />
	<table class="tableborder f-w98 f-m0a">
		<tr>
			<td class="header f-tac" colspan="2">用户组购买</td>
		</tr>
		<tr>
			<td width="60%">允许购买</td>
			<td><label><input type="radio" value="1" $allowbuy_1 name="specgroup[allowbuy]">是</label>
				<label><input type="radio" value="0" $allowbuy_0 name="specgroup[allowbuy]">否</label> </td>
		</tr>
		<tr>
			<td>购买币种</td>
			<td><select name="specgroup[selltype]">$selltype</select></td>
		</tr>
		<tr>
			<td>每日价格</td>
			<td><input type="text" name="specgroup[sellprice]" value="$gp_sellprice"></td>
		</tr>
		<tr>
			<td>购买天数限制</td>
			<td><input type="text" name="specgroup[selllimit]" value="$gp_selllimit"></td>
		</tr>
		<tr>
			<td>描述</td>
			<td><input type="text" name="specgroup[sellinfo]" value="$gp_sellinfo"></td>
		</tr>
	</table>
<!--
EOT;
}
if($gp_gptype=='system'){print <<<EOT
-->
	<br />
	<table class="tableborder f-w98 f-m0a">
		<tr>
			<td class="header f-tac" colspan="2">管理权限</td>
		</tr>
		<tr>
			<td width="60%">是否允许进后台</td>
			<td><label><input type="radio" value="1" $allowadmincp_1 name="sysgroup[allowadmincp]">是</label>
				<label><input type="radio" value="0" $allowadmincp_0 name="sysgroup[allowadmincp]">否</label> </td>
		</tr>
		<tr>
			<td>是否允许编辑视频</td>
			<td><label><input type="radio" value="1" $allowadminedit_1 name="sysgroup[allowadminedit]">是</label>
				<label><input type="radio" value="0" $allowadminedit_0 name="sysgroup[allowadminedit]">否</label> </td>
		</tr>
		<tr>
			<td>是否允许删除视频</td>
			<td><label><input type="radio" value="1" $allowadmindel_1 name="sysgroup[allowadmindel]">是</label>
				<label><input type="radio" value="0" $allowadmindel_0 name="sysgroup[allowadmindel]">否</label> </td>
		</tr>
		<tr>
			<td>是否允许浏览未审核的视频</td>
			<td><label><input type="radio" value="1" $allowadminshow_1 name="sysgroup[allowadminshow]">是</label>
				<label><input type="radio" value="0" $allowadminshow_0 name="sysgroup[allowadminshow]">否</label> </td>
		</tr>
	</table>
<!--
EOT;
if($admin[groupid] == '3') {
print <<<EOT
-->
	<br />
	<table class="tableborder f-w98 f-m0a">
		<tr>
			<td class="header f-tac" colspan="2">后台权限设置</td>
		</tr>
<!--
EOT;
if($gid == 3){
print <<<EOT
-->
		<tr>
			<td class="f-tal" colspan="2">管理员拥有后台所有权限</td>
		</tr>
<!--
EOT;
}else{
print <<<EOT
-->
		$table_str
<!--
EOT;
}
print <<<EOT
-->
	</table>
<!--
EOT;
}}
print <<<EOT
-->
	<br />
	<center><input type="submit" value="提 交"></center>
</form>
<!--
EOT;
}include_once gettpl('adminbottom');
?>
-->