<!--<?php print <<<EOT
-->
<table width='$tablewidth' cellspacing=0 cellpadding=0 align=center>
	<tr>
		<td>
			<img src='$imgpath/$stylepath/index/home.gif' align=absbottom> 
			<b><a href='$db_bfn'>$db_bbsname</a> -> 勋章中心</b>
		</td>
	</tr>
</table>
<br>
<table width='$tablewidth' cellspacing=1 cellpadding=4 align=center $i_table>
	<tr align=center>
		<td class='head'>
			<a href="$basename">勋章介绍</a> |
			<a href="$basename&action=list">获得勋章名单</a> |
			<a href="$basename&action=log">勋章颁发情况</a>
<!--
EOT;
if(strpos($md_groups,",$groupid,")!==false){print <<<EOT
-->
			| <a href="$basename&action=award">颁发勋章</a>
<!--
EOT;
}print <<<EOT
-->
		</td>
	</tr>
	<tr align=center>
		<td class='f_one'>
<!--
EOT;
if($userdb['medals']){print <<<EOT
-->
			您获得的勋章
<!--
EOT;
foreach($userdb['medals'] as $key=>$value){
if($_MEDALDB[$value][picurl]){print <<<EOT
-->
			<img src="$imgpath/medal/{$_MEDALDB[$value][picurl]}" alt="{$_MEDALDB[$value][name]}"> 
<!--
EOT;
}}}else{print <<<EOT
-->
			您还没有勋章
<!--
EOT;
}print <<<EOT
-->
		</td>
	</tr>
</table>
<br>
<!--
EOT;
if(!$action){print <<<EOT
-->
<table width='$tablewidth' cellspacing=1 cellpadding=4 align=center $i_table>
	<tr><td class='head' colspan="4">勋章介绍</td></tr>
	<tr class="cbg" align="center">
		<td width="5%">ID</td>
		<td width="15%">勋章名称</td>
		<td width="*">勋章说明</td>
		<td width="15%">勋章图片</td>
	</tr>
<!--
EOT;
$num=0;
foreach($_MEDALDB as $key => $value){
$num++;
print <<<EOT
-->
	<tr class="f_one" align="center">
		<td>$num</td>
		<td>$value[name]</td>
		<td align="left">$value[intro]</td>
		<td><img src="$imgpath/medal/$value[picurl]"></td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<!--
EOT;
}elseif($action=='list'){print <<<EOT
-->
 &nbsp; $pages
<table width='$tablewidth' cellspacing=1 cellpadding=4 align=center $i_table>
	<tr><td class='head' colspan="4">获得勋章名单</td></tr>
	<tr class='cbg' align="center">
		<td width="5%">ID</td>
		<td>用户名</td>
		<td>所获勋章</td>
	</tr>
<!--
EOT;
$num=($page-1)*$db_perpage;
foreach($listdb as $key=>$value){
$num++;
print <<<EOT
-->
	<tr class='f_one' align="center">
		<td>$num</td>
		<td><a href="profile.php?action=show&uid=$value[uid]" target="_blank">$value[username]</a></td>
		<td>$value[medals]</td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
 &nbsp; $pages
<!--
EOT;
}elseif($action=='award'){print <<<EOT
-->
<form method=post action="$basename&action=award&">
<input type="hidden" name="step" value="2">
<table width='$tablewidth' cellspacing=1 cellpadding=4 align=center $i_table>
	<tr><td class='head' colspan="4">颁发勋章</td></tr>
	<tr class="f_one">
		<td align="right" width="30%">用户名: </td>
		<td><input type="text" name="pwuser" size="40"></td>
	</tr>
	<tr class="f_one">
		<td align="right">选择操作: </td>
		<td>
			<input type="radio" name="type" value="1" checked> 颁发
			<input type="radio" name="type" value="2"> 收回
		</td>
	</tr>
	<tr class="f_one">
		<td align="right">选择勋章: </td>
		<td>
			<select name="medal">
				<option>选择勋章</option>
<!--
EOT;
foreach($_MEDALDB as $key=>$value){print <<<EOT
-->
				<option value="$key">$value[name]</option>
<!--
EOT;
}print <<<EOT
-->
			</select>
		</td>
	</tr>
	<tr class="f_one">
		<td align="right">操作理由: </td>
		<td><input type="text" name="reason" size="50"></td>
	</tr>
</table>
<br>
<center><input type="submit" value="提 交"></center>
</form>
<!--
EOT;
}elseif($action=='log'){print <<<EOT
-->
 &nbsp; $pages
<table width='$tablewidth' cellspacing=1 cellpadding=4 align=center $i_table>
	<tr><td class='head' colspan="8">勋章颁发情况</td></tr>
	<tr class='cbg' align="center">
		<td width="3%">ID</td>
		<td width="15%">用户名</td>
		<td width="15%">管理员</td>
		<td width="15%">勋章名称</td>
		<td width="5%">操作</td>
		<td><div style='table-layout:fixed;word-wrap:break-word;'>操作原因</div></td>
		<td width="15%">时间</td>
<!--
EOT;
if($groupid==3){print <<<EOT
-->
		<td width="4%">删除</td>
<!--
EOT;
}print <<<EOT
-->
	</tr>
<!--
EOT;
$num=($page-1)*$db_perpage;
foreach($logdb as $key=>$value){
$num++;
print <<<EOT
-->
	<tr class='f_one' align="center">
		<td>$num</td>
		<td>$value[awardee]</td>
		<td>$value[awarder]</td>
		<td>{$_MEDALDB[$value[level]][name]}</td>
<!--
EOT;
if($value[action]==1){print <<<EOT
-->
		<td>颁发</td>
<!--
EOT;
}elseif($value[action]==2){print <<<EOT
-->
		<td>收回</td>
<!--
EOT;
}print <<<EOT
-->
		<td>$value[why]</td>
		<td>$value[awardtime]</td>
<!--
EOT;
if($groupid==3){print <<<EOT
-->
		<td><a href="$basename&action=log&job=del&id=$value[id]">删除</a></td>
<!--
EOT;
}print <<<EOT
-->
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
 &nbsp; $pages
<!--
EOT;
}?>-->