<%
if request.cookies("buyok")("admin")="" then response.write "<meta http-equiv='refresh' content='0;URL=../admin.asp'>"
%>
<!--#include file="../include/nowshop.asp"-->

<script language=javascript src=../include/mouse.js></script>
     <%
sub checkmanage(str)
Set mrs = conn.Execute("select * from manage where username='"&request.cookies("buyok")("admin")&"'")
if not (mrs.bof and mrs.eof) then
manage=mrs("manage")
if instr(manage,str)<=0 then
response.write "<script language='javascript'>"
response.write "alert('警告：您没有此项操作的权限！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
else
session("buyok_admin_login")=0
end if
else 
response.write "<script language='javascript'>"
response.write "alert('没有登陆，不能执行此操作！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
end if
set mrs=nothing
end sub
%>
<%call checkmanage("07")%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../images/css.css" type=text/css rel=stylesheet>
<LINK href="../list/newhead.css" type=text/css rel=stylesheet>
</head>
<BODY bgcolor="#D9EAFC">
<%
action=request("ok")
if action="" then
Set rs = conn.Execute("select * from pay") 
show=request("show") 
if show="" then show=rs("pay")
%>
<table height="5"><tr><td></td></tr></table>
<TABLE cellSpacing=0 cellPadding=0 width=95% border=0 style="BORDER-RIGHT: #b1bfee 1px solid; BORDER-TOP: #b1bfee 1px solid; BORDER-LEFT: #b1bfee 1px solid; BORDER-BOTTOM: #b1bfee 1px solid" 
>
            <TBODY>
              <TR> 
                
      <TD bgColor=#f4f5fd height=30><font color="#000000">　<B><font color="#FF0000">&nbsp;在线支付设置</font></B></font></TD>
              </TR>
            </TBODY>
          </TABLE>
		  <table height="5"><tr><td></td></tr></table>

<form action=pay1.asp method=post name=pay>
  <table width="95%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee">
    <tr bgcolor="#f4f5fd"> 
      <td height=35  colspan="2"> 请选择支付网关</td>
    </TR>
    <tr bgcolor="#FFFFFF"> 
      <td height=35  colspan=2 ><input type="radio" name="pay" value="2" <%if show="2" then%>checked<%end if%> onclick="javascript:location.href='pay1.asp?show=2';"> 
        <a href=http://www.cncard.net target="_blank">云网支付@网</a></td>
    </tr>
    <%if show="2" then%>
    <tr bgcolor="#FFFFFF"> 
      <td  width=20% height=35 align=right >商户编号&nbsp;</td>
      <td  > <input type=text value="<%=rs("c_mid")%>" name=c_mid size="30"> &nbsp; 
        &nbsp;&nbsp;</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td  width=20% height=35 align=right >支付密钥&nbsp;</td>
      <td  > <input type=text value="<%=rs("c_pass")%>" name=c_pass size="30"> 
        &nbsp; &nbsp;&nbsp; </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td  width=20% height=35 align=right >支付成功后返回的文件的路径&nbsp;</td>
      <td  > <input type=text value="<%=rs("c_returl")%>" name=c_returl size="30"> 
        &nbsp; &nbsp;&nbsp; </td>
    </tr>
    <%end if%>
    <tr bgcolor="#FFFFFF"> 
      <td height=35  colspan=2 ><input type="radio" name="pay" value="3" <%if show="3" then%>checked<%end if%> onclick="javascript:location.href='pay1.asp?show=3';"> 
        <a href=http://www.xpay.cn target="_blank">易付通</a></td>
    </tr>
    <%if show="3" then%>
    <tr bgcolor="#FFFFFF"> 
      <td  width=20% height=35 align=right >商户号&nbsp;</td>
      <td  > <input type=text value="<%=rs("tid")%>" name=tid size="30"> &nbsp; 
        &nbsp;&nbsp;</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td  width=20% height=35 align=right >交易密钥&nbsp;</td>
      <td  > <input type=text value="<%=rs("key")%>" name=key size="30"> &nbsp; 
        &nbsp;&nbsp; </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td  width=20% height=35 align=right >支付成功后返回的文件的路径&nbsp;</td>
      <td  > <input type=text value="<%=rs("url")%>" name=url size="30"> &nbsp; 
        &nbsp;&nbsp; </td>
    </tr>
    <%end if%>
    <tr bgcolor="#f4f5fd"> 
      <td height=35  colspan=2><INPUT name="ok" TYPE="hidden" value="ok"> <INPUT name=action TYPE="submit" value="保存设置"> 
        &nbsp;</td>
    </tr>
  </table>
  		  <table height="5"><tr><td></td></tr></table>

</form>
<%

rs.close
conn.close
set rs=nothing
set conn=nothing
end if
              
if action="ok" then
if request.form("pay")="" then
response.write "<script language='javascript'>"
response.write "alert('出错了，资料填写不完整或有错误！');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
if request.form("pay")=1 and ( request.form("payid")="" or request.form("paykey")="") then er=1

if er=1 then
response.write "<script language='javascript'>"
response.write "alert('出错了，资料填写不完整或有错误！');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if

Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from pay"
rs.open sql,conn,1,3
rs("pay")=request.form("pay")
if request.form("pay")="1" then
rs("payid")=request.form("payid")
rs("paykey")=request.form("paykey")
end if
if request.form("pay")="2" then
rs("c_mid")=request.form("c_mid")
rs("c_pass")=request.form("c_pass")
rs("c_returl")=request.form("c_returl")
end if

if request.form("pay")="3" then
rs("tid")=request.form("tid")
rs("key")=request.form("key")
rs("url")=request.form("url")
end if

rs.update
rs.close
set rs=nothing
response.write "<script language='javascript'>"
response.write "alert('操作成功，您设置的在线支付信息已保存！');"
response.write "location.href='pay1.asp';"
response.write "</script>"
end if%>
