<!--#include virtual="/common/lib/dbcon.asp"-->
<!--#Include virtual="/common/lib/func.asp"-->
<%
member_login_chk("/index.asp")


Dim adr_idx, bdm_idx,adr_m_id, adr_name, adr_email, adr_mobile1, adr_mobile2, adr_mobile3, adr_adr1, adr_adr2, adr_phone1, adr_phone2, adr_phone3, adr_homepage, adr_b_day, adr_company, adr_jikgub, adr_c_homepage, adr_c_phone1, adr_c_phone2, adr_c_phone3, adr_c_fax1, adr_c_fax2, adr_c_fax3, adr_c_memo

Dim prepage

prepage = request("prepage")

r_fields = "adr_idx, bdm_idx, adr_name, adr_email, adr_mobile, adr_c_memo, adr_adr1, adr_adr2, adr_phone1, adr_phone2, adr_phone3, adr_homepage, adr_b_day, adr_company, adr_jikgub, adr_c_homepage, adr_c_phone1, adr_c_phone2, adr_c_phone3, adr_c_fax1, adr_c_fax2, adr_c_fax3, adr_c_memo"

Call requestAll(r_fields, "")

adr_m_id			= session("ss_m_id")

adr_mobile = phoneValue( adr_mobile )
adr_mobile_arr = Split(adr_mobile, "-")

adr_mobile1 = adr_mobile_arr(0)
adr_mobile2 = adr_mobile_arr(1)
adr_mobile3 = adr_mobile_arr(2)


If adr_idx = "" Then

	r_fields_i = "bdm_idx,adr_m_id, adr_name, adr_email, adr_mobile1, adr_mobile2, adr_mobile3, adr_adr1, adr_adr2, adr_phone1, adr_phone2, adr_phone3, adr_homepage, adr_b_day, adr_company, adr_jikgub, adr_c_homepage, adr_c_phone1, adr_c_phone2, adr_c_phone3, adr_c_fax1, adr_c_fax2, adr_c_fax3, adr_c_memo"

	Call InsertQuery(r_fields_i, "bd_address_page")

	msg = "주소록이 등록되었습니다."
else

	r_fields_u = "bdm_idx, adr_name, adr_email, adr_mobile1, adr_mobile2, adr_mobile3, adr_adr1, adr_adr2, adr_phone1, adr_phone2, adr_phone3, adr_homepage, adr_b_day, adr_company, adr_jikgub, adr_c_homepage, adr_c_phone1, adr_c_phone2, adr_c_phone3, adr_c_fax1, adr_c_fax2, adr_c_fax3, adr_c_memo"

	Call UpdateQuery(r_fields_u, "bd_address_page", "Where adr_idx = "&adr_idx)

	msg = "주소록이 수정되었습니다."

End if


Dbcon.close
set Dbcon=Nothing

If prepage = "" Then prepage = "./addr_write.asp"
Call Back_back2(msg, prepage)
%>