<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<link rel="stylesheet" type="text/css" href="{$vd['sc']}css/main.css"/>

</head>
<body>
<div id="titleDiv">
<div style="float:left"><a href="index.php?a=Home"><img src="{$vd['sc']}images/home.png" style="vertical-align:middle" border="0"/></a></div><div style="float:left;padding-top:8px;padding-left:3px;"><a href="index.php?a=Home" title="回到后台首页"><font color="#000">桌面</font></a> <span style="font-size:7px;">>></span> <span style="font-size:12px;">支付网关管理</span></div>
<div style="float:right;"><a href="index.php?m=mod_home&a=Help&t=admin_b2b_paymen_indext" onFocus="this.blur()" title="查看银行网关相关帮助"><img src="{$vd['sc']}images/help.gif" style="vertical-align:middle" border="0"/></a></div>
</div>
<div id="contentTip" style="display:none;"></div>
<div id="content" class="cwarpper">
<div class="cbodyHead"></div>
<div class="cwarpper1">
<div class="ctitle">
  支付网关
  <strong onmouseover="showhide(this);" onmouseout="showhide(this);" style="cursor:pointer">[?]</strong><p style="display:none">
    支付网关：是用户使用网上银行进行付款的一个接口<br/>
    国内有多家支付网关公司，您只需要和其它一家公司申请接口，就可以让您的客户实现网上银行支付功能<br/>目前国内大部分银行，任何一个支付网关基本都支持，具体您可以和支付网关公司的客服进行咨询<br/>
    <br/>默认：前台网上银行充值的地方，通过各商业银行付款时使用的网关，目前支持财付通和支付宝<br/>
    <br/>各网关地址：<br/>
    财付通：http://mch.tenpay.com 请申请即时到帐交易<br/>
    支付宝：http://www.alipay.com 请申请即时到帐交易<br/>
    贝宝：http://www.paypal.com <br/>
    易宝：http://www.yeepay.com <br/>
    网银中国：http://www.chinabank.com.cn <br/>
    云网支付：http://www.cncard.net <br/>
  </p>
