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


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


// data
	for ($i=0; $i<sizeof($_POST['chk_mrc_no']); $i++)
	{
		// [2006-01-05][custmize] 보낸편지함/수신확인 보관기능.
		$q_where = " AND mrcext_m_id IS NULL ";

		// [2012-09-27] 예약발송
			if ($G_SYS['MAIL_SEND_RESERVE_ISUSE'])
				$q_where .= " AND (mrc_reserve_status IS NULL OR mrc_reserve_status != 'W') ";
				// [2013-02-04] 예약발송 추가후, 삭제되지 않던 오류 수정. $q_where .= " AND mrc_reserve_status != 'W' ";

		// db del
			$sql = "
				DELETE
				FROM
					" . $TB['MAIL_RECEIVE_CHECK'] . "
				WHERE
					mrc_no='" . $_POST['chk_mrc_no'][$i] . "'
					AND m_no='" . $AUTH['auth_m_no'] . "'
					$q_where
				";
			db_query($sql);			
	}	// for()

// end
	#msg('삭제되었습니다.', 0);
	movepage('mail_receive_check.php?'.get_qs('chk_mrc_no[]'));


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