<!--<?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;
?>-->