<!--#include file="conn.asp"-->
<!--#include file="../func.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 userid,action
action=FormatSQL(SafeRequest("action",0))
userid=SafeRequest("id",1)
if userid="" then userid=request.form("userid")
select case action
case "save"
if session("rank")>1 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 DV_User where userid="&userid,conn,1,3
if trim(request.form("UserPassword"))<>"" then rs("UserPassword")=md5(trim(request.form("UserPassword")))
rs("realname")=trim(request.form("realname"))
rs("identify")=trim(request.form("identify"))
rs("UserMobile")=trim(request.form("UserMobile"))
rs("userqq")=trim(request.form("userqq"))
rs("MSN")=trim(request.form("MSN"))
rs("useremail")=trim(request.form("useremail"))
rs("UserQuesion")=trim(request.form("UserQuesion"))
if trim(request.form("UserAnswer"))<>"" then rs("UserAnswer")=md5(trim(request.form("UserAnswer")))
rs("UserSex")=request.form("UserSex")
rs("city")=trim(request.form("city"))
rs("address")=trim(request.form("address"))
rs("postcode")=trim(request.form("postcode"))
rs("usertel")=trim(request.form("usertel"))
rs("score")=trim(request.form("score"))
rs("deposit")=trim(request.form("deposit"))
rs("GrpID")=trim(request.form("GrpID"))
rs("book")=trim(request.form("book"))
rs.Update
rs.Close
set rs=nothing
response.Write "<script language=javascript>alert('操作成功!');history.go(-1);</script>"
case "del"
if session("rank")>1 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权删除用户！');history.go(-1);</script>"
response.End
end if
conn.execute "delete from DV_User where userid in ("&userid&") "
conn.execute "delete from orders where userid in ("&userid&")"
response.Redirect "adminuser.asp"
end select
%>

