<!--<?php
include_once PrintEot('left');
if(empty($action)){print <<<EOT
-->
<ul class="nav3">
	<li><a href="$basename" class="two">勋章设置</a></li>
	<li><a href="$basename&action=edit">勋章编辑</a></li>
	<li><a href="$basename&action=add">添加勋章</a></li>
</ul>
<div class="c"></div>
<h3>提示信息</h3>
<div class="tr5">
	1、勋章中心可以向对论坛做出特殊贡献的会员颁发勋章<br />
	2、开启勋章申请功能后，会员可以自主申请勋章<br />
	3、勋章图片请放到hack/medal/image文件夹下<br />
	4、选择图片时，如带有<font color="red">*</font>则表示该图片已被使用
</div>
<form action="$basename" method="post">
<input type=hidden name="step" value="2">
<h2>勋章管理</h2>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr3">
		<td width="25%">是否开启勋章功能<br></td>
		<td>
			<input type="radio" value="1" name="config[md_ifopen]" $ifopen_Y> 是 
			<input type="radio" value="0" name="config[md_ifopen]" $ifopen_N> 否 (需要到插件中心 管理中同时启用该插件方为有效)
		</td>
	</tr>
	<tr class="tr3">
		<td>颁发(摘除)勋章是否短消息通知用户</td>
		<td>
			<input type="radio" value="1" name="config[md_ifmsg]" $ifmsg_Y> 是 
			<input type="radio" value="0" name="config[md_ifmsg]" $ifmsg_N> 否
		</td>
	</tr>
	<tr class="tr3">
		<td>颁发(摘除)勋章用户组权限</td>
		<td>
			<table width="100%" cellspacing="0" cellpadding="0">
				<tr>
<!--
EOT;
foreach($ltitle as $key => $value){
if($key==1||$key==2)continue;
$num++;
$htm_tr = $num % 4 == 0 ? '</tr><tr>' : '';
$g_ck=strpos($md_groups,",$key,")!==false ? 'checked' : '';
print <<<EOT
-->
					<td style="padding-left:0;"><input type='checkbox' name='groups[]' value='$key' $g_ck>$value</td>
					$htm_tr
<!--
EOT;
}print <<<EOT
-->
				</tr>
			</table>
		</td>
	</tr>
	<tr class="tr3">
		<td>是否开启勋章申请</td>
		<td>
			<input type="radio" value="1" name="config[md_ifapply]" $ifapply_Y> 是 
			<input type="radio" value="0" name="config[md_ifapply]" $ifapply_N> 否
		</td>
	</tr>
	<tr class="tr3">
		<td>申请勋章用户组权限</td>
		<td>
			<table cellspacing='0' cellpadding='0' border='0' width='100%' align='center'>
				<tr>
<!--
EOT;
$num=0;
foreach($ltitle as $key => $value){
if($key==1||$key==2)continue;
$num++;
$htm_tr = $num % 4 == 0 ? '</tr><tr>' : '';
$g_ck=strpos($md_appgroups,",$key,")!==false ? 'checked' : '';
print <<<EOT
-->
					<td style="padding-left:0;"><input type='checkbox' name='appgroups[]' value='$key' $g_ck>$value</td>
					$htm_tr
<!--
EOT;
}print <<<EOT
-->
				</tr>
			</table>
		</td>
	</tr>
</table>
<br>
<center><input class="btn" type="submit" value="提 交"></center>
</form>
<br>
<!--
EOT;
}elseif($action=='edit'){print <<<EOT
-->
<ul class="nav3">
	<li><a href="$basename">勋章设置</a></li>
	<li><a href="$basename&action=edit" class="two">勋章编辑</a></li>
	<li><a href="$basename&action=add">添加勋章</a></li>
</ul>
<div class="c"></div>
<h3>提示信息</h3>
<div class="tr5">1、勋章中心可以向对论坛做出特殊贡献的会员颁发勋章<br />
2、开启勋章申请功能后，会员可以自主申请勋章<br />
3、勋章图片请放到hack/medal/image文件夹下<br />
4、选择图片时，如带有<font color="red">*</font>则表示该图片已被使用
</div>

<form action="$basename&action=edit&" method="post">
<input type="hidden" name="step" value="2">
<h2>勋章管理</h2>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tac tr3">
		<td width="5%">ID</td>
		<td width="8%">勋章名称</td>
		<td width="*">勋章说明</td>
		<td width="28%">图片名称</td>
		<td width="10%">勋章图片</td>
		<td width="6%" class="tal">删除</td>
	</tr>
<!--
EOT;
$num=0;
foreach($medaldb as $key => $value){
$num++;
$id=$value[id];
print <<<EOT
-->
	<tr class="tac tr3">
		<td>$num</td>
		<td><input class="input" type="text" name="medal[$id][name]" value="$value[name]"></td>
		<td><input type="text" class="input" name="medal[$id][intro]" value="$value[intro]" size="50"></td>
		<td><input type="text" size="10" class="input" name="medal[$id][picurl]" id="medal[$id][picurl]" value="$value[picurl]"><a href="javascript:selectImg('medal[$id][picurl]');" >【选图】</a></td>
		<td><img src="hack/$hackset/image/$value[picurl]"></td>
		<td><a class="fourm-two" href="$basename&action=del&id=$id" title="删除"><span class="del"></span></a></td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<br>
<center><input type="submit" class="btn" name="hello" value="提 交"></center>
</form><br/>
<!--
EOT;
}elseif($action=='add'){print <<<EOT
-->
<ul class="nav3">
			<li><a href="$basename">勋章设置</a></li>
			<li><a href="$basename&action=edit">勋章编辑</a></li>
			<li><a href="$basename&action=add" class="two">添加勋章</a></li>
		</ul>
<div class="c"></div>
<form action="$basename&action=add&" method="post">
<input type=hidden name="step" value="2">
<h2>勋章管理</h2>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr3">
		<td width="30%">勋章名称</td>
		<td><input type="text" class="input" name="newname"></td>
	</tr>
	<tr class="tr3">
		<td>勋章说明</td>
		<td><input type="text" class="input" name="newintro"></td>
	</tr>
	<tr class="tr3">
		<td>图片名称</td>
		<td><input type="text" class="input" name="newpicurl" id="newpicurl" ><a href="javascript:selectImg('newpicurl');" >【选择图片】</a>
</td>
	</tr>
</table>
<br>
<center><input type="submit" class="btn" name="hello" value="提 交"></center>
</form>
<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript">
function IsBrowser(){
	var sAgent = navigator.userAgent.toLowerCase() ;
	if ( sAgent.indexOf("msie") != -1 && sAgent.indexOf("mac") == -1 && sAgent.indexOf("opera") == -1 )
		return "msie" ;
	if ( navigator.product == "Gecko" && !( typeof(opera) == 'object' && opera.postError ) )
		return "gecko";
	if ( navigator.appName == 'Opera')
		return "opera" ;
	if ( sAgent.indexOf( 'safari' ) != -1 )
		return "safari";
	return false ;
}
function selectImg(id){
	var time = new Date();
	var timestamp = time.valueOf();
	if(IsBrowser()=='msie'){
		objts=showModalDialog("$basename&action=selectimg&thisid="+id+"&time="+timestamp,window,'dialogWidth=430px;dialogHeight=415px;help:no;status:no;');
	}else{
		window.open("$basename&action=selectimg&thisid="+id+"&time="+timestamp,"selectimg","width=450,height=410,resizable=no,z-look=yes,alwaysRaised=yes,depended=yes,scrollbars=yes,left=" + (window.screen.width-840)/2 + ",top=" + (window.screen.height-500)/2);
	}
}
</script>
<!--
EOT;
include_once PrintEot('adminbottom');
?>-->