<!--<?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');
?>-->