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

R_Fields = "g_num, g_code, g_menuname, g_chk, g_hdsize, g_wdate, g_webmail, g_money, g_myhome, g_cafe, g_blog, g_sms"


Call RequestAll (R_Fields, "")


If g_num = "" then ' 저장



	' 순서 --------------------------------------
	sql = " SELECT isnull(max(g_code),0) FROM member_group"
	Set Rs = Dbcon.Execute (sql)
	g_code = rs(0)
	rs.close : Set rs = Nothing
	
	g_code = g_code + 1
	' --------------------------------------------------------


	R_Fields_i = "g_code, g_menuname, g_chk, g_wdate, g_manager"
	
	g_wdate = getDateFm(now,3)
	g_manager	= "N"
	
	Call InsertQuery (R_Fields_i, "member_group")

	ok_url = "write.asp"


else ' 수정


	R_Fields = "g_menuname, g_wdate"

	g_wdate = getDateFm(now,3)

	Call UpdateQuery (R_Fields, "member_group", "where g_num="&g_num)

	ok_url = "write.asp"

End if

Dbcon.close : Set Dbcon=nothing

Call loding("0",ok_url)

%>