<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../../conn/conn.asp" -->
<!--#include file="../../Inc/Commoncode.asp" -->
<!--#include file="../../Inc/base64.asp" -->
<!--#include file="../checkvalid.asp"-->
<%If Not FRAdminLevel(701) Then Call ErrorMsg()
flag=my_request("flag",0)
if flag="save" then
call save()
elseif flag="" then
else
response.write "系统错误数据，未被保留"
end if
sql1="select shbh,shid,pay_key,chk from Job_pay_online where payflag=1"
sql2="select shbh,pay_key,chk from Job_pay_online where payflag=2"
'sql3="select shbh,pay_key,chk from Job_pay_online where payflag=3"
'sql4="select shbh,pay_key,chk from Job_pay_online where payflag=4"
'sql5="select shbh,pay_key,chk from Job_pay_online where payflag=5"
sql6="select shbh,pay_key,chk from Job_pay_online where payflag=6"
sql7="select shbh,pay_key,chk from Job_pay_online where payflag=7"
set rs1=conn.execute (sql1)
set rs2=conn.execute (sql2)
'set rs3=conn.execute (sql3)
'set rs4=conn.execute (sql4)
'set rs5=conn.execute (sql5)
set rs6=conn.execute (sql6)
set rs7=conn.execute (sql7)
if not rs1.eof then
ipayno1=rs1("shbh")
ipayid1=rs1("shid")
ipaykey1=rs1("pay_key")
chk1=rs1("chk")
end if
if not rs2.eof then
ipayno2=rs2("shbh")
ipaykey2=rs2("pay_key")
chk2=rs2("chk")
end if

'ipayno3=rs3("shbh")
'ipaykey3=rs3("pay_key")
'chk3=rs3("chk")
'
'ipayno4=rs4("shbh")
'ipaykey4=rs4("pay_key")
'chk4=rs4("chk")
'
'ipayno5=rs5("shbh")
'ipaykey5=rs5("pay_key")
'chk5=rs5("chk")
if not rs6.eof then
ipayno6=rs6("shbh")
ipaykey6=rs6("pay_key")
chk6=rs6("chk")
end if
if not rs7.eof then
ipayno7=rs7("shbh")
ipaykey7=rs7("pay_key")
chk7=rs7("chk")
end if
rs1.close:set rs1=nothing
rs2.close:set rs2=nothing
'rs3.close
'set rs3=nothing
'rs4.close
'set rs4=nothing
'rs5.close
'set rs5=nothing
rs6.close:set rs6=nothing
rs7.close:set rs7=nothing

if not isnull(ipayno1) then ipayno1=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipayno1))),chr(13)&chr(10),"<br>")
if not isnull(ipayid1) then ipayid1=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipayid1))),chr(13)&chr(10),"<br>")
if not isnull(ipaykey1) then ipaykey1=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipaykey1))),chr(13)&chr(10),"<br>")

if not isnull(ipayno2) then ipayno2=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipayno2))),chr(13)&chr(10),"<br>")
if not isnull(ipaykey2) then ipaykey2=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipaykey2))),chr(13)&chr(10),"<br>")

'ipayno3=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipayno3))),chr(13)&chr(10),"<br>")
'ipaykey3=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipaykey3))),chr(13)&chr(10),"<br>")
'
'ipayno4=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipayno4))),chr(13)&chr(10),"<br>")
'ipaykey4=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipaykey4))),chr(13)&chr(10),"<br>")
'
'ipayno5=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipayno5))),chr(13)&chr(10),"<br>")
'ipaykey5=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipaykey5))),chr(13)&chr(10),"<br>")

if not isnull(ipayno6) then ipayno6=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipayno6))),chr(13)&chr(10),"<br>")
if not isnull(ipaykey6) then ipaykey6=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipaykey6))),chr(13)&chr(10),"<br>")

if not isnull(ipayno7) then ipayno7=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipayno7))),chr(13)&chr(10),"<br>")
if not isnull(ipaykey7) then ipaykey7=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipaykey7))),chr(13)&chr(10),"<br>")

sub save()
  ipayno1=my_request("ipayno",0)
  ipayid1=my_request("ipayid",0)
  ipaykey1=my_request("ipaykey",0)
  payflag=my_request("payflag",1)
  chk=my_request("chk",1)
  Select Case payflag
  Case 1:pay_name="支付宝支付"
  Case 2:pay_name="网银在线"
  Case 3:pay_name="Ipay支付"
  Case 4:pay_name="NPS支付"
  Case 5:pay_name="Paypal支付"
  Case 6:pay_name="财付通支付"
  Case 7:pay_name="易宝支付"
  End Select
  if chk="" or isnull(chk) then
    chk=0
  end if
  if ipayno1="" or payflag="" then
    Response.write "<script>alert(""数据不完成"");location.href=""Admin_Pay.asp"";</script>"
    Response.end
  else
    ipayno=strAnsi2Unicode(Base64encode(strUnicode2Ansi(ipayno1)))
	ipayid=strAnsi2Unicode(Base64encode(strUnicode2Ansi(ipayid1)))
    ipaykey=strAnsi2Unicode(Base64encode(strUnicode2Ansi(ipaykey1)))
	set rs=conn.execute ("select shbh,pay_key,chk from Job_pay_online where payflag="&payflag)
	if not rs.eof then
    sql="update Job_pay_online set pay_key='"&ipaykey&"',shbh='"&ipayno&"',shid='"&ipayid&"',chk="&chk&" where payflag="&payflag
    conn.execute (sql)
	else
	sql="Insert into Job_pay_online(shbh,shid,pay_key,payflag,chk,pay_name) values('"&ipayno&"','"&ipayid&"','"&ipaykey&"',"&payflag&","&chk&",'"&pay_name&"')"
    conn.execute (sql)
	end if
	set rs=nothing
    Response.write "<script>alert(""数据保存成功"");location.href=""Admin_Pay.asp"";</script>"
    Response.end
  end if
