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


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


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


// data
	// get
		$sql = "
			SELECT
				sg_no, sg_name, sg_content, sg_files, sg_file_size
			FROM
				".$TB['SIGN']."
			WHERE
				m_no='". $AUTH['auth_m_no'] . "'
				AND sg_no='". $_GET['sg_no'] . "'
			";
		$row = db_get_row($sql);

		// view
		$sg_view = array();
		$sg_view['sg_name'] = input_value($row['sg_name'], 1);
		$sg_view['sg_content'] = htmlspecialchars_fix($row['sg_content']);
		$sg_view['sg_files'] = input_value($row['sg_files'], 1);

		$view = array();
		$view['mf_content_type'] = 'H';		// 기본모드 HTML

		// 기존 HTML이 없는 TEXT 서명일 경우, 호환성을 위해 자동 줄바꿈 추가
		$st = strip_tags($row['sg_content']);
		$ishtml = (strlen($row['sg_content']) > strlen($st)+2) ? true : false;
		$sg_view['sg_content_html'] = ($ishtml) ? $row['sg_content'] : nl2br($row['sg_content']);
		$sg_view['sg_content_html'] = htmlspecialchars_fix($sg_view['sg_content_html']);


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


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