<!--<?php
if(!defined('AJAX')) {
require_once uTemplate::PrintEot('header');
require_once(uTemplate::printEot('user_appleft'));
print <<<EOT
-->
<div class="contUser">
	<div class="p15" style="min-height:450px;_height:450px;"> 
		<h4 class="site"><img src="u/images/module/toolcenter.png" align="absmiddle" class="mr10" /><span>道具中心</span></h4>   
<!--
EOT;
if (empty($job)) {
print <<<EOT
-->
		<div class="navC mb10">
			<ul id="infolist">
				<li class="current"><a href="profile.php?action=toolcenter">道具交易</a></li>
				<li><a href="profile.php?action=toolcenter&job=mytool">我的道具箱</a></li>
			</ul>
		</div>
		<div class="bdB pb10 mb10 p_lr_10">
			<a href="profile.php?action=toolcenter" class="s5 b">道具商店</a>&nbsp;|&nbsp;<a href="profile.php?action=toolcenter&job=user">二手市場</a>
		</div>
				<table width="100%" cellspacing="0" cellpadding="0" class="vt">
<!--
EOT;
if ($tooldb) {print <<<EOT
-->
					<tr>
<!--
EOT;
$num=0;
foreach ($tooldb as $key => $value) {
$id = $value[id];
$num++;
print <<<EOT
-->
						<td width="50%">
						
							<div class="toolItem">
							<table width="100%" cellspacing="0" cellpadding="0">
							<tr>
							<td rowspan="4" width="115" class="toolPic">
<!--
EOT;
if ($value[logo]) {
print <<<EOT
-->
							<a href="profile.php?action=toolcenter&job=buy&id=$id"><img src="u/images/toolcenter/tool/$value[logo]" /></a>
<!--
EOT;
} else {
print <<<EOT
-->
							<span class="gray">暫無圖片</span>
<!--
EOT;
}
print <<<EOT
-->
							</td>
							<th colspan="3"><a href="profile.php?action=toolcenter&job=buy&id=$id">$value[name]</a></th>
							</tr>
							<tr>
								<td colspan="3" class="infos gray"><div class="lh_18">$value[descrip]</div></td>
							</tr>
							<tr>
							<td width="14%" class="tit">價格︰</td>
							<td colspan="2"><span class="f14 s1 b">$value[price]</span> [{$credit->cType[$value[creditype]]}]
<!--
EOT;
if ($value['rmb'] > 0 ) {
print <<<EOT
-->
							/ <span class="s3">¥$value[rmb]</span>
<!--
EOT;
}
print <<<EOT
-->
							</td>
							</tr>
							<tr>
								<td class="tit">庫存︰</td>
								<td width="80">$value[stock] 個</td>
								<td><a href="profile.php?action=toolcenter&job=buy&id=$id" class="toolbuy">購買</a></td>
							</tr>
							</table>
							</div>
						</td>
<!--
EOT;
if ($num == 2) {
$num=0;
print <<<EOT
-->
					</tr>
					<tr>
<!--
EOT;
}
} //endforeach
print <<<EOT
-->
					</tr>
<!--
EOT;
} else {print <<<EOT
-->
					<tr><td><div class="p10 f14 tac">暫無道具交易</div></td></tr>
<!--
EOT;
}print <<<EOT
-->				</table>
<!--
EOT;
} elseif($job == 'user') {print <<<EOT
-->
		<div class="navC mb10">
			<ul id="infolist">
<!--
EOT;
if ($uid == $winduid) {print <<<EOT
-->
				<li><a href="profile.php?action=toolcenter">道具交易</a></li>
				<li  class="current"><a href="profile.php?action=toolcenter&job=mytool">我的道具箱</a></li>
<!--
EOT;
} else {print <<<EOT
-->
				<li class="current"><a href="profile.php?action=toolcenter">道具交易</a></li>
				<li><a href="profile.php?action=toolcenter&job=mytool">我的道具箱</a></li>
<!--
EOT;
}print <<<EOT
-->
			</ul>
		</div>
		<div class="bdB pb10 mb10 p_lr_10">
<!--
EOT;
if ($uid == $winduid && count($tooldb)) {print <<<EOT
-->
			<span class="fr">共出售&nbsp;<span class="f14 b s2">{$total_tool_nums['sell_nums']}</span>&nbsp;個道具</span>
<!--
EOT;
}print <<<EOT
-->

<!--
EOT;
if ($uid == $winduid) {print <<<EOT
-->
			<a href="profile.php?action=toolcenter&job=mytool">我擁有的</a>&nbsp;|&nbsp;<a href="profile.php?action=toolcenter&job=user&uid=$winduid"  class="s5 b">我轉讓的</a>
<!--
EOT;
} else {print <<<EOT
-->
			<a href="profile.php?action=toolcenter">道具商店</a>&nbsp;|&nbsp;<a class="s5 b" href="profile.php?action=toolcenter&job=user">二手市場</a>
<!--
EOT;
}print <<<EOT
-->
		</div>              
<!--
EOT;
print <<<EOT
-->
				<table width="100%" cellspacing="0" cellpadding="0" class="vt">
					<tr>
<!--
EOT;
if (!is_array($tooldb) || !count($tooldb)) {
$tmp_msg = "暫無道具轉讓";
print <<<EOT
-->
						<td><div class="p10 f14 tac">$tmp_msg</div>
</td>
<!--
EOT;
}
$num=0;
foreach($tooldb as $key => $value) {
$id=$value[toolid];
$num++;
print <<<EOT
-->
						<td width="50%">
							<div class="toolItem">
								<table width="100%" cellspacing="0" cellpadding="0">
									<tr>
										<td rowspan="5" width="115" class="toolPic">
<!--
EOT;
if ($value[logo]) {print <<<EOT
-->
										<img src="u/images/toolcenter/tool/$value[logo]" />
<!--
EOT;
} else {
print <<<EOT
-->
										<span class="gray">暫無圖片</span>
<!--
EOT;
} print <<<EOT
-->
										</td>
										<th colspan="2">$value[name]</th>
									</tr>
									<tr>
										<td colspan="3" class="infos gray"><div class="lh_18">$value[descrip]</div></td>
									</tr>
									<tr><td width="65" class="tit">出售者︰</td><td colspan="2">$value[username]</td></tr>
									<tr><td class="tit">轉讓價格︰</td><td colspan="2"><span class="f14 s1 b">$value[sellprice]</span> [{$credit->cType[$value[creditype]]}]</td></tr>
									<tr>
										<td class="tit">轉讓數量︰</td>
										<td width="50">$value[sellnums] 個</td>
										<td>
<!--
EOT;
if ($value['uid'] == $winduid) {print <<<EOT
-->
										<a href="profile.php?action=toolcenter&job=unsell&id={$id}" class="canceltran" onclick="return confirm('該操作將取消轉讓此道具，您確定要繼續麼？')">取消轉讓</a>
<!--
EOT;
} else {
print <<<EOT
-->
										<a href="profile.php?action=toolcenter&job=buyuser&id=$id&uid=$value[uid]" class="toolbuy">購買</a>
<!--
EOT;
}print <<<EOT
-->
										</td>
									</tr>
								</table>
							</div>
						</td>
<!--
EOT;
if ($num == 2) {
$num=0;
print <<<EOT
-->
					</tr>
				<tr>
<!--
EOT;
}} //endforeach
print <<<EOT
-->
				</tr>
				</table>
<!--
EOT;
} elseif ($job == 'buyuser') {print <<<EOT
-->
		<div class="navC mb10">
				<ul id="infolist">
					<li class="current"><a href="profile.php?action=toolcenter">道具交易</a></li>
					<li><a href="profile.php?action=toolcenter&job=mytool">我的道具箱</a></li>
				</ul>
		</div>
		<div class="bdB pb10 mb10 p_lr_10">
			<a href="profile.php?action=toolcenter">道具商店</a>&nbsp;|&nbsp;<a href="profile.php?action=toolcenter&job=user"  class="s5 b">二手市場</a>
		</div>
				<form action="profile.php?action=toolcenter&" method="post" onsubmit="return checkSubmit();">
					<input type="hidden" name="job" value="buyuser" />
					<input type="hidden" name="step" value="2" />
					<input type="hidden" name="id" value="$id" />
					<input type="hidden" name="uid" value="$uid" />
					<div class="toolItem" style="border-bottom:none; margin-bottom:0">
					<table width="100%" cellspacing="0" cellpadding="0" class="vt">
						<tr>
						<td class="toolPic" rowspan="7" width="20%">
<!--
EOT;
if ($rt['logo']) {print <<<EOT
-->
						<img src="u/images/toolcenter/tool/$rt[logo]" />
<!--
EOT;
} else {print <<<EOT
-->
						<span class="gray">暫無圖片</span>
<!--
EOT;
}print <<<EOT
-->
						</td>
						<th colspan="2" class="f14 s2">$rt[name]</th>
						</tr>
						<tr>
						<th class="tit" width="11%">功能︰</th>
						<td>$rt[descrip]</td>
						</tr>
						<tr>
						<th class="tit">轉讓價格︰</th>
						<td><span class="s1 b">$rt[sellprice]</span> [{$credit->cType[$rt[creditype]]}]</td>
						</tr>
						<tr><th class="tit">轉讓數量︰</th><td>$rt[sellnums]</td></tr>
						<tr><th class="tit">購買數量︰</th><td><input id="nums" type="text"  class="input" name="nums" value="1" /></td></tr>
						<tr><td colspan="2"><span class="btn2"><span><button type="submit">購買</button></span></span></td></tr>
					</table>
				</div>	
					<table width="100%" class="toolInfo">
						<tr>
							<th colspan="2" class="toolTitle">使用積分限制</th>
						</tr>
						<tr><th width="160">發帖</th><td>{$condition[credit][postnum]}</td></tr>
						<tr><th>精華</th><td>{$condition[credit][digests]}</td></tr>
						<tr><th>{$db_rvrcname}</th><td>{$condition[credit][rvrc]}</td></tr>
						<tr><th>{$db_moneyname}</th><td>{$condition[credit][money]}</td></tr>
						<tr><th>{$db_creditname}</th><td>{$condition[credit][credit]}</td></tr>
<!--
EOT;
foreach ($_CREDITDB as $key => $value) {print <<<EOT
-->
						<tr><th>$value[0]</th><td>{$condition[credit][$key]}</td></tr>
<!--
EOT;
}print <<<EOT
-->
						<tr><th colspan="2" class="toolTitle">用戶組與版塊限制</th></tr>
						<tr><th>允許使用道具的用戶組</th>
						<td>
<!--
EOT;
if ($usergroup) {print <<<EOT
-->
						<table cellspacing="0" cellpadding="0" width="100%"><tr>$usergroup</tr></table>
<!--
EOT;
} else {print <<<EOT
-->
						所有用戶組
<!--
EOT;
}print <<<EOT
-->
						</td>
						</tr>
						<tr>
						<th>允許使用道具的版塊</th>
						<td>
<!--
EOT;
if ($usergroup) {print <<<EOT
-->
						<table cellspacing="0" cellpadding="0" width="100%"><tr>$forumcheck</tr></table>
<!--
EOT;
} else {print <<<EOT
-->
						所有版塊
<!--
EOT;
}print <<<EOT
-->
						</td>
						</tr>
						</table>
				</form>
<script>
function checkSubmit() {
if (1 * getObj('nums').value <= 0) {
	alert("請您輸入要購買的個數");
	return false;
} else {
	return confirm("該操作將購買該道具 " + getObj('nums').value + " 個，您確定麼？");
}
}
//checkradio();
</script>
<!--
EOT;
} elseif ($job == 'mytool') {print <<<EOT
-->
		<div class="navC mb10">
			<ul id="infolist">
				<li><a href="profile.php?action=toolcenter">道具交易</a></li>
				<li class="current"><a href="profile.php?action=toolcenter&job=mytool">我的道具箱</a></li>
			</ul>
		</div>
		<div class="bdB pb10 mb10 p_lr_10">
			<div class="fr">共有&nbsp;<span class="f14 b s2">{$total_tool_nums['valid_nums']}</span>&nbsp;個可用道具</div>
			<a class="s5 b" href="profile.php?action=toolcenter&job=mytool">我擁有的</a>&nbsp;|&nbsp;<a href="profile.php?action=toolcenter&job=user&uid=$winduid">我轉讓的</a>
		</div>
			<table width="100%" cellspacing="0" cellpadding="0" align="center">
				<tr>
				
<!--
EOT;
if (empty($tooldb)) {print <<<EOT
-->
				<td class="p10 f14 tac">對不起，您還沒有任何道具</td>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
$num=0;
foreach ($tooldb as $key => $value) {
$id=$value[toolid];
$num++;
print <<<EOT
-->
					<td width="50%">
						<div class="toolItem">
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td rowspan="4" width="115" class="toolPic">
<!--
EOT;
if ($value[logo]) {print <<<EOT
-->
										<img src="u/images/toolcenter/tool/$value[logo]" />
<!--
EOT;
} else {print <<<EOT
-->
										<span class="gray">暫無圖片</span>
<!--
EOT;
} print <<<EOT
-->
									</td>
									<th colspan="3">$value[name]</th>
								</tr>
								<tr>
									<td colspan="3">價格 <span class="f14 s1 b">$value[price]</span> {$credit->cType[$value[creditype]]}</td>
								</tr>
								<tr>
									<td>擁有數量 <span class="f14 s3 b">$value[nums]</span> 個</td>
									<td>
<!--
EOT;
if ($value['nums'] > 0) {
if($value[type] == 1 || $value['toolid'] == 16) {print <<<EOT
-->
										<a href="profile.php?action=toolcenter&job=use&toolid=$id" class="usetool" onclick="alert('對不起，帖子相關道具請您到帖子頁面使用');return false;">使用道具</a>
<!--
EOT;
} else {
if($value['toolid'] == 18){print <<<EOT
-->
										<a href="profile.php?action=toolcenter&job=use&uid=$winduid&toolid=$id" class="usetool" onclick="return checkset('要讓他人頭像變豬頭，請在瀏覽帖子時的頭像名片中使用。在這里使用會讓自己頭像變豬頭，')">使用道具</a>
<!--
EOT;
} else {print <<<EOT
-->

										<a href="profile.php?action=toolcenter&job=use&uid=$winduid&toolid=$id" class="usetool" onclick="return checkset('{$value[descrip]}')">使用道具</a>
<!--
EOT;
}}}print <<<EOT
-->
									</td>
									<td>
<!--
EOT;
if ($value[nums] > 0) {print <<<EOT
-->
										<a href="profile.php?action=toolcenter&job=sell&id=$id" class="canclesale">轉讓</a>
<!--
EOT;
}print <<<EOT
-->
									</td>
								</tr>
								<tr>
									<td colspan="2">轉讓中 <a href="profile.php?action=toolcenter&job=user&uid=$winduid"><span class="f14 s1 b">$value[sellnums]</span></a> 個</td>
									<td>
<!--
EOT;
if ($value[sellnums] > 0) { print <<<EOT
-->
<!--
EOT;
}print <<<EOT
-->
									</td>
								</tr>
							</table>
						</div>
					</td>
<!--
EOT;
if ($num == 2) {
$num=0;
print <<<EOT
-->
				</tr>
				<tr>
<!--
EOT;
}} //endforeach
print <<<EOT
-->
				</tr>
			</table>
<script>
	function checkset(tool_msg){
		if(!confirm('使用該道具' +tool_msg+' 確認要使用這個道具？')){
			return false;
		}
	}
</script>
<!--
EOT;
} elseif ($job == 'buy') {print <<<EOT
-->
		<div class="navC mb10">
				<ul id="infolist">
					<li class="current"><a href="profile.php?action=toolcenter">道具交易</a></li>
					<li><a href="profile.php?action=toolcenter&job=mytool">我的道具箱</a></li>
				</ul>
		</div>
		<div class="bdB pb10 mb10 p_lr_10">
			<a class="s5 b" href="profile.php?action=toolcenter">道具商店</a>&nbsp;|&nbsp;<a href="profile.php?action=toolcenter&job=user">二手市場</a>
		</div>
				<form action="profile.php?action=toolcenter&" method="post" onsubmit="return checkSubmit()">
					<input type="hidden" name="job" value="buy" />
					<input type="hidden" name="step" value="2" />
					<input type="hidden" name="id" value="$id" />
					<div class="toolItem" style="margin-bottom:0; border-bottom:none;">
						<table width="100%" cellspacing="0" cellpadding="0" class="vt">
							<tr>
							<td class="toolPic" rowspan="7" width="20%">
<!--
EOT;
if ($rt['logo']) {
print <<<EOT
-->
							<img src="u/images/toolcenter/tool/$rt[logo]" />
<!--
EOT;
} else {print <<<EOT
-->
							<span class="gray">暫無圖片</span>
<!--
EOT;
}print <<<EOT
-->
							</td>
							<th colspan="2" class="f14 s2">$rt[name]</th>
							</tr>
							<tr>
							<th class="tit" width="12%">價格︰</th>
							<td><span class="s1 b">$rt[price]</span> {$credit->cType[$rt[creditype]]}
<!--
EOT;
if ($rt['rmb'] > 0) {
print <<<EOT
-->
							/ <span class="s3">¥$rt[rmb]</span>
<!--
EOT;
}print <<<EOT
-->
							</td>
							</tr>
							<tr><th class="tit">庫存︰</th><td>$rt[stock]</td></tr>
							<tr>
							<th class="tit">功能︰</th>
							<td>$rt[descrip]</td>
							</tr>
							<tr>
							<th class="tit">購買方式︰</th>
							<td id="checkradio">
<!--
EOT;
if ($rt['price'] > 0) {print <<<EOT
-->
							<div class="lh_18"><input type="radio" name="buymethod" value="0" />積分購買 (單價︰<span class="s1 b">$rt[price]</span> {$credit->cType[$rt[creditype]]})</div>
<!--
EOT;
}
if ($rt['rmb'] > 0) {print <<<EOT
-->
							<div class="lh_18"><input type="radio" name="buymethod" value="1" />現金購買 (單價︰<span class="s3">¥$rt[rmb]</span>，通過支付寶交易)</div>
<!--
EOT;
}print <<<EOT
-->
							</td>
							</tr>
							<tr><th class="tit">購買數量︰</th><td><input id="nums" type="text"  class="input" name="nums" value="1" /></td></tr>
							<tr><td colspan="2"><span class="btn2"><span><button type="submit">購買</button></span></span></td></tr>
						</table>
					</div>
					<table width="100%" class="toolInfo">
						<tr><th colspan="2" class="toolTitle">使用積分限制</th></tr>
						<tr><th width="30%">發帖</th><td>{$condition[credit][postnum]}</td></tr>
						<tr><th>精華</th><td>{$condition[credit][digests]}</td></tr>
						<tr><th>{$db_rvrcname}</th><td>{$condition[credit][rvrc]}</td></tr>
						<tr><th>{$db_moneyname}</th><td>{$condition[credit][money]}</td></tr>
						<tr><th>{$db_creditname}</th><td>{$condition[credit][credit]}</td></tr>
<!--
EOT;
foreach ($_CREDITDB as $key => $value) {print <<<EOT
-->
						<tr><th>$value[0]</th><td>{$condition[credit][$key]}</td></tr>
<!--
EOT;
} print <<<EOT
-->
						<tr><td colspan="2" class="toolTitle">用戶組與版塊限制</td></tr>
						<tr>
							<th>允許使用道具的用戶組</th>
							<td>
<!--
EOT;
if ($usergroup) {print <<<EOT
-->
							<table cellspacing="0" cellpadding="0" width="100%"><tr>$usergroup</tr></table>
<!--
EOT;
} else {print <<<EOT
-->
							所有用戶組
<!--
EOT;
}print <<<EOT
-->
							</td>
						</tr>
						<tr>
							<th>允許使用道具的版塊</th>
							<td>
<!--
EOT;
if ($forumcheck) {print <<<EOT
-->
							<table cellspacing="0" cellpadding="0" width="100%"><tr>$forumcheck</tr></table>
<!--
EOT;
} else {print <<<EOT
-->
							所有版塊
<!--
EOT;
}print <<<EOT
-->
							</td>
						</tr>
					</table>
				</form>
<script>
function checkradio() {
	var radio = getObj('checkradio').getElementsByTagName('input');
	if (radio.length > 0) {
		radio[0].checked = true;
	}
}
function checkSubmit() {
	var nums = getObj('nums');
	var re   =  /^[0-9]*[1-9][0-9]*$/;
	if (!re.test(nums.value))
	{
		alert("您輸入的數字為非法數字，請輸入一個大于 “0” 的“整數”");
		nums.focus();
		return false;
	}

	return confirm("該操作將購買該道具 " + getObj('nums').value + " 個，您確定麼？");
}

checkradio();
</script>         
<!--
EOT;
} elseif ($job == 'sell') {print <<<EOT
-->
		<div class="navC mb10">
			<ul id="infolist">
				<li><a href="profile.php?action=toolcenter">道具交易</a></li>
				<li class="current"><a href="profile.php?action=toolcenter&job=mytool">我的道具箱</a></li>
			</ul>
		</div>
		<div class="bdB pb10 mb10 p_lr_10">
			<a class="s5 b" href="profile.php?action=toolcenter&job=mytool">我擁有的</a>&nbsp;|&nbsp;<a href="profile.php?action=toolcenter&job=user&uid=$winduid">我轉讓的</a>
		</div>
<script>
				function checkForm()
				{
					var nums = getObj('nums');
					var re   =  /^[0-9]*[1-9][0-9]*$/;
					if (!re.test(nums.value))
					{
						alert("您輸入的數字為非法數字，請輸入一個大于 “0” 的“整數”");
						nums.focus();
						return false;
					}
				} 
</script>
				<form action="profile.php?action=toolcenter&" method="post" onsubmit="return checkForm()">
					<input type="hidden" name="job" value="sell" />
					<input type="hidden" name="step" value="2" />
					<input type="hidden" name="id" value="$id" />
					<div class="toolItem">
						<table width="100%" cellspacing="0" cellpadding="0" class="vt">
							<tr>
<!--
EOT;
if($rt[logo]){
print <<<EOT
-->
								<td rowspan="3" class="toolPic" width="20%"><img src="u/images/toolcenter/tool/$rt[logo]" /></td>
<!--
EOT;
}
print <<<EOT
-->
								<th width="12%">名稱︰</th><td style="vertical-align:middle">$rt[name]</td>
							</tr>
							<tr>
								<th>轉讓價格︰</th><td style="vertical-align:middle"><input type="text"  class="input" name="price" value="$rt[price]" /> [{$credit->cType[$rt[creditype]]}]</td>
							</tr>
							<tr>
								<th>轉讓數量︰</th><td style="vertical-align:middle"><input type="text"  class="input" name="nums" value="1"  id="nums"/></td>
							</tr>
						</table>
					</div>
					<div class="tac"><span class="btn"><span><button type="submit">轉讓</button></span></span></div>
				</form>             
<!--
EOT;
} elseif ($job == 'use') {print <<<EOT
-->			
		<div class="navC mb10">
			<ul id="infolist">
				<li><a href="profile.php?action=toolcenter">道具交易</a></li>
				<li class="current"><a href="profile.php?action=toolcenter&job=mytool">我的道具箱</a></li>
			</ul>
		</div>
		<div class="bdB pb10 mb10 p_lr_10">
			<a class="s5 b" href="profile.php?action=toolcenter&job=mytool">我擁有的</a>&nbsp;|&nbsp;<a href="profile.php?action=toolcenter&job=user&uid=$winduid">我轉讓的</a>
		</div>
<!--
EOT;
if (!$toolid) {print <<<EOT
-->
                <table width="100%" cellspacing="0" cellpadding="0" align="center">
                <tr>
<!--
EOT;
$num=0;
foreach ($tooldb as $key => $value) {
$id=$value[id];
$num++;
print <<<EOT
-->
                <td width="50%">
                <div class="t" style="margin:0 1px;">
                <table width="100%" cellspacing="0" cellpadding="0">
                <tr>
<!--
EOT;
if ($value[logo]) {print <<<EOT
-->
                <td rowspan="5" width="40%"><a href="profile.php?action=toolcenter&job=buy&id=$id"><img src="u/images/toolcenter/tool/$value[logo]" /></a></td>
<!--
EOT;
}print <<<EOT
-->
                <th colspan="2"><a href="profile.php?action=toolcenter&job=buy&id=$id"><b>$value[name]</b></a></th>
                </tr>
                <tr>
                <td colspan="2">$value[descrip]</td>
                </tr>
                <tr><td width="20%">價格</td><td>$value[price] [{$credit->cType[$value[creditype]]}]
<!--
EOT;
if ($value['rmb'] > 0) {print <<<EOT
-->
                        / <span class="s3">¥$value[rmb]</span>
<!--
EOT;
}print <<<EOT
-->
                </td></tr>
                <tr><td>庫存</td><td>$value[stock]</td></tr>
                <tr><td colspan="2"><a href="profile.php?action=toolcenter&job=buy&id=$id"><img src="u/images/toolcenter/toolbuy.gif" /></a></td></tr>
                </table></div>
                </td>
<!--
EOT;
if($num == 2) {
$num=0;
print <<<EOT
-->
                </tr><tr>
<!--
EOT;
}}print <<<EOT
-->
                </tr>
                </table>              
<script>
function checkset(tool_msg){
	if(!confirm('使用該道具' +tool_msg+'，確認要使用這個道具！')){
		return false;
	}
}
</script>
<!--
EOT;
} elseif ($toolid == 3) {print <<<EOT
-->
        <form action="profile.php?action=toolcenter&job=use&" method="post">
            <input type="hidden" name="tid" value="$tid" />
            <input type="hidden" name="toolid" value="$toolid" />
            <input type="hidden" name="step" value="2" />
            <div class="t" style="margin-top:15px;">
                <table width="100%" cellspacing="0" cellpadding="0" align="center">
                <tr><td class="h b">道具使用</td></tr>
                <tr class="tr1">
                <th>
                <input type="checkbox" name="title2" value="1" /><img src="$imgpath/post/editor/bold.gif" />
                <input type="checkbox" name="title3" value="1" /><img src="$imgpath/post/editor/italic.gif" />
                <input type="checkbox" name="title4" value="1" /><img src="$imgpath/post/editor/underline.gif" />
                <br /><br />
                &nbsp;顏色
                <input name="title1" type="radio" value="" />不使用
                <input name="title1" type="radio" value="red" /><font color="red">紅色</font>
                <input name="title1" type="radio" value="blue" /><font color="blue">藍色</font>
                <input name="title1" type="radio" value="green" /><font color="green">綠色</font>
                <input name="title1" type="radio" value="orange" /><font color="orange">橙色</font>
                <input name="title1" type="radio" value="silver" /><font color="silver">銀色</font>
                </th></tr>
                </table>
            </div>
            <div style="text-align:center;margin-bottom:25px">
                <input class="btn" type="submit" value="提 交" />
            </div>
        </form>

<!--
EOT;
} elseif ($toolid == 8) {print <<<EOT
-->
        <form action="profile.php?action=toolcenter&job=use&" method="post">
            <input type="hidden" name="toolid" value="$toolid" />
            <input type="hidden" name="step" value="2" />
            <div class="t" style="margin-top:15px">
                <table width="100%" cellspacing="0" cellpadding="0">
                <tr><td class="h b" colspan="2">道具使用</td></tr>
                <tr><th width="15%">請輸入新的用戶名</th><td><input type="text"  class="input" name="pwuser" /></td></tr>
                </table>
            </div>
            <div style="text-align:center;margin-bottom:25px">
            	<input class="btn" type="submit" value="提 交" />
            </div>
        </form>
<!--
EOT;
}}} elseif($job == 'ajax') {print <<<EOT
-->


<!--
EOT;
if ($toolid == 3) {print <<<EOT
-->
            <form action="profile.php?action=toolcenter&job=ajax" method="post" onsubmit="return false;">
                <input type="hidden" name="tid" value="$tid" />
                <input type="hidden" name="toolid" value="$toolid" />
                <input type="hidden" name="step" value="2" />
								<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel" onclick="read.close();">close</span><b>道具使用</b></div>
								<div class="p15">
									<p class="mb10">樣式︰
										<label class="mr10"><input type="checkbox" name="title2" value="1" /><img src="$imgpath/post/editor/bold.gif" align="absmiddle" /></label>
										<label class="mr10"><input type="checkbox" name="title3" value="1" /><img src="$imgpath/post/editor/italic.gif" align="absmiddle" /></label>
										<label class="mr10"><input type="checkbox" name="title4" value="1" /><img src="$imgpath/post/editor/underline.gif" align="absmiddle" /></label>
									</p>
                  <p class="mb10">顏色︰
                    <label class="mr10"><input name="title1" type="radio" value="" />不使用</label>
                    <label class="mr10"><input name="title1" type="radio" value="red" /><font color="red">紅色</font></label>
                    <label class="mr10"><input name="title1" type="radio" value="blue" /><font color="blue">藍色</font></label>
                    <label class="mr10"><input name="title1" type="radio" value="green" /><font color="green">綠色</font></label>
                   	<label class="mr10"><input name="title1" type="radio" value="orange" /><font color="orange">橙色</font></label>
                   	<label class="mr10"><input name="title1" type="radio" value="silver" /><font color="silver">銀色</font></label>
									</p>
								</div>
								<div class="popBottom"><span class="btn2"><span><button onclick="ajax.submit(this.form);" type="button">提交</button></span></span></div>
            </form>
<!--
EOT;
} elseif ($toolid == 8) {print <<<EOT
-->
            <form action="profile.php?action=toolcenter&job=ajax&" method="post" onsubmit="return false;">
                <input type="hidden" name="toolid" value="$toolid" />
                <input type="hidden" name="job" value="ajax" />
                <input type="hidden" name="step" value="2" />
                <table width="340" cellspacing="0" cellpadding="0">
                	<tr>
                    	<th class="h" colspan="2" style="cursor:move" onmousedown="read.move(event);"><span class="adel" onclick="read.close();">close</span><b>道具使用</b></th>
                    </tr>
                	<tr>
                	<td width="35%" align="center"> 請輸入新的用戶名︰</td><td><input type="text" class="input" name="pwuser" /></td>
                    </tr>
                </table>
                <ul>
                	<li style="text-align:center;padding:4px 0;"><input type="button" class="btn" onclick="ajax.submit(this.form);" value="提 交" /></li>
                </ul>		
           </form>

<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if (!defined('AJAX')) {print <<<EOT
-->
            </div>
        </div>
<!--
EOT;
require_once uTemplate::printEot('footer');
}
?>-->