end sub

conn.close
set conn=nothing
%>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>在线支付-管理</title>
<link href="../css/style<%=sk%>.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../inc/input.js"></script>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
  <tr>
    <th height="22" align="center" ><span class="tableHeaderText">网上支付</span>管理</th>
  </tr>
  <tr>
    <td height="20"><span class="bodytitle"><font color="ff6600"><b class="style1">　管理选项</b></font>：</span><a href="Admin_PayInfo.asp">管理首页</a> | <a href="Admin_PayInfo.asp">会员支付记录</a> | <a href="Admin_Pay.asp">在线支付设置</a> [<a href="javascript:location.reload()">刷新页面</a>]</td>
  </tr>
</table>
<table cellspacing="1" cellpadding="2" align="center" width="98%" class="tableborder mt6" >
  <tr>
    <th colspan="5" height=25 class="tableHeaderText">网上支付设置 <span style="font-weight: 400"> (请选择您将要使用的在线支付方式,我们提供如下几种接口:)</span></th>
  </tr>
  <tr>
    <td colspan="3"><p align="center"><b class="style1">网上支付接口类型/参数设置</b></td>
    <td align="center"><b class="style1">选择</b><span class="style1">(打√表示已启用)</span></td>
    <td align="center"><b class="style1">提交选择</b></td>
  </tr>
  <!---------------------------------------------支付宝--------------------------------------------->
  <form action="Admin_Pay.asp" method="post">
    <input type="hidden" name="payflag" value=1>
    <input type="hidden" name="flag" value="save">
    <tr>
      <td rowspan="3"><b>支付宝：</b></td>
      <td align="right">支付宝帐号：</td>
      <td><input type="text" name="ipayno" size="40" maxlength="80" value="<%=trim(ipayno1)%>"></td>
      <td rowspan="3" align="center"><input name="chk" type="checkbox" class="checkbox" value="1" <%if chk1=1 then response.write "checked"%>>
      选择</td>
      <td rowspan="3" align="center"><input name="B2" type="submit" class="inputs" value="确定选择"></td>
    </tr>
    <tr>
      <td align="right">合作者身份ID：</td>
      <td><input type="text" name="ipayid" size="40" maxlength="80" value="<%=trim(ipayid1)%>"></td>
    </tr>
    <tr>
      <td align="right">安全码：</td>
      <td><input type="password" name="ipaykey" size="40" maxlength="200" value="<%=trim(ipaykey1)%>"></td>
    </tr>
  </form>
  <!---------------------------------------------网银在线--------------------------------------------->
  <form action="Admin_Pay.asp" method="post">
    <input type="hidden" name="payflag" value=2>
    <input type="hidden" name="flag" value="save">
    <tr>
      <td rowspan="2"><b>网银在线：</b></td>
      <td align="right">商家号：</td>
      <td><input type="text" name="ipayno" size="40" maxlength="80" value="<%=trim(ipayno2)%>"></td>
      <td rowspan="2" align="center"><input name="chk" type="checkbox" class="checkbox" value="1" <%if chk2=1 then response.write "checked"%>>
      选择</td>
      <td rowspan="2" align="center"><input name="B3" type="submit" class="inputs" value="确定选择"></td>
    </tr>
    <tr>
      <td  align="right">私钥：</td>
      <td><input type="password" name="ipaykey" size="40" maxlength="200" value="<%=trim(ipaykey2)%>"></td>
    </tr>
  </form>
  <!---------------------------------------------Ipay支付--------------------------------------------
  <form action="AdminPay.asp" method="post">
    <input type="hidden" name="payflag" value=3>
    <input type="hidden" name="flag" value="save">
    <tr>
      <td  rowspan="2" class="amrow"><b>Ipay支付：</b></td>
      <td  align="right" class="amrow">商家号：</td>
      <td class="amrow" ><input type="text" name="ipayno" size="40" maxlength="80" value="<%'=trim(ipayno3)%>"></td>
      <td rowspan="2"  align="center" class="amrow"><input type="checkbox" name="chk" value="1" <%'if chk3=1 then response.write "checked"%>>
      选择</td>
      <td rowspan="2"  align="center" class="amrow"><input type="submit" value="确定选择" name="B4"></td>
    </tr>
    <tr>
      <td  align="right" class="amrow">私钥：</td>
      <td class="amrow" ><input type="text" name="ipaykey" size="40" maxlength="80" value="<%'=trim(ipaykey3)%>"></td>
    </tr>
  </form>
  <!---------------------------------------------NPS支付--------------------------------------------
  <form action="AdminPay.asp" method="post">
    <input type="hidden" name="payflag" value=4>
    <input type="hidden" name="flag" value="save">
    <tr>
      <td  rowspan="2" class="huiby" ><b>NPS支付：</b></td>
      <td   align="right" class="huiby">商家号：</td>
      <td class="huiby"  ><input type="text" name="ipayno" size="40" maxlength="80" value="<%'=trim(ipayno4)%>"></td>
      <td rowspan="2"  align="center" class="huiby" ><input type="checkbox" name="chk" value="1" <%'if chk4=1 then response.write "checked"%>>
      选择</td>
      <td rowspan="2"  align="center" class="huiby" ><input type="submit" value="确定选择" name="B5"></td>
    </tr>
    <tr>
      <td   align="right" class="huiby">私钥：</td>
      <td class="huiby"  ><input type="text" name="ipaykey" size="40" maxlength="80" value="<%'=trim(ipaykey4)%>"></td>
    </tr>
  </form>
  <!---------------------------------------------国际支付Paypal--------------------------------------------
  <form action="AdminPay.asp" method="post">
    <input type="hidden" name="payflag" value=5>
    <input type="hidden" name="flag" value="save">
    <tr>
      <td class="amrow" ><b>国际支付Paypal：</b></td>
      <td  align="right" class="amrow">电子邮件地址：</td>
      <td class="amrow" ><input type="text" name="ipayno" size="40" maxlength="80" value="<%'=trim(ipayno5)%>"></td>
      <td  align="center" class="amrow"><input type="checkbox" name="chk" value="1" <%'if chk5=1 then response.write "checked"%>>
      选择</td>
      <td  align="center" class="amrow"><input type="submit" value="确定选择" name="B6"></td>
    </tr>
	</form>
   -->
     <!---------------------------------------------财付通--------------------------------------------->
  <form action="Admin_Pay.asp" method="post">
    <input type="hidden" name="payflag" value=6>
    <input type="hidden" name="flag" value="save">
    <tr>
      <td rowspan="2"><b>财付通支付：</b></td>
      <td align="right">商户号：</td>
      <td><input type="text" name="ipayno" size="40" maxlength="80" value="<%=trim(ipayno6)%>"></td>
      <td rowspan="2" align="center"><input name="chk" type="checkbox" class="checkbox" value="1" <%if chk6=1 then response.write "checked"%>>
      选择</td>
      <td rowspan="2" align="center"><input name="B3" type="submit" class="inputs" value="确定选择"></td>
    </tr>
    <tr>
      <td  align="right">密钥：</td>
      <td><input type="password" name="ipaykey" size="40" maxlength="200" value="<%=trim(ipaykey6)%>"></td>
    </tr>
  </form>
     <!---------------------------------------------易宝支付--------------------------------------------->
  <form action="Admin_Pay.asp" method="post">
    <input type="hidden" name="payflag" value=7>
    <input type="hidden" name="flag" value="save">
    <tr>
      <td rowspan="2"><b>易宝支付：</b></td>
      <td align="right">商户编号：</td>
      <td><input type="text" name="ipayno" size="40" maxlength="80" value="<%=trim(ipayno7)%>"></td>
      <td rowspan="2" align="center"><input name="chk" type="checkbox" class="checkbox" value="1" <%if chk7=1 then response.write "checked"%>>
      选择</td>
      <td rowspan="2" align="center"><input name="B3" type="submit" class="inputs" value="确定选择"></td>
    </tr>
    <tr>
      <td  align="right">密钥：</td>
      <td><input type="password" name="ipaykey" size="40" maxlength="200" value="<%=trim(ipaykey7)%>"></td>
    </tr>
  </form>

</table>
<table cellspacing="1" cellpadding="2" align="center" width="98%" class="tableborder" >
    <tr>
      <th colspan="5" height=25 class="tableHeaderText">网上支付设置说明</th>
    </tr>
    <tr>
      <td  colspan="5"> 所有网上支付的参数设置均需要先到对应支付接口官方网站申请注册成该网站的会员后,方可从那里获取参数信息!<br>
        各支付接口官方网址列表：<br>支付宝：<a target="_blank" href="http://www.alipay.com">http;//www.alipay.com</a>&nbsp; 
      <br>网银在线：<a target="_blank" href="http://www.chinabank.com.cn">http://www.chinabank.com.cn</a>
      <br>财付通：<a target="_blank" href="http://www.tenpay.com">http://www.tenpay.com</a>
      <br>易宝支付：<a target="_blank" href="http://www.yeepay.com">http://www.yeepay.com</a></td>
    </tr>
  
</table>
<!--#include file="../inc/copy.asp" -->
</body>
</html>