<!--#include file="admin_start.asp"-->
<%
dim id
dim ids
dim grade

id=request("id")
ids=request("id_interface")
ids=replace(ids," ","")

if not MySys.check.isInteger(id) and request("action")="edit" then
MySys.error.info="请选择您要操作的项目！"
MySys.error.location="back"
MySys.error.err()
end if

select case request("action")
case "delete"
	if ids="" then
		MySys.error.info="请选择你要删除的项目！"
		MySys.error.location="back"
		MySys.error.err()
	else
	    conn.execute("delete from jins_interface_defray_list where interface_id in ("&ids&") ")
		MySys.error.info="删除在线支付接口成功！"
		MySys.error.location="back"
		MySys.error.suc()
	end if
	
case else

	if request("action")="add" then
	    sql="select * from jins_interface_defray_list "
	else
	    sql="select * from jins_interface_defray_list  where interface_id="&id&""
	end if
	
	rs.open sql,conn,1,3
	
	'/////////////////////////////////////////////检测
	
	if request("action")="edit" and rs.eof then
		MySys.error.info="您选择的项目不存在！"
		MySys.error.location="back"
		MySys.error.err()
	end if
	
	if request("interface_id_send")="" or request("interface_mark")="" or request("interface_name")="" or request("object_grade_0")="" or (request("object_grade_radio_1")="" and request("object_grade_checkbox_1")="") or request.form("interface_open")="" then
		MySys.error.info="请完整填写相关项目！"
		MySys.error.location="back"
		MySys.error.err()
	end if
	
	select case request.form("object_grade_0")
	case ">="
	grade=request.form("object_grade_0")&"|"&int(request.form("object_grade_radio_1"))
	case "<="
	grade=request.form("object_grade_0")&"|"&int(request.form("object_grade_radio_1"))
	case "="
	grade=request.form("object_grade_0")&"|"&request.form("object_grade_checkbox_1")
	end select
	
	grade=grade+"|0"
	
	'/////////////////////////////////////////////
	
	if request("action")="add" then
	    MySys.error.info="在线支付接口加入成功！"
	    rs.addnew
	else
	    MySys.error.info="在线支付接口编辑成功！"
	end if
	
	rs("interface_mark")=request.form("interface_mark")
	rs("interface_name")=request.form("interface_name")
	rs("interface_id_send")=request.form("interface_id_send")
	rs("interface_key_send")=request.form("interface_key_send")
	rs("interface_url")=request.form("interface_url")
	rs("interface_open")=int(request.form("interface_open"))
	rs("interface_num")=int(request.form("interface_num"))
	rs("interface_property")=request.form("interface_property")
	rs("interface_description")=request.form("interface_description")
	rs("interface_customer_grade")=grade
	rs.update
	rs.close
	
	MySys.error.location="admin/admin_interface_defray.asp"
	MySys.error.suc()

end select
%>
<!--#include file="admin_end.asp"-->
