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


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


// data
	// get
		$sql = "
			SELECT
				mb_id, mb_name, mb_is_system, mb_saveday, mb_sort
			FROM
				".$TB['MAIL_BOX']."
			WHERE
				m_no='". $AUTH['auth_m_no'] . "'
				AND mb_id='". $_GET['mb_id'] . "'
			";
		$mb = db_get_row($sql);

		// view
		$mb_view = array();
		$mb_view['mb_name'] = input_value($mb['mb_name'], 1);
		$mb_view['mb_sort'] = input_value($mb['mb_sort'], 1);

		// [2006-03-06] 보관기간
		$q = "SELECT d_saveday FROM ".$TB['DOMAIN']." WHERE d_no='".$AUTH['auth_d_no']."'";
		$d_saveday = db_get_one($q);
		if ($d_saveday > 0)
		{
			foreach ($G_SYS['MB_SAVEDAY'] as $key=>$val)
			{
				if ($key > $d_saveday)
					break;
				if ($key != 0)
					$mb_saveday_ar[$key] = $val;							
			}	// foreach()
		} else 
		{
			$mb_saveday_ar = $G_SYS['MB_SAVEDAY'];			
		}	// if()
		$mb_view['mb_saveday'] = select_list_value($mb['mb_saveday'], array_values($mb_saveday_ar), array_keys($mb_saveday_ar), NULL, 0, 1);


// set
	$CFG['TITLE'] = '<b>환경설정</b> >> <b>편지함관리</b> >> <b>수정</b>';


// skin view
	nskinset('webmail', 'mail_box_mod.html');
	include($NSKIN['view_layout']);


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