<!--<?php
if ($action == 'buy') {print <<<EOT
-->
<style type="text/css">
.read_buy .tr3 td,.read_buy .tr3 th{padding-left:10px;border-bottom:0;}
</style>
<div id="breadCrumb">
<img src="$imgpath/$stylepath/thread/home.gif" class="breadHome" /><em class="breadEm"></em><a href="$db_bfn" title="$db_bbsname">$db_bbsname</a><em>&gt;</em>商品購買<em>&gt;</em><a href="read.php?tid=$tid">$trade[name]</a>
</div>
<form action="trade.php?action=buy" method="post">
<input type="hidden" name="step" value="3" />
<input type="hidden" name="tid" value="$tid" />
<div class="t">
<div class="h b" style="border-top:0;">確認商品交易</div>
<table width="100%" class="read_buy vt">
	<tr class="tr3">
		<th style="width:100px">商品名稱:</th>
		<td class="s8"><span class="mr10">$trade[name]</span><a href="read.php?tid=$tid" class="s4"  target="_blank">[查看原帖]</a></td>
	</tr>
	<tr class="tr3 f_two">
		<th>當前價格:</th>
		<td>$trade[costprice]</td>
	</tr>
	<tr class="tr3">
		<th>所 在 地:</th>
		<td>$trade[locus]</td>
	</tr>
	<tr class="tr3 f_two">
		<th>賣　　家:</th>
		<td><a href="apps.php?q=article&a=goods&uid=$trade[uid]">$trade[username]</a></td>
	</tr>
	<tr class="tr3">
		<th>收貨地址:</th>
		<td><input type="text" class="input input_wb" name="address" /></td>
	</tr>
	<tr class="tr3 f_two">
		<th>郵政編碼:</th>
		<td><input type="text" class="input input_wa" name="zip" /></td>
	</tr>
	<tr class="tr3">
		<th>收 貨 人:</th>
		<td><input type="text" class="input input_wa" name="consignee" /></td>
	</tr>
	<tr class="tr3 f_two">
		<th>聯系電話:</th>
		<td><input type="text" class="input input_wa" name="tel" /></td>
	</tr>
	<tr class="tr3">
		<th>購買數量:</th>
		<td><input type="text" class="input input_wa" name="quantity" value="1" /></td>
	</tr>
<!--
EOT;
if ($trade['transport']) {print <<<EOT
-->
	<tr class="tr3 f_two">
		<th>運送方式:</th>
		<td>
			<label class="mr20"><input type="radio" name="transport" value="1" checked/> 平郵:$trade[mailfee] 元</label>
			<label class="mr20"><input type="radio" name="transport" value="2" /> 快遞:$trade[expressfee] 元</label>
			<label class="mr20"><input type="radio" name="transport" value="3" /> EMS︰$trade[emsfee] 元</label>如果沒有運費發生，您可以在拍下該商品後，要求賣家修改運費
		</td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
	<tr class="tr3">
		<th>給賣家留言:</th>
		<td><textarea name="descrip" class="textareaA"></textarea></td>
	</tr>
	<tr class="tr3">
		<td>&nbsp;</td>
		<td style="padding:10px 7px;"><span class="btn"><span><button type="submit">確認無誤，購買</button></span></span></td>
	</tr>
</table>
</div>
</form>
<!--
EOT;
} elseif ($action == 'order') {print <<<EOT
-->
<style type="text/css">
.read_buy .tr3 td,.read_buy .tr3 th{padding-left:10px;border-bottom:0;}
</style>
<div id="breadCrumb">
<img src="$imgpath/$stylepath/thread/home.gif" class="breadHome" /><em class="breadEm"></em><a href="$db_bfn" title="$db_bbsname">$db_bbsname</a><em>&gt;</em>訂單詳細信息
</div>
<div class="t">
<div class="h b" style="border-top:0;">訂單詳細信息</div>
<table width="100%" class="read_buy">
	<tr class="tr3"><td width="100" class="f14 b">訂單商品信息</td><td>&nbsp;</td></tr>
	<tr class="tr3 f_two">
		<th>商品名稱:</th>
		<td><a href="read.php?tid=$order[tid]">$order[subject]</a></td>
	</tr>
	<tr class="tr3">
		<th>購買數量:</th>
		<td>$order[quantity]</td>
	</tr>
	<tr class="tr3 f_two">
		<th>商品單價:</th>
		<td>$order[price]</td>
	</tr>
	<tr class="tr3">
		<th>購買日期:</th>
		<td>$order[buydate]</td>
	</tr>
	<tr class="tr3 f_two">
		<th>賣　　家:</th>
		<td><a href="apps.php?q=article&a=goods&uid=$order[uid]">$order[username]</a></td>
	</tr>
	<tr class="tr3">
		<th>備　　注:</th>
		<td>$order[descrip]</td>
	</tr>
	<tr class="tr3 f_two"><td class="f14 b">商品物流信息</td><td></td></tr>
	<tr class="tr3">
		<th>運費方式:</th>
		<td>
<!--
EOT;
if ($order['transport'] && $order['transportfee']) {
$o_lang = array('1' => '平郵', '2' => '快遞', '3' => 'EMS');
print <<<EOT
-->
			{$o_lang[$order[transport]]} $order[transportfee]
<!--
EOT;
} else {print <<<EOT
-->
			賣家承擔
<!--
EOT;
}print <<<EOT
-->
		</td>
	</tr>
	<tr class="tr3 f_two">
		<th>收貨地址:</th>
		<td>$order[address]</td>
	</tr>
	<tr class="tr3">
		<th>收 貨 人:</th>
		<td>$order[consignee]</td>
	</tr>
	<tr class="tr3 f_two">
		<th>聯系電話:</th>
		<td>$order[tel]</td>
	</tr>
	<tr class="tr3"><td class="f14 b">總金額及支付</td><td></td></tr>
	<tr class="tr3 f_two">
		<th>總金額:</th>
		<td>$order[price] * $order[quantity] + $order[transportfee] = $totalpay</td>
	</tr>
	<tr class="tr3 vt">
		<th>交易狀態:</th>
		<td>
<!--
EOT;
if ($order['ifpay'] == 4) {print <<<EOT
-->
			<div class="s1">交易失敗</div>
<!--
EOT;
} elseif ($order['ifpay'] == 3) {print <<<EOT
-->
			<div class="s3">交易完成</div>
<!--
EOT;
} elseif ($order['ifpay'] == 2) {print <<<EOT
-->
			<div class="s2 mb5">賣家已發貨，確認收貨</div>
<!--
EOT;
if ($order['buyer'] == $winduid) {
if ($order['payment'] == 1) {print <<<EOT
-->
			<div style="padding-bottom:20px;"><!--賣家已發貨，以下是發貨信息:--><div style="border:1px solid #ccc;width:400px;padding:5px" class="mb15">$order[tradeinfo]<br />發貨時間:$order[tradedate]</div>
			<!--請于收到貨後，確認收貨<br /><br />-->
				<form action="trade.php?action=get&oid=$oid" method="post">
					<div><span class="btn"><span><button type="submit">確認收貨</button></span></span></div>
				</form>
			</div>
<!--
EOT;
} elseif ($order['payment'] == 2) {print <<<EOT
-->
			<div style="padding-bottom:20px;"><b>賣家已發貨，請于收到貨後，<a href="http://www.alipay.com">到支付寶確認收貨</a></b><br /><br />
				如果您的支付寶狀態已經更改，但站點狀態還沒有修改，您也可以手動確認
				<form action="trade.php?action=get&oid=$oid" method="post" onsubmit="if(confirm('確定收到貨了嗎?')){ return true;} else {return false;}">
					<div><span class="btn"><span><button type="submit">確認收貨</button></span></span></div>
				</form>
			</div>
<!--
EOT;
}}} elseif ($order['ifpay'] == 1) {print <<<EOT
-->
			<div class="s4 mb5">買家已付款，等待賣家發貨</div>
<!--
EOT;
if ($order['seller'] == $winduid) {
if ($order['payment'] == 1) {print <<<EOT
-->
			<div style="padding-bottom:20px;">
			該買家使用線下交易方式付款，以下是付款信息:<div style="margin:5px 0;border:1px solid #ccc;width:400px;padding:5px">$order[tradeinfo]</div>
				請核對信息後，盡快發貨<br /><br />
				<form action="trade.php?action=send&oid=$oid" method="post">
					<p class="mb10">物流公司: <input type="text" name="logistics" class="input" /></p>
					<p class="mb15">物流單號: <input type="text" name="orderid" class="input" /></p>
					<div><span class="btn"><span><button type="submit">確認發貨</button></span></span></div>
				</form>
			</div>
<!--
EOT;
} elseif ($order['payment'] == 2) {print <<<EOT
-->
			<div>該買家使用支付寶線上付款，<a href="http://www.alipay.com">您可以馬上發貨，並到支付寶更新狀態</a></div>
<!--
EOT;
}}} elseif ($order['ifpay'] == 0) {print <<<EOT
-->
			<div class="s1 mb5">等待買家付款</div>
<!--
EOT;
if ($winduid == $order['buyer']) {
if ($order['paymethod'] & 1) {print <<<EOT
-->
			<div style="width:350px;float:left">線下交易 (請輸入您的付款信息，以便賣家確認) <br />
				<form action="trade.php?action=pay&oid=$oid&method=1" method="post">
				<p class="mb15"><textarea name="tradeinfo" style="width:250px;height:50px"></textarea></p>
				<div><span class="btn"><span><button type="submit">提 交</button></span></span></div>
				</form>
			</div>
<!--
EOT;
}if ($order['paymethod'] & 2) {print <<<EOT
-->
			<div style="float:left">在線支付 <br /><a href="trade.php?action=pay&oid=$oid&method=2"><img src="$imgpath/post/alipay.gif" /></a></div>
<!--
EOT;
}}}print <<<EOT
-->
		</td>
	</tr>
</table>
</div>
<!--
EOT;
}?>-->