<!--<?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> -> {#medal_guide}</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">{#medal_intro}</a> |
			<a href="$basename&action=list">{#medal_list}</a> |
			<a href="$basename&action=log">{#medal_log}</a>
<!--
EOT;
if(strpos($md_groups,",$groupid,")!==false){print <<<EOT
-->
			| <a href="$basename&action=award">{#medal_award}</a>
<!--
EOT;
}print <<<EOT
-->
		</td>
	</tr>
	<tr align=center>
		<td class='f_one'>
<!--
EOT;
if($userdb['medals']){print <<<EOT
-->
			{#medal_have}
<!--
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
-->
			{#medal_havenone}
<!--
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">{#medal_intro}</td></tr>
	<tr class="cbg" align="center">
		<td width="5%">ID</td>
		<td width="15%">{#medalset_name}</td>
		<td width="*">{#medalset_descrip}</td>
		<td width="15%">{#medalset_demo}</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">{#medal_list}</td></tr>
	<tr class='cbg' align="center">
		<td width="5%">ID</td>
		<td>{#username}</td>
		<td>{#medal_name}</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">{#medal_award}</td></tr>
	<tr class="f_one">
		<td align="right" width="30%">{#username}: </td>
		<td><input type="text" name="pwuser" size="40"></td>
	</tr>
	<tr class="f_one">
		<td align="right">{#medal_action}: </td>
		<td>
			<input type="radio" name="type" value="1" checked> {#medal_add}
			<input type="radio" name="type" value="2"> {#medal_cancel}
		</td>
	</tr>
	<tr class="f_one">
		<td align="right">{#medal_select}: </td>
		<td>
			<select name="medal">
				<option>{#medal_select}</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">{#medal_reason}: </td>
		<td><input type="text" name="reason" size="50"></td>
	</tr>
</table>
<br>
<center><input type="submit" value="{#submit}"></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">{#medal_log}</td></tr>
	<tr class='cbg' align="center">
		<td width="3%">ID</td>
		<td width="15%">{#username}</td>
		<td width="15%">{#admin}</td>
		<td width="15%">{#medalset_name}</td>
		<td width="5%">{#operate}</td>
		<td><div style='table-layout:fixed;word-wrap:break-word;'>{#reason}</div></td>
		<td width="15%">{#time}</td>
<!--
EOT;
if($groupid==3){print <<<EOT
-->
		<td width="4%">{#del}</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>{#medal_add}</td>
<!--
EOT;
}elseif($value[action]==2){print <<<EOT
-->
		<td>{#medal_cancel}</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]">{#del}</a></td>
<!--
EOT;
}print <<<EOT
-->
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
 &nbsp; $pages
<!--
EOT;
}?>-->