<!--<?php
include_once PrintEot('left');
if ($adminitem == 'userpay'){
if (!$_POST['action']) {
print <<<EOT
-->
<div class="nav3 mb10">
	<ul class="cc">
		<li class="current"><a href="$admin_file?adminjob=userpay&adminitem=userpay">網上支付</a></li>
		<li><a href="$admin_file?adminjob=userpay&adminitem=orderlist">訂單管理</a></li>
	</ul>
</div>
<div class="admin_info mb10">
	<h3 class="h1"><b>提示信息</b></h3>
    <div class="legend"> 
<b>使用網上支付相關說明:</b><ol><li>開啟網上支付功能即被視為接受“phpwind”相關協議，如有任何疑義，請關閉此功能</li>
<li>支付過程出現問題請及時和phpwind 官方取得聯系</li>
<li>因使用網站自身安全原因引起的非法支付phpwind 不負任何責任</li></ol></div>
</div>
<form action="$basename&" method="post">
  <input type="hidden" name="action" value="currrate">
  <h3 class="h1">網上支付設置</h3>
  <div class="admin_table mb10">
      <table width="100%" cellspacing="0" cellpadding="0">
        <tr class="tr1 vt">
          <td class="td1">網上支付功能</td>
          <td class="td2">
           		<div class="list_A list_80">
                    <ul class="cc">
                        <li><input type="radio" name="userpay[ol_onlinepay]" value="1" $onlinepay_Y>開啟</li>
                        <li><input type="radio" name="userpay[ol_onlinepay]" value="0" $onlinepay_N>關閉</li>
                    </ul>
                </div>
            </td>
        </tr>
        <tr class="tr1 vt">
          <td class="td1">網上支付功能關閉原因</td>
          <td class="td2"><textarea name="userpay[ol_whycolse]"  class="textarea">$ol_whycolse</textarea></td>
        </tr>
    </table>
  </div>
  <h3 class="h1">支付寶信息</h3>
  <div class="admin_table mb10">
      <table width="100%" cellspacing="0" cellpadding="0">
        <tr class="tr1 vt">
          <td class="td1">支付寶帳號</td>
          <td class="td2" width="160"><input type="text" class="input input_wa" name="userpay[ol_payto]" value="$ol_payto"></td>
          <td class="td2"><a href="https://www.alipay.com/user/user_register.htm" target="_blank" >請點擊這里注冊 <span class="xia">支付寶</span> 帳號</a></td>
        </tr>
        <tr class="tr1 vt">
          <td class="td1">合作者身份(partnerID)</td>
          <td class="td2"><input type="text" class="input input_wa" name="userpay[ol_alipaypartnerID]" value="$ol_alipaypartnerID"></td>
          <td class="td2"><a href="http://act.life.alipay.com/systembiz/PW" target="_blank">簽約地址</a> (您可以通過 phpwind 提供的簽約入口來免費獲得一個支付寶的合作者身份ID，擁有該ID，您可以在支付寶網站上查詢到該ID產生的所有交易歷史。如果您沒有簽約或者簽約合同尚未生效，將無法正常使用支付寶虛擬交易支付接口)</td>
        </tr>
        <tr class="tr1 vt">
          <td class="td1">交易安全校驗碼(key)</td>
          <td class="td2"><input type="text" class="input input_wa" name="userpay[ol_alipaykey]" value="$ol_alipaykey" size="50" /></td>
          <td class="td2">您可以登錄您的支付寶賬號頁面，進入“商家服務”查看您的“交易安全校驗碼”</p></td>
        </tr>
     </table>
   </div>
   <h3 class="h1">財付通信息</h3>
    <div class="admin_table mb10">
      <table width="100%" cellspacing="0" cellpadding="0">
        <tr class="tr1 vt">
          <td class="td1">商戶號</td>
          <td class="td2" width="160"><input type="text" class="input input_wa" name="userpay[ol_tenpay]" value="$ol_tenpay"></td>
           <td class="td2"><a href="http://union.tenpay.com/mch/mch_register.shtml?posid=125&actid=84&opid=50&whoid=31&sp_suggestuser=AD125"  >點擊這里申請 <span class="xia">財付通</span> 商戶帳號</a></td>
        </tr>
        <tr class="tr1 vt">
          <td class="td1">商戶密鑰</td>
          <td class="td2"><input type="text" class="input input_wa" name="userpay[ol_tenpaycode]" value="$ol_tenpaycode"></td>
          <td class="td2">&nbsp;</td>
        </tr>
       </table>
     </div>
     <h3 class="h1">貝寶信息</h3>
     <div class="admin_table mb10">
      <table width="100%" cellspacing="0" cellpadding="0">
        <tr class="tr1 vt">
          <td class="td1">貝寶帳號</td>
          <td class="td2" width="160"><input type="text" class="input input_wa" name="userpay[ol_paypal]" value="$ol_paypal"></td>
          <td class="td2"><a href="https://www.paypal.com/cn/cgi-bin/webscr?cmd=_registration-run" target="_blank" >注冊 <span class="xia">貝寶</span> 帳號</a></td>
        </tr>
        <tr class="tr1 vt">
          <td class="td1">貝寶公共密鑰</td>
          <td class="td2"><input type="text" class="input input_wa" name="userpay[ol_paypalcode]" value="$ol_paypalcode" size="50"></td>
          <td class="td2">&nbsp;</td>
        </tr>
       </table>
      </div>
      <h3 class="h1">快錢信息</h3>
      <div class="admin_table mb10">
      <table width="100%" cellspacing="0" cellpadding="0">
        <tr class="tr1 vt">
          <td class="td1">商戶編號</td>
          <td class="td2" width="160"><input type="text" class="input input_wa" name="userpay[ol_99bill]" value="$ol_99bill"></td>
          <td class="td2"><a href="https://www.99bill.com/mbrentry/signup/bzsignuppage.htm" target="_blank" >注冊 <span class="xia">快錢</span> 帳號</a></td>
        </tr>
        <tr class="tr1 vt">
          <td class="td1">快錢密鑰</td>
          <td class="td2"><input type="text" class="input input_wa" name="userpay[ol_99billcode]" value="$ol_99billcode"></td>
          <td class="td2">&nbsp;</td>
        </tr>
        </table>
       </div>
  <div class="mb10 tac"><span class="btn"><span><button type="submit">提 交</button></span></span></div>
</form>
<div class="mb10">
	<h3 class="h1">具體步驟</h3>
    <div class="legend">
    <b>（一）開通支付寶支付步驟:</b><ol><li>
如果您已經擁有一個支付寶帳號，在下面“支付寶帳號”欄填寫您的支付寶帳號即可開通支付寶支付功能</li><li>
如果您還沒有支付寶帳號，請先注冊一個支付寶帳號，


<a href="https://www.alipay.com/user/user_register.htm" target="_blank" style="margin-left:1em;">請點擊這里注冊 <span class="xia">支付寶帳號</span></a></li></ol>

<br />注:除官方論壇另行通知以外，phpwind 提供的支付寶支付服務每筆交易收取 1.5% 的手續費。<br /> 
  	<b>（二）開通財付通支付步驟:</b><ol><li>申請財付通商戶帳號，<a href="http://union.tenpay.com/mch/mch_register.shtml?posid=125&actid=84&opid=50&whoid=31&sp_suggestuser=AD125"><span class="xia">點
擊這里申請財付通商戶帳號</span></a>
</li><li>申請成功後將商戶號和商戶密鑰填入下面對應的文本框</li></ol><br /> 
  	<b>（三）開通貝寶支付步驟:</b><ol><li>注冊一個貝寶帳號，

<a href="https://www.paypal.com/cn/cgi-bin/webscr?cmd=_registration-run" target="_blank">注冊 <span class="xia">貝寶帳號</span></a></li><li>將貝寶帳號填寫到下面對應的文本框</li><li>開啟貝寶“即時付款通知”<br />
&nbsp;&nbsp; 登錄貝寶網站:進入 我的貝寶 &raquo; 用戶信息 &raquo; 即時付款通知習慣設定 &raquo; 編輯 開啟“即時付款通知”並填寫“通知URL”<br />
&nbsp;&nbsp; 通知URL是 您的站點網址 + '/paypal.php?verifycode=' + 貝寶公共密鑰<br />
&nbsp;&nbsp; 格式如:<font color=blue>http://www.phpwind.net/paypal.php?verifycode=貝寶公共密鑰</font></li></ol><br />
  	<b>（四）開通快錢支付步驟:</b><ol><li>注冊一個快錢帳號，
<a href="https://www.99bill.com/webapp/jsp/AccountManage/accountRegAction.do?cmd=initializtion&genID=php3" target="_blank" style="margin-left:1em;">注冊 <span class="xia">快錢</span> 帳號</a>
</li><li>將“快錢商戶號”和“快錢密鑰”填入下面相應的文本框中</li></ol>
  </div>
</div>
<!--
EOT;
}}elseif ($adminitem =='orderlist'){
$stateClass = $stateClass1 = $stateClass2 = '';
if ($state) {
	${"stateClass$state"} = ' style="text-decoration:underline"';
} else {
	$stateClass = ' style="text-decoration:underline"';
}
if(!$action){print <<<EOT
-->
<div class="nav3 mb10">
	<ul class="cc">
		<li><a href="$admin_file?adminjob=userpay&adminitem=userpay">網上支付</a></li>
		<li class="current"><a href="$admin_file?adminjob=userpay&adminitem=orderlist">訂單管理</a></li>
	</ul>
</div>
<h2 class="h1">搜索</h2>
<form action="{$basename}&action=pay" method="post">
  <div class="admin_table mb10">
    <table cellpadding="0" cellspacing="0" width="100%">
      <tr class="tr1 vt">
        <td class="td1">訂單號</td>
        <td class="td2"><input type="text" name="order" class="input input_wa mr5"  />
          <span class="bt2"><span><button type="submit" value="提 交">提 交</button></span></span></td>
      </tr>
    </table>
  </div>
</form>
<form action="$basename&" method="post" id="oderList">
  <input type="hidden" name="action" value="del">
  <h2 class="h1"><span class="mr20">訂單管理</span><span class="linka"><a href="$basename"$stateClass>所有訂單</a>&nbsp;|&nbsp; <a href="$basename&state=2"$stateClass2>已完成訂單</a>&nbsp;|&nbsp; <a href="$basename&state=1"$stateClass1>未完成訂單</a></span></h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2 vt td_bgB">
	  <td width="30"><span onclick="CheckAll(document.getElementById('oderList'))" class="cp">全選</span></td>
      <td>用戶名</td>
      <td>訂單類型</td>
      <td>付款帳號</td>
      <td>支付金額</td>
      <td>交易狀態</td>
      <td>交易時間</td>
      <td></td>
    </tr>
<!--
EOT;
if (empty($orderdb)) {print <<<EOT
-->
<tr><td class="p10" colspan="8"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
}else{
$order_lang = array('積分充值','道具購買','版塊權限購買','特殊組購買','注冊碼購買');
foreach($orderdb as $key => $value){
if($value[state]==0){
$state='<span class=s1>未完成</span>';
}elseif($value[state]==1){
$state='<span class=s2>已支付，等待用戶確認</span>';
}elseif($value[state]==2){
$state='<span class=s3>已完成</span>';
}
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2"><input type="checkbox" name="selid[]" value="$value[id]"></td>
      <td class="td2">$value[username]</td>
      <td class="td2">{$order_lang[$value[type]]}</td>
      <td class="td2">$value[payemail]</td>
      <td class="td2">$value[fee]</td>
      <td class="td2">$state</td>
      <td class="td2">$value[date]</td>
      <td class="td2"><a href="$basename&action=pay&id=$value[id]">詳情</a></td>
    </tr>
<!--
EOT;
}}print <<<EOT
-->
  </table>
  </div>
  <div class="cc mb10">$pages</div>
  <div class="mb10 tac">
	<span class="bt"><span><button type="button" onclick="CheckAll(document.getElementById('oderList'))">全 選</button></span></span>
    <span class="btn"><span><button type="submit" name="hello">刪除</button></span></span>
  </div>
</form>

<!--
EOT;
}elseif($action=='pay'){print <<<EOT
-->
<div class="admin_info mb10">
    <h2 class="h1">完成支付說明</h2>
    <div class="legend">
    <ol>
        <li>由于支付寶系統在傳輸支付狀態的過程可能會出現一些不可預料的問題，導致用戶實際已經支付成功，但交易幣沒有充值成功~</li>
        <li>請核對訂單信息後將付款帳號填入下方對應的文本框內，再使用“完成充值”功能完成本次訂單的充值</li>
    </ol>
    </div>
</div>
<form action="$basename&" method="post">
  <input type="hidden" name="action" value="pay">
  <input type="hidden" name="step" value="2">
  <input type="hidden" name="id" value="$rt[id]">
  <h2 class="h1">訂單信息</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">訂單號</td>
      <td class="td2">$rt[order_no]</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">用戶名</td>
      <td class="td2">$rt[username] (uid:$rt[uid])</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">支付金額</td>
      <td class="td2"><font color="orange">¥$rt[fee]</font></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">付款帳號</td>
      <td class="td2">
<!--
EOT;
if ($rt['state'] == '2') {print <<<EOT
-->
        $rt[payemail]
<!--
EOT;
} else {print <<<EOT
-->
        <input type="text"  class="input input_wa" name="payemail" />
<!--
EOT;
}print <<<EOT
-->
      </td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">交易狀態</td>
      <td class="td2">
<!--
EOT;
$order_lang = array('積分充值','道具購買','版塊權限購買','特殊組購買','注冊碼購買');
if ($rt['state'] == '2') {print <<<EOT
-->
        已完成訂單
<!--
EOT;
} else {print <<<EOT
-->
        未支付訂單
<!--
EOT;
}print <<<EOT
-->
      </td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">訂單類型</td>
      <td class="td2"><span class="mr20">{$order_lang[$rt[type]]}</span>$detail</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">交易時間</td>
      <td class="td2">$rt[date]</td>
    </tr>
  </table>
 </div>
<!--
EOT;
if ($rt['state'] < 2) {print <<<EOT
-->
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit" value="完成充值">完成充值</button></span></span>
  </div>
<!--
EOT;
}}print <<<EOT
-->
</form>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->
