<?
require_once('include/global.php');
require_once("include/addr_lib.php");
require_once('conf.inc.php');


// set
	if ($_GET['isadmin'])
	{
		$CFG['TITLE'] = '<b>관리자메뉴</b> >> <b>공용주소록 그룹관리</b> >> <b>수정</b>';
	} else 
	{
		$CFG['TITLE'] = '<b>개인주소록</b> >> <b>그룹관리</b> >> <b>수정</b>';

		// [2006-07-11] 공용주소록 구분
		set_addr_no_isshare($_GET['s_adg_no'], $_GET['share']);
	}	// if()




// check
	if (!$_GET['adg_no'])
		msg('올바른 URL로 접근하여 주십시오');
	limit_adg_no($_GET['adg_no']);


// data
	// get
		$sql = "
			SELECT
				adg_no, adg_name, adg_parent, adg_sort
			FROM
				".$TB['ADDR_GROUP']."
			WHERE
				" . get_addr_group_where() . "
				AND adg_no='". $_GET['adg_no'] . "'
			";
		$mb = db_get_row($sql);

		// view
		$adg_view = array();
		$adg_view['adg_name'] = input_value($mb['adg_name'], 1);
		$adg_view['adg_sort'] = input_value($mb['adg_sort'], 1);


		// [2012-10-15] 주소록 그룹 트리 지원
		$cg = get_addr_group_tree_class();
		$cg_dataall = $cg->getRowsByParent(0, 255, 1, "AND " . get_addr_group_where());
		$cg_dataall_option = $cg->getSelectOption($cg_dataall, $_GET['adg_no']);
		$adg_parent = select_list_value ($mb['adg_parent'], $cg_dataall_option['val'], $cg_dataall_option['key'], NULL, 0, 1);


// skin view
	$layout = ($_GET['is_iframe']) ? 'iframe' : 'self';
	nskinset('webmail', 'addr_group_mod.html', $layout);
	include($NSKIN['view_layout']);

	// [2008-08-22] 주소록 그룹이 좌측에 보여지는 스킨일때
	if ($_GET['is_iframe'])
		nm_iframe_load('_nm_address_list_frame', '_nm_address_list_title', $CFG['TITLE']);

require_once('include/global_end.php');
?>