</div>
<?php
$yeepay_frd = array(
array('code'=>'','name'=>'所有卡种(包括银行卡)'),
array('code'=>'SZX-NET','name'=>'神州行'),
array('code'=>'UNICOM-NET','name'=>'联通卡'),
array('code'=>'QQCARD-NET','name'=>'Q币支付'),
array('code'=>'SNDACARD-NET','name'=>'盛大卡'),
array('code'=>'JUNNET-NET','name'=>'骏网一卡通'),
array('code'=>'ZHENGTU-NET','name'=>'征途卡'),
array('code'=>'YPCARD-NET','name'=>'易宝一卡通'),
array('code'=>'LIANHUAOKCARD-NET','name'=>'联华OK卡')
);
?>
<div id="notalipay">
  <form name="form1" method="post" action="index.php?m=mod_b2b&c=Payment&a=Create" id="cform">
  <table border="1" class="ctable" bordercolor="#ededed">
    <tr>
      <td align="center" height="35" colspan="2" class="listhead" style="text-align:left;font-weight:bold;font-size:16px;padding-left:10px;color:#ff0000">
      <img src="{$vd['sc']}images/add.gif" style="vertical-align:middle" border="0"/> 添加网关
      </td>
    </tr>
    <tr>
      <td class="buylt"><div align="center">网关</div></td>
      <td class="buyrt">
        <select size="1" id="thispaytype" name="paytype" onchange="set(this)">
          <option value="chinabank|网银中国">网银中国</option>
          <option value="tenpay|财付通">财付通</option>
          <option value="alipay|支付宝">支付宝</option>
          <option value="paypal|贝宝">贝宝</option>
          <option value="yeepay|易宝">易宝</option>
          <option value="cncard|云网支付">云网支付</option>
          <option value="paydollar|paydollar支付">paydollar</option>
        </select>
      </td>
    </tr>
    <tr>
      <td class="buylt"><div align="center">商户</div></td>
      <td class="buyrt"><input name="paymerchant" type="text" style="width:160px;"></td>
    </tr>
    <tr>
      <td class="buylt"><div align="center">密钥</div></td>
      <td class="buyrt"><input name="paykey" type="text" style="width:160px;"></td>
    </tr>
    <tr id="othertr" style="display:none">
      <td class="buylt"><div align="center">支付通道</div></td>
      <td class="buyrt">
        <select size="1" name="other">
          {#Option($yeepay_frd, '', 'name', 'code')}
        </select>
      </td>
    </tr>
    <tr>
      <td class="buylt"><div align="center">手续费</div></td>
      <td class="buyrt"><input name="payfee" type="text" style="width:30px;"> <b>%</b></td> 
    </tr>
    <tr>
      <td class="buylt"><div align="center">使用</div></td>
      <td class="buyrt"><input name="payopen" type="checkbox" value="1" class="checkbox" onFocus="this.blur()"></td>
    </tr>
    <tr>
      <td class="buylt"><div align="center">默认</div></td>
      <td class="buyrt"><input name="isdefault" type="checkbox" value="1" class="checkbox" onFocus="this.blur()"></td>
    </tr>
    <tr>
      <td class="buylt"><div align="center"></td>
      <td class="buyrt">
        <input type="submit" name="Submit" value="添 加 &gt;&gt;" class="button">
        <input type="reset"   value="重 填 &gt;&gt;" class="button"/>
      </td>
    </tr>
  </table>
  </form>
  </div>
  
  <div id="alipay" style="display:none">
  <form name="form1" method="post" action="index.php?m=mod_b2b&c=Payment&a=Create">
  <table border="1" class="ctable" bordercolor="#ededed">
    <tr>
      <td align="center" height="35" colspan="2" class="listhead" style="text-align:left;font-weight:bold;font-size:16px;padding-left:10px;color:#ff0000">
      <img src="{$vd['sc']}images/add.gif" style="vertical-align:middle" border="0"/> 添加网关
      </td>
    </tr>
    <tr>
      <td class="buylt"><div align="center">网关</div></td>
      <td class="buyrt">
        <select size="1" id="alipaytype" name="paytype" onchange="set(this)">
          <option value="chinabank|网银中国">网银中国</option>
          <option value="tenpay|财付通">财付通</option>
          <option value="alipay|支付宝">支付宝</option>
          <option value="paypal|贝宝">贝宝</option>
          <option value="yeepay|易宝">易宝</option>
          <option value="cncard|云网支付">云网支付</option>
          <option value="paydollar|paydollar支付">paydollar</option>
        </select>
      </td>
    </tr>
    <tr>
      <td class="buylt"><div align="center">支付宝帐户</div></td>
      <td class="buyrt"><input name="paymerchant" type="text" style="width:160px;"></td>
    </tr>
    <tr>
      <td class="buylt"><div align="center">安全检验码(key)</div></td>
      <td class="buyrt"><input name="paykey" type="text" style="width:160px;"></td>
    </tr>
    <tr>
      <td class="buylt"><div align="center">合作者身份(PID)</div></td>
      <td class="buyrt"><input name="other" type="text" style="width:160px;"></td>
    </tr>
    <tr>
      <td class="buylt"><div align="center">手续费</div></td>
      <td class="buyrt"><input name="payfee" type="text" style="width:30px;"> <b>%</b></td>
    </tr>
    <tr>
      <td class="buylt"><div align="center">使用</div></td>
      <td class="buyrt"><input name="payopen" type="checkbox" value="1" class="checkbox" onFocus="this.blur()"></td>
    </tr>
    <tr>
      <td class="buylt"><div align="center">默认</div></td>
      <td class="buyrt"><input name="isdefault" type="checkbox" value="1" class="checkbox" onFocus="this.blur()"></td>
    </tr>
    <tr>
      <td class="buylt"><div align="center"></td>
      <td class="buyrt">
        <input type="submit" name="Submit" value="添 加 &gt;&gt;" class="button">
        <input type="reset"   value="重 填 &gt;&gt;" class="button"/>
      </td>
    </tr>
  </table>
  </form>
  </div>   
<!--foreach($vd['payment'] as $pay) {-->
<!--if($pay['payType'] == '支付宝'){-->
<form name="form1" method="post" action="index.php?m=mod_b2b&c=Payment&a=Update&id={$pay['id']}">
<table border="1" class="ctable" bordercolor="#ededed">
  <tr>
    <td align="center" height="35" colspan="2" class="listhead" style="text-align:left;font-weight:bold;font-size:16px;padding-left:10px;color:#ff0000">
      <span style="float:right;"><a href="index.php?m=mod_b2b&c=Payment&a=Del&id={$pay['id']}" title="删除" onClick="return confirm('您确定要删除此网关吗？')">
        <img src="{$vd['sc']}images/icon_trash.gif" border="0"/>
      </a>
      </span>支付宝
      <input type="hidden" name="paytype" value="{$pay['paycode']}|{$pay['payType']}"/>
    </td>
  </tr>
  <tr> 
    <td class="buylt">
      <div align="center">支付宝帐户</div>
    </td>
    <td class="buyrt">
      <input name="paymerchant" type="text" style="width:160px;" value="{$pay['payMerchant']}">
    </td>
  </tr>
  <tr>
    <td class="buylt"> 
      <div align="center">安全检验码(key)</div>
    </td>
    <td class="buyrt"> 
      <input name="paykey" type="password" style="width:160px;" value="{$pay['payKey']}">
    </td>
  </tr>
  <tr>
    <td class="buylt"> 
      <div align="center">合作者身份(PID)</div>
    </td>
    <td class="buyrt"> 
      <input name="other" type="password" style="width:160px;" value="{$pay['other']}">
    </td>
  </tr>
  <tr> 
    <td class="buylt"> 
      <div align="center">手续费</div>
    </td>
    <td class="buyrt"> 
      <input name="payfee" type="text" size="10" style="width:30px" value="<!--echo $pay['payfee'] * 100;-->"> <b>%</b>
    </td>
  </tr>
  <tr> 
    <td class="buylt"> 
      <div align="center">使用</div>
    </td>
    <td class="buyrt"> 
      <input name="payopen" type="checkbox" class="checkbox" value="1" onFocus="this.blur()" <!--if($pay['payOpen'] == '1'){--> checked <!--}-->/>
    </td>
  </tr>
  <tr>
    <td class="buylt"><div align="center">默认</div></td>
     <td class="buyrt"><input name="isdefault" type="checkbox" value="1" class="checkbox" onFocus="this.blur()" <!--if($pay['isdefault'] == '1'){--> checked <!--}-->></td>
  </tr>
  <tr>
    <td class="buylt" height="50px"></td>
    <td class="buyrt"><input type="submit" value="确认修改" class="button"/> <input type="reset" value="重新填写" class="button"/></td>
  </tr>
</table>
</form>
<!--}else{-->
<form name="form1" method="post" action="index.php?m=mod_b2b&c=Payment&a=Update&id={$pay['id']}">
<table border="1" class="ctable" bordercolor="#ededed">
  <tr>
    <td align="center" height="35" colspan="2" class="listhead" style="text-align:left;font-weight:bold;font-size:16px;padding-left:10px;color:#ff0000">
      <span style="float:right;"><a href="index.php?m=mod_b2b&c=Payment&a=Del&id={$pay['id']}" title="删除" onClick="return confirm('您确定要删除{$pay['payType']}网关吗？')">
        <img src="{$vd['sc']}images/icon_trash.gif" border="0"/>
      </a>
      </span>
      <!-- echo $pay['payType'];-->
      <input type="hidden" name="paytype" value="{$pay['paycode']}|{$pay['payType']}"/>
    </td>
  </tr>
  <tr> 
    <td class="buylt">
      <div align="center">商户</div>
    </td>
    <td class="buyrt">
      <input name="paymerchant" type="text" style="width:160px;" value="{$pay['payMerchant']}">
    </td>
  </tr>
  <tr>
    <td class="buylt"> 
      <div align="center">密钥</div>
    </td>
    <td class="buyrt"> 
      <input name="paykey" type="password" style="width:160px;" value="{$pay['payKey']}">
    </td>
  </tr>
  <tr id="othertr" style="<!--if($pay['paycode'] != 'yeepay'){-->display:none<!--}-->">
    <td class="buylt"><div align="center">支付通道</div></td>
    <td class="buyrt">
      <select size="1" name="other">
        {#Option($yeepay_frd, $pay['other'], 'name', 'code')}
      </select>
    </td>
  </tr>
  <tr> 
    <td class="buylt"> 
      <div align="center">手续费</div>
    </td>
    <td class="buyrt"> 
      <input name="payfee" type="text" size="10" style="width:30px" value="<!--echo $pay['payfee'] * 100;-->"> <b>%</b>
    </td>
  </tr>
  <tr> 
    <td class="buylt"> 
      <div align="center">使用</div>
    </td>
    <td class="buyrt"> 
      <input name="payopen" type="checkbox" class="checkbox" value="1" onFocus="this.blur()" <!--if($pay['payOpen'] == '1'){--> checked <!--}-->>
    </td>
  </tr>
  <tr>
    <td class="buylt"><div align="center">默认</div></td>
     <td class="buyrt"><input name="isdefault" type="checkbox" value="1" class="checkbox" onFocus="this.blur()" <!--if($pay['isdefault'] == '1'){--> checked <!--}-->></td>
  </tr>
  <tr>
    <td class="buylt" height="50px"></td>
    <td class="buyrt"><input type="submit" value="确认修改" class="button"/> <input type="reset" value="重新填写" class="button"/></td>
  </tr>
</table>
</form>
<!--}-->
<!--}-->
</div>
<div class="cbodyFoot"></div>
</div>
<div id="opcontent" style="display:none">
  <div class="optxt">
  </div>
</div>
<script type="text/javascript">
  var ctablenum = 2;
</script>
<script src="{$vd['sc']}js/content.js" type="text/javascript"></script>
<script type="text/JavaScript">
function set(obj){
    var pay = obj.options[obj.selectedIndex].value;
    sel = obj.selectedIndex;
    var flag = 0;
    if(pay == "alipay|支付宝")
    {
      flag = 1;
      var alipaytype = $('alipaytype');
      alipaytype.selectedIndex = sel;
    }
    else
    {
      flag = 0;
      var mypaytype = $('thispaytype');
      mypaytype.selectedIndex = sel;
      
      if(pay == "yeepay|易宝")
      {
        $("othertr").style.display = "";
      }
      else
      {
        $("othertr").style.display = "none";
      }
      
      
    }

    var objshow = flag ? $('alipay') : $('notalipay');
    var objhide = flag ? $('notalipay') : $('alipay');
    objshow.style.display = "";
    objhide.style.display = "none";
  }
</script>
</body>
</html>
