<!--#include virtual = "/common/lib/dbcon.asp" -->
<!--#include virtual = "/common/lib/func.asp" -->

<!--#include file = "config.asp" -->

<%

R_Fields = "m_num, m_id, m_pwd, m_name, m_nickname, m_jumin1, m_jumin2, m_zip1, m_zip2, m_addr1, m_addr2, m_phone1, m_phone2, m_phone3, m_email, m_mobile1, m_mobile2, m_mobile3, m_fax1, m_fax2, m_fax3, m_homepage, m_modymate, m_lastdate, m_chuchun, m_ip, m_level, m_autoimg_str, m_temp1, m_temp2, m_temp3, autoimg_str, m_div, m_rank, m_work, m_etc, m_subname"

Call RequestAll (R_Fields, "")


m_jumin	= m_jumin1 & m_jumin2
m_zipcode	= m_zip1 & m_zip2

arr_m_div = Split(m_div,"||")
m_div1 = arr_m_div(0)
m_div2 = arr_m_div(1)



' 회원환경설정
R_Fields = "mc_idx, mc_agree, mc_addr, mc_nickname, mc_phone, mc_mobile, mc_email, mc_homepage, mc_joinlevel, mc_wdate, mc_agree_str, mc_jumin"

R_tablename_str = "member_config"

R_WHERE_str = " WHERE mc_idx=1"

Call SelectQuery(R_Fields, R_tablename_str, R_WHERE_str)




if m_num = "" then ' 저장

	
	' 자동가입방지 체크
	' *****************************************
	Select Case autoimg_str		
		case 1  : autoimg_chk = "DF4PH3"
		case 2  : autoimg_chk = "HS42YP"
		case 3  : autoimg_chk = "S8VP3X"
		case 4  : autoimg_chk = "N4CW2U"
		case 5  : autoimg_chk = "9SK6GR"
	End select
	

	If (ucase(autoimg_chk) <> ucase(m_autoimg_str))  Then
		Call Back_back("자동가입방지입력값이 동일하지 않습니다.")
	End if
	' *****************************************

	

	If mc_jumin = "Y" then

		' 동일주민번호 체크
		' *****************************************
		sql = "select count(m_num) as jumin_chk from member WHERE m_jumin='"& m_jumin &"'"
		Set Rs = Dbcon.Execute (sql)
		If rs("jumin_chk") Then
			Call Back_back("동일한 주민번호가 존재합니다.")
		End If
		rs.close : Set rs = nothing
		' *****************************************
	End if



	' 동일아이디 체크
	' *****************************************
	sql = "select count(m_num) as id_chk from member where m_id='"&m_id&"'"
	Set Rs = Dbcon.Execute (sql)
	If rs("id_chk") Then
		Call Back_back("동일한 아이디가 존재합니다.")
	End If
	rs.close : Set rs = nothing	
	' *****************************************

	
	R_Fields_i = "m_id, m_pwd, m_name, m_nickname, m_jumin, m_zipcode, m_addr1, m_addr2, m_phone1, m_phone2, m_phone3, m_email, m_mobile1, m_mobile2, m_mobile3, m_fax1, m_fax2, m_fax3, m_homepage, m_date, m_modymate, m_lastdate, m_chuchun, m_ip, m_level,m_autoimg_str, m_temp1, m_temp2, m_temp3,m_div1, m_div2, m_rank, m_work, m_etc, m_subname"
	
	m_date		= getDateFm(now,3)
	m_modymate	= getDateFm(now,3)
	m_ip		= Request.ServerVariables("Remote_host")


	Call InsertQuery (R_Fields_i, "member")

	ok_url = "write.asp"


else ' 수정


	R_Fields_u = "m_name, m_pwd, m_nickname, m_zipcode, m_addr1, m_addr2, m_phone1, m_phone2, m_phone3, m_email, m_mobile1, m_mobile2, m_mobile3, m_fax1, m_fax2, m_fax3, m_homepage, m_modymate, m_temp1, m_temp2, m_temp3, m_level, m_div1, m_div2, m_rank, m_work, m_etc, m_subname"
	
	m_modymate = getDateFm(now,3)

	Call UpdateQuery (R_Fields_u, "member", "where m_num="&m_num)

	ok_url = "list.asp?m_num="&m_num&"&amp;"&page_info

End if

'ViewCreateMember()

Dbcon.close : Set Dbcon = nothing

Call loding ("0",ok_url)

%>