<!--#include file="../inc/Conn.asp"-->
<!--#include file="Inc/Admin.Asp"-->
<!--#include file="../Inc/Ubbcode.asp"-->
<!--#include file="Inc/Function.asp"-->
<!--#include file="Inc/md5.asp"-->
<%
dim rs,sql
dim ID
dim Title,Content,User,Action
dim ok,AddDatee,Hits
FoundErr=false

StrTitle="信息"

Action=request("Action")
ID=Request.Form("ID")
P_PassWord=Trim(request.form("P_PassWord"))
P_PassWord2=Trim(request.form("P_PassWord2"))
P_FullName=trim(request.form("P_FullName"))
P_Phone=Trim(request.form("P_Phone"))
P_QQ=trim(request.form("P_QQ"))
P_Sex=trim(request.form("P_Sex"))
P_Review=trim(request.form("P_Review"))
P_Tjr=trim(request.form("P_Tjr"))
P_IdentityOK=trim(request.form("P_IdentityOK"))

if trim(P_PassWord) <> trim(P_PassWord2) then
	founderr=true
	errmsg="<li>新密码与确认密码不一至!</li>"
end if 

if founderr=false then	
	set rs=server.createobject("adodb.recordset")
	select case Action
	 case "Modify"	
  		if ID<>"" then
			sql="select * from Dream_User where id="&ID
			rs.open sql,conn,1,3
			if not (rs.bof and rs.eof) then
			    
				call SaveData()				
				rs.update
				rs.close
				set rs=nothing
	            response.redirect "Dream_User.asp"
 			else
				founderr=true
				errmsg=errmsg+"<li>找不到此"&StrTitle&"，可能已经被删除。</li>"
				call WriteErrMsg()
			end if
		else
			founderr=true
			errmsg=errmsg+"<li>不能确定ID的值</li>"
			call WriteErrMsg()
		end if
	 Case else
		founderr=true
		errmsg=errmsg+"<li>没有选定参数</li>"
		call WriteErrMsg()
	end select
	call CloseConn()
else
	WriteErrMsg
end if
%>

<%
sub SaveData()
  if trim(P_PassWord)<>"" then
  rs("Dream_PassWord")=md5(P_PassWord)
  end if
  rs("Dream_FullName")=P_FullName
  rs("Dream_Phone")=P_Phone
  rs("Dream_QQ")=P_QQ
  rs("Dream_Sex")=P_Sex
  rs("Dream_Tjr")=P_Tjr
  rs("Dream_IdentityOK")=P_IdentityOK
  if P_Review="yes" then
  rs("Dream_Rok")=true
  else
  rs("Dream_Rok")=false
  end if  
end sub
%>