<!--<?php
include_once PrintEot('left');
print <<<EOT
-->
<table width=98% align=center cellspacing=1 cellpadding=3 class=i_table>
	<tr>
		<td class=b>
			[<a href="$admin_file?adminjob=hack&hackset=toolcenter">{#tool_setting}</a>]
			[<a href="$admin_file?adminjob=hack&hackset=toolcenter&job=toolinfo">{#toolinfo_title}</a>]
			[<a href="$admin_file?adminjob=hack&hackset=toolcenter&job=usertool">{#usertool_title}</a>]
			[<a href="$admin_file?adminjob=hack&hackset=toolcenter&job=tradelog">{#tradelog_title}</a>]
		</td>
	</tr>
</table>
<br>
<!--
EOT;
if(!$job){print <<<EOT
-->
<form action="$basename" method="post">
<input type="hidden" name="step" value="2">
<table width="98%" align=center cellspacing=1 cellpadding=3 class=i_table>
<tr><td class=head colspan=2>{#tool_setting}</td></tr>
<tr><td class=b  width="60%">{#tool_ifopen}</td><td class=b>
<input type="radio" value="1" name="toolifopen" $toolifopen_Y> {#setting_open} 
<input type="radio" value="0" name="toolifopen" $toolifopen_N>{#setting_close}</td></tr>
<tr><td class=b>{#tool_allowtrade}</td><td class=b>
<input type="radio" value="1" name="allowtrade" $allowtrade_Y> {#setting_open} 
<input type="radio" value="0" name="allowtrade" $allowtrade_N>{#setting_close}</td></tr>
</td></tr>
</table>
<br><center><input type=submit value='{#submit}'></center></form>
<!--
EOT;
}elseif($job=='toolinfo'){
if(!$action){print <<<EOT
-->
<table width="98%" align=center cellspacing=1 cellpadding=3 class=i_table>
<tr><td class=head colspan=7>{#toolinfo_title}</td></tr>
<tr><td class=b>{#toolinfo_info}</td></tr>
</table>
<form action="$basename" method="post">
<input type="hidden" name="action" value="submit">
<table width="98%" align=center cellspacing=1 cellpadding=3 class=i_table>
<tr><td class=head colspan=7>{#toolinfo_title}</td></tr>
<tr class=c align="center">
<td>ID</td>
<td>{#tool_name}</td>
<td>{#tool_descrip}</td>
<td>{#tool_order}</td>
<td>{#tool_price}</td>
<td>{#tool_stock}</td>
<td>{#tool_ifuse}</td>
</tr>
<!--
EOT;
foreach($tooldb as $key => $value){
$id=$value[id];
$ifchecked = $value[state] ? 'checked' : '';
print <<<EOT
-->
<tr class=b align="center">
<td>$id</td>
<td><a href="$basename&action=edit&id=$id">$value[name]</a></td>
<td align="left">$value[descrip]</td>
<td>$value[vieworder]</td>
<td>$value[price]</td>
<td>$value[stock]</td>
<td><input type="checkbox" name="tools[$id]" value="1" $ifchecked></td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<br><center><input type="button" name="chkall" value="{#sel_all}" onclick="CheckAll(this.form)"><input type=submit value='{#submit}'></center></form>
<!--
EOT;
}elseif($action=='edit'){print <<<EOT
-->
<table width="98%" align=center cellspacing=1 cellpadding=3 class=i_table>
<tr><td class=head colspan=7>{#toolinfo_title}</td></tr>
<tr><td class=b>{#toolinfo_edit}</td></tr>
</table><br>
<form action="$basename" method="post">
<input type="hidden" name="action" value="edit">
<input type="hidden" name="step" value="2">
<input type="hidden" name="id" value="$id">
<table width="98%" align=center cellspacing=1 cellpadding=3 class=i_table>
<tr><td class=head colspan=2 align="center">{#tool_info}</td></tr>
<tr><td class=b width="20%">{#tool_name}</td>
<td class=b><input type="text" name="name" value="$rt[name]"></td></tr>
<tr><td class=b width="20%">{#tool_order}</td>
<td class=b><input type="text" name="vieworder" value="$rt[vieworder]"></td></tr>
<tr><td class=b>{#tool_descrip}</td>
<td class=b><input type="text" name="descrip" value="$rt[descrip]" size="90"></td></tr>
<tr><td class=b>{#tool_logo}</td>
<td class=b><input type="text" name="logo" value="$rt[logo]" size="90"></td></tr>
<tr><td class=b>{#tool_state}</td>
<td class=b><input type="radio" name="state" value="1" $state_Y>{#setting_open}<input type="radio" name="state" value="0" $state_N>{#setting_close}</td></tr>
<tr><td class=b>{#tool_price}</td>
<td class=b><input type="text" name="price" value="$rt[price]"></td></tr>
<tr><td class=b>{#tool_stock}</td>
<td class=b><input type="text" name="stock" value="$rt[stock]"></td></tr>
<tr><td class=head colspan=2 align="center">{#tool_credit}</td></tr>
<tr><td class=b>{#posts}</td>
<td class=b><input type="text" name="condition[credit][postnum]" value="{$condition[credit][postnum]}"></td></tr>
<tr><td class=b>{#digests}</td>
<td class=b><input type="text" name="condition[credit][digests]" value="{$condition[credit][digests]}"></td></tr>
<tr><td class=b>{#rvrc}</td>
<td class=b><input type="text" name="condition[credit][rvrc]"    value="{$condition[credit][rvrc]}"></td></tr>
<tr><td class=b>{#money}</td>
<td class=b><input type="text" name="condition[credit][money]"   value="{$condition[credit][money]}"></td></tr>
<tr><td class=b>{#credit}</td>
<td class=b><input type="text" name="condition[credit][credit]"  value="{$condition[credit][credit]}"></td></tr>
<!--
EOT;
foreach($_CREDITDB as $key => $value){print <<<EOT
-->
<tr><td class=b>$value[0]</td>
<td class=b><input type="text" name="condition[credit][$key]" value="{$condition[credit][$key]}"></td></tr>
<!--
EOT;
}print <<<EOT
-->
<tr><td class=head colspan=2 align="center">{#tool_other}</td></tr>
<tr><td class=b>{#tool_usergroup}</td>
<td class=b>$usergroup</td></tr>
<tr><td class=b>{#tool_forums}</td>
<td class=b>$forumcheck</td></tr>
</table>
<br><center><input type=submit value='{#submit}'></center></form>
<!--
EOT;
}}elseif($job=='usertool'){print <<<EOT
-->
<table width="98%" align=center cellspacing=1 cellpadding=3 class=i_table>
<tr><td class=head colspan=7>{#usertool_title}</td></tr>
<tr><td class=b>{#usertool_info}</td></tr>
</table><br>
<!--
EOT;
if (!$action || $action=='search'){print <<<EOT
-->
<form action="$basename" method="post">
<input type="hidden" name="action" value="search">
<table width="98%" align=center cellspacing=1 cellpadding=3 class=i_table>
<tr><td class=head colspan=8>{#usertool_title}</td></tr>
<tr class="b"><td width="20%">{#username}</td>
<td><input type="text" name="username"> <input type="submit" value="{#submit}"></td></tr>
</table></form><br>

<form action="$basename" method="post">
<input type="hidden" name="action" value="submit">
 &nbsp; $pages
<table width="98%" align=center cellspacing=1 cellpadding=3 class=i_table>
<tr><td class=head colspan=9>{#usertool_title}</td></tr>
<tr class="c" align="center">
<td>ID</td>
<td>{#username}</td>
<td>{#tool_name}</td>
<td>{#tool_havenum}</td>
<td>{#tool_sellnum}</td>
<td>{#tool_sellprice}</td>
<td>{#tool_stock}</td>
<td>{#tool_price}</td>
<td>{#del}</td>
</tr>
<!--
EOT;
$id=($page-1)*$db_perpage;
foreach($tooldb as $key => $value){
$id++;
print <<<EOT
-->
<tr class=b align="center">
<td>$id</td>
<td><a href="$basename&action=edit&uid=$value[uid]&id=$value[toolid]">$value[username]</a></td>
<td><a href="$admin_file?adminjob=hack&hackset=toolcenter&job=toolinfo&action=edit&id=$value[toolid]">$value[name]</a></td>
<td>$value[nums]</td>
<td>$value[sellnums]</td>
<td>$value[sellprice]</td>
<td>$value[stock]</td>
<td>$value[price]</td>
<td><a href="$basename&action=del&uid=$value[uid]&id=$value[toolid]">{#del}</a></td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<br><center><input type=submit value='{#submit}'></center></form>
<!--
EOT;
}elseif($action=='edit'){print <<<EOT
-->
<form action="$basename" method="post">
<input type="hidden" name="action" value="edit">
<input type="hidden" name="step" value="2">
<input type="hidden" name="uid" value="$uid">
<input type="hidden" name="id" value="$id">
<table width="98%" align=center cellspacing=1 cellpadding=3 class=i_table>
<tr><td class=head colspan=2 align="center">{#tool_info}</td></tr>
<tr><td class=b width="20%">{#tool_name}</td>
<td class=b>$rt[name]</td></tr>
<tr><td class=b width="20%">{#username}</td>
<td class=b>$rt[username]</td></tr>
<tr><td class=b>{#tool_havenum}</td>
<td class=b><input type="text" name="nums" value="$rt[nums]"></td></tr>
<tr><td class=b>{#tool_sellnum}</td>
<td class=b><input type="text" name="sellnums" value="$rt[sellnums]"></td></tr>
<tr><td class=b>{#tool_sellprice}</td>
<td class=b><input type="text" name="sellprice" value="$rt[sellprice]"></td></tr>
</table>
<br><center><input type=submit value='{#submit}'></center></form>
<!--
EOT;
}}elseif($job=='tradelog'){print <<<EOT
-->
<form action="$basename" method="post">
<input type="hidden" name="action" value="search">
<table width="98%" align=center cellspacing=1 cellpadding=3 class=i_table>
<tr><td class=head colspan=8>{#toollog_title}</td></tr>
<tr class="b"><td width="20%">{#username}</td>
<td><input type="text" name="username"> <input type="submit" value="{#submit}"></td></tr>
</table></form><br>
 &nbsp; $pages
<table width="98%" align=center cellspacing=1 cellpadding=3 class=i_table>
<tr><td class=head colspan=8>{#tradelog_title}</td></tr>
<tr class="c" align="center">
<td>ID</td>
<td>{#tool_username}</td>
<td>{#tool_name}</td>
<td>{#tool_descrip}</td>
<td>{#tool_havenum}</td>
<td>{#tool_sellnum}</td>
<td>{#tool_sellprice}</td>
</tr>
<!--
EOT;
$id=($page-1)*$db_perpage;
foreach($tooldb as $key => $value){
$id++;
print <<<EOT
-->
<tr class="b" align="center">
<td>$id</td>
<td><a href="$admin_file?adminjob=hack&hackset=toolcenter&job=usertool&action=edit&uid=$value[uid]&id=$value[toolid]">$value[username]</a></td>
<td><a href="$admin_file?adminjob=hack&hackset=toolcenter&job=toolinfo&action=edit&id=$value[toolid]">$value[name]</a></td>
<td align="left">$value[descrip]</td>
<td>$value[nums]</td>
<td>$value[sellnums]</td>
<td>$value[sellprice]</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->