<!--#include virtual ="/common/lib/dbcon.asp"-->
<!--#include virtual ="/common/lib/func.asp"-->
<%
Dim R_Fields, sql, R_Fields_i, R_Fields_u, ok_url
Dim sc_idx, sc_sitename, sc_sitename_en, sc_ademail, sc_url, sc_company, sc_logo, sc_uptae, sc_jongmok, m_zip1, m_zip2, m_addr1, m_addr2, sc_no, sc_no2, sc_ceo, sc_phone1, sc_phone2, sc_phone3, sc_fax1, sc_fax2, sc_fax3, sc_title, sc_skeyword, sc_hdate1_y, sc_hdate1_m, sc_hdate1_d, sc_hdate2_y, sc_hdate2_m, sc_hdate2_d, sc_hdd, sc_logouttime, sc_wdate, sc_date_chk, sc_hdd_chk


R_Fields = "sc_idx, sc_sitename, sc_sitename_en, sc_ademail, sc_url, sc_company, sc_logo, sc_uptae, sc_jongmok, m_zip1, m_zip2, m_addr1, m_addr2, sc_no, sc_no2, sc_ceo, sc_phone1, sc_phone2, sc_phone3, sc_fax1, sc_fax2, sc_fax3, sc_title, sc_skeyword, sc_hdate1_y, sc_hdate1_m, sc_hdate1_d, sc_hdate2_y, sc_hdate2_m, sc_hdate2_d, sc_hdd, sc_logouttime, sc_wdate, sc_date_chk, sc_hdd_chk"

Call RequestAll (R_Fields, "request.Form")

sc_zipcode		= m_zip1 & m_zip2
sc_addr1		= m_addr1
sc_addr2		= m_addr2

sc_copyright	= InputValue2( sc_copyright )

If sc_hdd = "" Then sc_hdd = "1"


sc_hdate1 = sc_hdate1_y & "-" & sc_hdate1_m & "-" & sc_hdate1_d
sc_hdate2 = sc_hdate2_y & "-" & sc_hdate2_m & "-" & sc_hdate2_d



If sc_idx = "" Then		'//저장
	
	sql = "truncate table site_config"
	dbcon.execute sql
	
	R_Fields_i = "sc_sitename, sc_sitename_en, sc_ademail, sc_url, sc_company, sc_logo, sc_uptae, sc_jongmok, sc_zipcode, sc_addr1, sc_addr2, sc_no, sc_no2, sc_ceo, sc_phone1, sc_phone2, sc_phone3, sc_fax1, sc_fax2, sc_fax3, sc_title, sc_skeyword, sc_copyright, sc_logouttime, sc_wdate "

	If sc_date_chk <> "Y" Then		'//기간 무제한일때

		R_Fields_i = R_Fields_i & ", sc_hdate1, sc_hdate2"

	End if

	If sc_hdd_chk <> "Y" then		'//용량 무제한일때

		R_Fields_i = R_Fields_i & ", sc_hdd"
	End if
	
	sc_wdate = getDateFm(Now(), 3)

	Call InsertQuery( R_Fields_i, "site_config")

	ok_url = "write.asp" & page_info


Else		'//수정



	R_Fields_u = "sc_sitename, sc_sitename_en, sc_ademail, sc_url, sc_company, sc_logo, sc_uptae, sc_jongmok, sc_zipcode, sc_addr1, sc_addr2, sc_no, sc_no2, sc_ceo, sc_phone1, sc_phone2, sc_phone3, sc_fax1, sc_fax2, sc_fax3, sc_title, sc_skeyword, sc_copyright, sc_logouttime, sc_wdate, sc_date_chk, sc_hdd_chk"

	If sc_date_chk <> "Y" then		'//기간 무제한일때

		R_Fields_u = R_Fields_u & ", sc_hdate1, sc_hdate2"
	End if

	If sc_hdd_chk <> "Y" then		'//용량 무제한일때

		R_Fields_u = R_Fields_u & ", sc_hdd"
	End if

	sc_wdate = getDateFm(Now(), 3)

	Call UpdateQuery (R_Fields_u, "site_config", "where sc_idx=" & sc_idx)

	ok_url = "write.asp?" & page_info

End if

dbcon.close
Set dbcon = nothing

Call loding("0", ok_url)
%>