<!-- #include file="../admin/check_master.asp" -->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/md5.asp"-->
<%
clubuser_id=request("id")
clubuser_name=trim(request.form("name"))
clubuser_nickname=request.form("nickname")
clubuser_password=request.form("password")
jingyuan=request.form("jingyuan")
tili=request.form("tili")
clubuser_phone=request.form("phone")
clubuser_fax=request.form("fax")
clubuser_url=request.form("url")
clubuser_email=request.form("email")
clubuser_address=request.form("address")
clubuser_note=request.form("note")
clubuser_reg_date=request.form("reg_date")
clubuser_enter_count=request.form("enter_count")

clubuser_question=trim(request.form("clubuser_question"))
if clubuser_password="" then
	response.write "<br><br><center>"
	response.write "用户密码不能为空，请重新输入！"
	response.write "</center>"
	response.end
end if
if clubuser_question="" then
	response.write "<br><br><center>"
	response.write "查询密码问题不能为空，请重新输入！"
	response.write "</center>"
	response.end
end if

clubuser_answer=trim(request.form("clubuser_answer"))
if clubuser_answer="" then
	response.write "<br><br><center>"
	response.write "查询密码答案不能为空，请重新输入！"
	response.write "</center>"
	response.end
end if

if(clubuser_id="") then
	str="select * from clubuser where clubuser_name='"&clubuser_name&"'"
	set rsr=server.createobject("adodb.recordset")
	rsr.open str,conn,1,1
	if not rsr.eof then
		response.write "<BR><BR><BR><center>该用户名已经存在</center>"
		response.end
	end if
set rs=server.createobject("adodb.recordset")
sql="select * from clubuser where (clubuser_id is null)" 
rs.open sql,conn,1,3
rs.addnew

else

set rs=server.createobject("adodb.recordset")
sql="select * from clubuser where clubuser_id="&request("id")
rs.open sql,conn,3,3

end if

rs("clubuser_name")=clubuser_name
rs("clubuser_nickname")=clubuser_nickname
rs("clubuser_password")=md5(clubuser_password)
rs("jingyuan")=jingyuan
rs("tili")=tili
rs("clubuser_phone")=clubuser_phone
rs("clubuser_fax")=clubuser_fax
rs("clubuser_url")=clubuser_url
rs("clubuser_email")=clubuser_email
rs("clubuser_address")=clubuser_address
rs("clubuser_note")=clubuser_note
if(clubuser_reg_date<>"") then
  rs("clubuser_reg_date")=clubuser_reg_date
else
  rs("clubuser_reg_date")=date
end if
if(clubuser_enter_count="") then
  rs("clubuser_enter_count")=1
else
  rs("clubuser_enter_count")=cint(clubuser_enter_count)
end if
rs("clubuser_question")=clubuser_question
rs("clubuser_answer")=clubuser_answer

rs.update
rs.close
'set rs=noting
conn.close
set conn=nothing

response.redirect "user_manage.asp?page=" & session("currentpage")
%>

