<!--<?php print <<<EOT
-->
<style type="text/css">
.face{margin:0;padding:0;background:$bgcolor}
.face img{border:1px solid $tdcolor;margin:.1em;cursor:pointer}
</style>
<div class="bdbA">
	<div id="breadcrumbs">
		<a class="crumbs-item gray3" href="$db_bfn" title="$db_bbsname">$db_bbsname</a><a class="crumbs-item gray3" href="u.php"><i> </i>用戶中心</a><span class="crumbs-item current"><i> </i><strong>積分管理</strong></span>
	</div>
</div>
<style>
.s3,a.s3{color:#f06f18;}
#set-wrap{width:100%;margin:8px auto 1.5em;line-height:150%}
#set-side{width:170px;float:left}
#set-content{margin-left:173px;_margin-left:170px;background:$bgcolor;}
#set-content-wrap{border:1px solid $tdcolor;padding:1em;}
#set-side-wrap {border:4px solid $tdcolor;background:$bgcolor;}
.set-h2{background:url($imgpath/$stylepath/set-h3.gif) repeat-x;height:30px; line-height:30px;border-bottom:$tdcolor solid 1px;margin:0;padding:0 .6em;font-size:12px;display:block}
.color8{color:#D2C100}
#set-menu{font-size:14px;padding:.6em 0 .6em 1em;margin:0;list-style:none}
#set-menu li{margin:0;padding:.3em 0 0 1.5em;background:url($imgpath/$stylepath/u-fav.gif) no-repeat 0 0.5em;}
#set-menu li a{color:#949494}
#set-menu li.current{background:url($imgpath/$stylepath/u-fav-cur.gif) no-repeat 0 0.5em;}
#set-menu li.current a{color:#707070;font-weight:700}
.set-content-left{margin-right:320px;}
.set-content-right{width:300px;float:right}
.set-table1{line-height:200%}
.set-table1 .tdpr2{padding-right:2em}
#set-content-wrap td{vertical-align:top;}
.set-table2 td{padding:.5em 1em;border-bottom:1px dotted $cbgborder;}
.set-table2 td.td1{text-align:right;padding:.5em 1em;}
.set-tab-table{background:$cbgcolor url($imgpath/$stylepath/set-tab-dot.gif) repeat-x left bottom}
.set-tab-table td{border-bottom:0;padding:.2em 2em;border-right:1px solid $bgcolor;border-left:1px solid $tdcolor}
.set-tab-table td.current{border:1px solid $tdcolor;border-bottom:0;background:$bgcolor}
.set-tab-table td.current a{color:$tablecolor;font-weight:700}
.set-tab-box{border:1px solid $tdcolor;border-top:0;padding:.5em 1em}
textarea{font-size:12px;}
</style>
<div id="set-wrap">
	<div id="set-side">
		<div id="set-side-wrap">
			<h2 class="set-h2"><a href="profile.php" class="color8">設置中心</a> </h2>
			<ul id="set-menu">
				<li id="pro_modify">
					<a href="profile.php?action=modify">編輯資料</a>
				</li>
				<li id="pro_bbsset">
					<a href="profile.php?action=bbsset">論壇設置</a>
				</li>
				<li id="pro_permission">
					<a href="profile.php?action=permission">用戶權限</a>
				</li>
<!--
EOT;
if($_G['atclog']){print <<<EOT
-->
				<li id="pro_log">
					<a href="profile.php?action=log">帖子操作記錄</a>
				</li>
<!--
EOT;
}print <<<EOT
-->
				<li class="current">
					<a href="userpay.php">積分管理</a>
				</li>
				<li id="pro_change">
					<a href="profile.php?action=change">積分轉換</a>
				</li>
				<li id="pro_buy">
					<a href="profile.php?action=buy">特殊組購買</a>
				</li>
<!--
EOT;
if($_G['maxcstyles']){print<<<EOT
-->
				<li id="pro_style">
					<a href="profile.php?action=style">自定義風格</a>
				</li>
<!--
EOT;
}print<<<EOT
-->
			</ul>
		</div>
	</div>
	<div id="set-content">
		<div id="set-content-wrap" class="cc" style="padding:.3em">
			<div>
				<div class="set-tab-table">
					<table border="0" cellspacing="0" cellpadding="0">
						<tr class="tac">
							<td id="pay_begin"><a href="userpay.php">我的賬戶</a></td>
							<td id="pay_buy"><a href="userpay.php?action=buy">充 值</a></td>
							<td id="pay_virement"><a href="userpay.php?action=virement">轉 賬</a></td>
							<td id="pay_list"><a href="userpay.php?action=list">訂單記錄</a></td>
							<td id="pay_log"><a href="userpay.php?action=log">積分日志</a></td>
						</tr>
					</table>
				</div>
<script language="javascript">
var action = "$action";
if (action == 'pay') {
	action = 'buy';
}
setCurrent('pay_'+action,'pay_begin','current');
</script>
				<div class="set-tab-box cc">
					<div style="margin:1em 1em;">
<!--
EOT;
if(!$action){print<<<EOT
-->
						<div style="width:350px; float:right">
							<table width="100%" border="0" cellspacing="0" cellpadding="0" class="set-table1">
								<tr>
									<td class="gray3">未完成訂單</td>
									<td width="25%" class="gray3">日期</td>
								</tr>
<!--
EOT;
foreach($orderdb as $key=>$value){
print<<<EOT
-->
								<tr>
									<td>$value[order_no]</td>
									<td>$value[date]</td>
								</tr>
<!--
EOT;
}
print<<<EOT
-->
								<tr>
									<td></td>
									<td class="tar"><a href="userpay.php?action=list&state=1" class="link5">進入訂單記錄</a></td>
								</tr>
							</table>
						</div>
						<div style="padding-right:350px">
							<div style="width:100%; float:left">
								<table width="100%" border="0" cellspacing="0" cellpadding="0" class="set-table1">
<!--
EOT;
foreach ($credit->cType as $key => $value) {
!isset($creditdb[$key]) && $creditdb[$key] = 0;
print <<<EOT
-->
									<tr>
										<td class="f14 bdbA" style="padding:.5em 0">{$value}: <span class="b f16 s3">$creditdb[$key]</span>
<!--
EOT;
if (isset($db_creditpay[$key])) {print <<<EOT
-->
										<a href="userpay.php?action=buy&paycredit=$key" class="link5 b f12">進入訂單記錄</a><br />
										<span class="gray3 f12">匯率:{$db_creditpay[$key][rmbrate]} {$value} = ¥1 </span>
<!--
EOT;
}print <<<EOT
-->
										</td>
									</tr>
<!--
EOT;
}print <<<EOT
-->
									<!--<tr>
										<td style="padding:1em 0">
											<span>交易幣的作用和充值說明︰</span><br />
											<div style="line-height:150%; padding:1em" class="gray">
												
	1. 論壇{$db_currencyname}可用于購買論壇道具和享受更多論壇功能<br>
	2. 通過網絡支付可對您的{$db_currencyname}帳戶進行充值<br>
	3. 每通過網絡支付 1元， 可獲得論壇{$db_currencyname} {$db_rmbrate} 個<br>
	4. {$db_currencyname}的獲取流程︰進入<a href="userpay.php?action=buy" class="link5 b f12">{$db_currencyname}充值</a>頁面，填寫您要充值的金額，然後提交，程序會自動引導您完成{$db_currencyname}帳戶的充值過程<br>
	5. 通過網絡支付成功後程序將會自動對您論壇帳號進行{$db_currencyname}充值 <br />
											</div>
										</td>
									</tr>-->
								</table>
							</div>
						</div>
<!--
EOT;
}elseif($action=='buy'){print<<<EOT
-->
					<form method="post" action="userpay.php?" target="_blank">
						<input type="hidden" name="action" value="pay" />
						<input type="hidden" name="verify" value="$verifyhash" />
						<table width="100%" cellspacing="0" cellpadding="0" class="set-table2">
							<tr><td class="tal" colspan="3"><b>積分充值過程︰</b><br>
	1. 填寫信息︰進入積分充值頁面，填寫充值金額，並選擇支付方式，提交進入下一步<br>
	2. 生成訂單︰系統自動生成一條充值訂單記錄，等待用戶付款，此時訂單狀態為“<b>未支付訂單</b>”<br>
	3. 用戶付款︰進入付款頁面，當您付款給成功後，訂單信息會變為“<b>已完成訂單</b>”狀態，同時系統會給您的積分帳戶沖入相應的金額</td></tr>
							<tr>
								<td class="td1" width="30%" style="padding:2px 0 2px 5px;">
									請輸入要支付的金額︰<div id="payinfo"></div>
								</td>
								<td>
									<input class="input" type="text" name="number" value="10" size="8" />
									<select name="paycredit" id="paycredit" onchange="payinfo(this.value);">
<!--
EOT;
foreach ($db_creditpay as $key => $value) {
$select = $key == $paycredit ? 'selected' : '';
print <<<EOT
-->
										<option value="$key" {$select}>{$credit->cType[$key]}</option>
<!--
EOT;
}print <<<EOT
-->
									</select>
								</td>
								<td>
									<input type="radio" name="method" value="2" checked /> 支付寶帳號
<!--
EOT;
if($ol_tenpay && $ol_tenpaycode){print <<<EOT
-->
									<input type="radio" name="method" value="4" /> 商戶號
<!--
EOT;
}if($ol_paypal && $ol_paypalcode){print <<<EOT
-->
									<input type="radio" name="method" value="1" /> 貝寶帳號
<!--
EOT;
}if($ol_99bill && $ol_99billcode){print <<<EOT
-->
									<input type="radio" name="method" value="3" /> 快錢支付
<!--
EOT;
}print <<<EOT
-->
								</td>
							</tr>
						</table>
						<div class="tac" style="padding:1em"><input class="btn" type="submit" value="提 交" /></div>
					</form>
<script language="JavaScript">
var creditinfo = $creditinfo;
function payinfo(c) {
	getObj('payinfo').innerHTML = '（最低 ' + creditinfo[c][1] + ' 元人民幣 ）<br />匯率:' + creditinfo[c][0] + ' ' + creditinfo[c][2] + ' = ¥1';
}
payinfo(getObj('paycredit').value);
</script>
				</div>


<!--
EOT;
}elseif($action=='list'){
${'statestyle'.$state} = 'b';
print<<<EOT
-->
						<table width="100%" cellspacing="0" cellpadding="0" class="set-table1">
							<tr><td><b>訂單狀態說明︰</b><br> 1. 未支付訂單︰未充值成功的訂單，用戶尚未付款成功<br> 2. 已完成訂單︰已充值成功的訂單，用戶已經完成付款，{$db_currencyname}充值成功.</td></tr>
						</table>
							<table width="100%" cellspacing="0" cellpadding="0" class="set-table2">
								<tr class="gray3">
									<td class="td1" colspan="6">
										<a class="$statestyle" href="userpay.php?action=list">所有訂單</a> |
										<a class="$statestyle2" href="userpay.php?action=list&state=2">已完成訂單</a> |
										<a class="$statestyle1" href="userpay.php?action=list&state=1">未完成訂單</a>
									</td>
								</tr>
								<tr class="gray3 tac">
									<td>ID</td>
									<td>訂單號</td>
									<td>支付金額</td>
									<td>充值積分</td>
									<td>交易狀態</td>
									<td>交易時間</td>
								</tr>
<!--
EOT;
$id=($page-1)*$db_perpage;
foreach($orderdb as $key => $value){
if($value[state]==0){
$state='未完成訂單';
}elseif($value[state]==1){
$state='已支付訂單，等待用戶確認';
}elseif($value[state]==2){
$state='已完成訂單';
}
$id++;
print <<<EOT
-->
								<tr class="tac">
									<td>$id</td>
									<td>$value[order_no]</td>
									<td>$value[price]</td>
									<td>{$credit->cType[$value[paycredit]]}</tr>
									<td>$state</td>
									<td>$value[date]</td>
								</tr>
<!--
EOT;
}print <<<EOT
-->
								<tr><td colspan="5">$pages</td></tr>
							</table>

<!--
EOT;
}elseif($action=='log'){print<<<EOT
-->
						<script src="js/date.js"></script>
						<form action="userpay.php?action=log" method="post">
						<table width="100%" cellspacing="0" cellpadding="0" class="set-table2">
							<tr><td class="td1">
							積分 <select name="ctype">
									<option></option>
<!--
EOT;
foreach ($credit->cType as $key => $value) {print <<<EOT
-->
									<option value="$key">$value</option>
<!--
EOT;
}print <<<EOT
-->
									</select>
								</td>
								<td class="td1">日期 <input class="input" type="text" name="stime" size="10" id="stime" onclick="ShowCalendar(this.id)" />&nbsp;-&nbsp;<input class="input" type="text" name="etime" size="10" id="etime" onclick="ShowCalendar(this.id)" />
								</td>
								<td class="td1">操作 <select name="logtype">
									<option></option>
<!--
EOT;
foreach($lang['logtype']['creditlog'] as $key => $value){
if(strpos($key,'_') === false){print <<<EOT
-->
									<option value="$key">&#62;&#62; $value</option>
<!--
EOT;
}else{print <<<EOT
-->
									<option value="$key"> &nbsp;|- $value</option>
<!--
EOT;
}}print <<<EOT
-->
									</select>
								</td>
								<td class="td1"><input class="btn" type="submit" value="提 交" /></td>
							</tr>
						</table>
						</form>
						<table width="100%" cellspacing="0" cellpadding="0" class="set-table2">
							<tr class="gray3 tac">
								<td width="8%">ID</td>
								<td width="12%">操作</td>
								<td>積分</td>
								<td>流通值</td>
								<td>描述</td>
								<td width="20%">時間</td>
							</tr>
<!--
EOT;
$id=($page-1)*$db_perpage;
foreach($logdb as $key => $value){
$id++;
print <<<EOT
-->
							<tr class="tac">
								<td>$id</td>
								<td>{$lang[logtype][creditlog][$value[logtype]]}</td>
								<td>{$credit->cType[$value[ctype]]}</td>
								<td>$value[affect]</td>
								<td align="left">$value[descrip]</td>
								<td>$value[adddate]</td>
							</tr>
<!--
EOT;
}print <<<EOT
-->
							<tr><td colspan="6">$pages</td></tr>
						</table>

<!--
EOT;
}elseif($action=='virement'){print<<<EOT
-->
						<form method="post" action="userpay.php?">
							<input type="hidden" name="action" value="virement" />
							<input type="hidden" name="verify" value="$verifyhash" />
							<input type="hidden" name="step" value="2" />
								<table width="100%" cellspacing="0" cellpadding="0" class="set-table2">
									<tr>
										<td class="td1">轉帳手續費</td>
										<td>$db_virerate%</td>
									</tr>
									<tr>
										<td class="td1">轉入用戶名</td>
										<td><input class="input" type="text" name="pwuser" size="20" /></td>
									</tr>
									<tr>
										<td class="td1">轉帳積分名</td>
										<td>
											<select name="vmcredit">
<!--
EOT;
foreach ($vm_credit as $key => $value) {print <<<EOT
-->
												<option value="$value">{$credit->cType[$value]}</option>
<!--
EOT;
}print <<<EOT
-->
											</select>
										</td>
									</tr>
									<tr>
										<td class="td1">轉帳金額數</td>
										<td><input class="input" type="text" name="paynum" size="20" /> <span class="gray3">最低轉帳金額︰{$db_virelimit}</span></td>
									</tr>
									<tr>
										<td class="td1">請輸入密碼</td>
										<td><input class="input" type="password" name="pwpwd" size="20" /></td>
									</tr>
								</table>
							<div class="tac" style="padding:1em"><input class="btn" type="submit" value="提 交" /></div>
						</form>
<!--
EOT;
}elseif($action=='pay' && $method==3){print<<<EOT
-->
						<form action="https://www.99bill.com/gateway/recvMerchantInfoAction.htm" method="POST">
							$inputMsg
							<input type="hidden" name="signMsg" value="$signMsg" />
								<table cellPadding="0" cellSpacing="0" width="100%" class="set-table2">
									<tr><td class="td1">支付方式</td><td>快錢支付</td></tr>
									<tr>
										<td class="td1">訂單號︰</td>
										<td>$order_no</td>
									</tr>
									<tr>
										<td class="td1">購買商品︰</td>
										<td> 購買論壇交易幣</td>
									</tr>
									<tr>
										<td class="td1">總價格︰</td>
										<td><font color="#FF0000"> ¥$number</font></td>
									</tr>
								</table>
							<div class="tac" style="padding:1em"><input class="btn" type="submit" value="提 交" /></div>
						</form>
<!--
EOT;
}print<<<EOT
-->
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!--
EOT;
?>-->