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

<%

g_num		= InputValue(request("g_num"))
menu_cnt	= InputValue(request("menu_cnt"))
bbs_cnt		= InputValue(request("bbs_cnt"))
g_manager	= InputValue(request("g_manager"))



sql = " delete from board_access where g_num = "&g_num    ' 기존꺼 삭제
Dbcon.execute sql


For z=1 To bbs_cnt

	a_num_t		= InputValue(request("a_num"&z))
	Bl_ad_cms_t = InputValue(request("Bl_ad_cms"&z))
	Bl_list_t	= InputValue(request("Bl_list"&z))
	Bl_read_t	= InputValue(request("Bl_read"&z))
	Bl_write_t	= InputValue(request("Bl_write"&z))
	Bl_delete_t = InputValue(request("Bl_delete"&z))
	Bl_reply_t	= InputValue(request("Bl_reply"&z))


	sql = " INSERT INTO board_access (g_num, a_num, Bl_ad_cms, Bl_list,  Bl_read, Bl_write, Bl_delete, Bl_reply) values ("
	sql = sql &"  '"& g_num &"'"
	sql = sql &", '"& a_num_t &"' "
	sql = sql &", '"& Bl_ad_cms_t &"'"
	sql = sql &", '"& Bl_list_t &"'"
	sql = sql &", '"& Bl_read_t &"'"
	sql = sql &", '"& Bl_write_t &"'"
	sql = sql &", '"& Bl_delete_t &"'"
	sql = sql &", '"& Bl_reply_t &"'"
	sql = sql &")"
	Dbcon.execute sql

next


' 관리메뉴권한

sql = " delete from manager_menu_access where g_num = "&g_num
Dbcon.execute sql



'  접속권한

R_Fields_u = "g_manager"
Call UpdateQuery (R_Fields_u, "member_group", "where g_num="&g_num)



For a=1 To menu_cnt


	ct_idx_t	= InputValue(request("ct_idx"&a))
	ct_codeno_t = InputValue(request("ct_codeno"&a))
	
	If ct_idx_t <> "" then

		sql1 = " INSERT INTO manager_menu_access(g_num, ct_idx,ct_codeno)  values ("
		sql1 = sql1 &"  "&g_num&""
		sql1 = sql1 &", "&ct_idx_t&" "
		sql1 = sql1 &", '"&ct_codeno_t&"'"
		sql1 = sql1 &")"
		Dbcon.execute sql1

	End if
	

next

Dbcon.close : Set Dbcon = nothing

'ok_url = "awrite.asp?g_num="&g_num
ok_url = "write.asp"

Call loding ("0",ok_url)

%>