<!--#include file="conn.asp"-->
<%
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
else
if request.cookies("sundxshop")("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
end if
end if
%>
<%
dim action,id
id=SafeRequest("id",1)
action=FormatSQL(SafeRequest("action",0))
select case action
case "add"
if session("rank")>2 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权添加在线支付平台！');history.go(-1);</script>"
response.End
end if
if request.form("opaysername")="" then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('请填写支付平台名称！');history.go(-1);</script>"
response.End
end if
if request.form("opayname")="" then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('请填写帐号！');history.go(-1);</script>"
response.End
end if
if request.form("opaypassword")="" then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('请填写支付安全校验码！');history.go(-1);</script>"
response.End
end if

set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from sdx_opay",conn,1,3
rs.AddNew
rs("opaysername")=trim(request.form("opaysername"))
rs("opayname")=trim(request.form("opayname"))
rs("opaypassword")=trim(request.form("opaypassword"))
rs("opayurl")=trim(request.form("opayurl"))
rs("opayrturl")=trim(request.form("opayrturl"))
rs("opayparter")=trim(request.form("opayparter"))
rs("opayon")=trim(request.form("opayon"))
rs("opaytop")=trim(request.form("opaytop"))
rs("lang")=trim(request.form("lang"))
rs.Update
rs.Close
set rs=nothing
response.Write "<script language='javascript'>alert('添加成功！');location.href='admin_opay.asp' ;</script>"
response.End


case "edit"
if session("rank")>2 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权修改发货清单！');history.go(-1);</script>"
response.End
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from sdx_opay where opayid="&id,conn,1,3
rs("opaysername")=trim(request.form("opaysername"))
rs("opayname")=trim(request.form("opayname"))
rs("opaypassword")=trim(request.form("opaypassword"))
rs("opayurl")=trim(request.form("opayurl"))
rs("opayrturl")=trim(request.form("opayrturl"))
rs("opayparter")=trim(request.form("opayparter"))
rs("opayon")=trim(request.form("opayon"))
rs("opaytop")=trim(request.form("opaytop"))
rs("lang")=trim(request.form("lang"))
rs.update
rs.close
set rs=nothing
response.Write "<script language='javascript'>alert('修改成功！');location.href='admin_opay.asp' ;</script>"
response.End
case "del"
if session("rank")>2 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权删除支付平台！');history.go(-1);</script>"
response.End
end if
conn.execute "delete from sdx_opay where opayid="&id
set rs=nothing
response.Write "<script language='javascript'>alert('删除成功！');location.href='admin_opay.asp' ;</script>"
response.End
response.End
end select

%>