<!--#include file="../Include/Const.asp" -->
<!--#include file="../Include/Conn.asp" -->
<!--#Include File="Func.asp"-->
<%Response.Charset="gb2312"%>
<%
dim LoginName,Email,UserRealName,UserSex,UserTel,UserMobile,UserQQ,UserAddr,rs,sql
LoginName=trim(session("UserName"))
Email =trim(request("txtEmail"))
UserRealName = trim(request("txtUserRealName"))
UserSex = trim(request("rblSex"))
UserTel = trim(request("txtTelphone"))
UserMobile = trim(request("txtMobile"))
UserQQ = trim(request("txtQQ"))
UserAddr =trim(request("txtAddress"))

If UserRealName="" Then 
response.write("{""status"": 0, ""msg"": ""请输入联系人！""}")
response.end
End If 
If Email="" Then 
response.write("{""status"": 0, ""msg"": ""请输入您的邮箱！""}")
response.end
End If 
If UserMobile="" Then 
response.write("{""status"": 0, ""msg"": ""请输入您的手机号！""}")
response.end
End If 

set rs = server.createobject("adodb.recordset")
sql="select * from Angel_User where UserName='"&LoginName&"'"
rs.open sql,conn,1,3
if rs.bof and rs.eof then
response.write("{""status"": 0, ""msg"": ""温馨提示：修改账号信息出错！""}")
response.end
else
   rs("UserMail")=Email
   rs("UserRealName")=UserRealName
   rs("UserSex")=UserSex
   rs("UserTel")=UserTel
   rs("UserMobile")=UserMobile
   rs("UserQQ")=UserQQ
   rs("UserAddr")=UserAddr
   rs("LastIP")=GetIP
   rs("LastTime")=Now()
   rs.update
   rs.close
   set rs=nothing
   session("UserName")=LoginName
   session("MemLogin")="Succeed"
   session.timeout=60
   response.write("{""status"": 1, ""msg"": ""账户资料已修改成功！"", ""url"": ""login.asp""}")
   response.end
end if
%>