<!--#include file="admin_start.asp"-->
<%
id=trim(request("id"))
action=trim(request("action"))
select case action

case "delete"

	if not MySys.check.isInteger(id) then
	MySys.error.info="请选择要删除的邮箱!"
	MySys.error.location="back"
	MySys.error.err
	end if
	
	conn.execute("delete from jins_site_mail where mail_id="&id&" ")
	
	MySys.error.info="删除邮箱成功!"
	MySys.error.location="back"
	MySys.error.suc

case "edit"

	rs.open "select * from jins_site_mail ",conn,1,3
	do while not rs.eof 
		if request.form("mail_open")-rs("mail_id")=0 then rs("mail_open")=1 else rs("mail_open")=0
		rs("mail_address")=request.form("mail_address_"&rs("mail_id"))
		rs("mail_username")=request.form("mail_username_"&rs("mail_id"))
		rs("mail_password")=request.form("mail_password_"&rs("mail_id"))
		rs("mail_name")=request.form("mail_name_"&rs("mail_id"))
		rs("mail_send")=request.form("mail_send_"&rs("mail_id"))
		rs.update
		rs.movenext
	loop
	rs.close	
	MySys.error.info="邮箱编辑成功!"
	MySys.error.location="back"
	MySys.error.suc

case "add"
	rs.open "select * from jins_site_mail ",conn,1,3
	rs.addnew 
	rs("mail_open")=0
	rs("mail_address")=request.form("mail_address")
	rs("mail_username")=request.form("mail_username")
	rs("mail_password")=request.form("mail_password")
	rs("mail_name")=request.form("mail_name")
	rs("mail_send")=request.form("mail_send")
	rs.update
	rs.close	
	MySys.error.info="添加邮箱编辑成功!"
	MySys.error.location="back"
	MySys.error.suc

end select

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