<?
require_once('include/global.php');
auth_limit("admin");


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


// data
	$_POST['chk_m_no'] = unserialize(stripslashes($_POST['chk_m_no']));
	for ($i=0; $i<sizeof($_POST['chk_m_no']); $i++)
	{
		if (!is_numeric($_POST['chk_m_no'][$i]))
			msg('올바른 URL로 접근하여 주십시오');
	}	// for()

	$q_where = '';
	if ($AUTH['auth_m_level'] < $G['LEVEL']['serveradmin'])
	{
		$q_where = " AND d_no='" . $AUTH['auth_d_no'] . "' ";
	}	// if()

	// [2015-10-01] oracle 날짜타입 입력쿼리 오류개선
	if ($G_SYS[DB] == 'oracle'){
		$sql = "
			UPDATE
				" . $TB['MEMBER'] . "
			SET
				m_suspend_start=TO_DATE('" . $_POST['m_suspend_start'] . "', 'YYYY-MM-DD'),
				m_suspend_end=TO_DATE('" . $_POST['m_suspend_end'] . "', 'YYYY-MM-DD')
			WHERE
				m_no IN " . set_array2comma(" (", ") ", $_POST['chk_m_no']) . "
				$q_where
		";
	}else{
		$sql = "
			UPDATE
				" . $TB['MEMBER'] . "
			SET
				m_suspend_start='" . $_POST['m_suspend_start'] . "',
				m_suspend_end='" . $_POST['m_suspend_end'] . "'
			WHERE
				m_no IN " . set_array2comma(" (", ") ", $_POST['chk_m_no']) . "
				$q_where
		";
	}
	db_query($sql);

	// [2006-08-08] 사용자 상태 갱신
	for ($i=0; $i<sizeof($_POST['chk_m_no']); $i++)
	{
		mbr_stats_update($_POST['chk_m_no'][$i]);
	}	// for()

// end
	#msg("수정되었습니다.", 0);
	#movepage($back_url);
	?>
		<script language="JavaScript">
		<!--
			if (opener)
			{
                opener.location.reload();
			}
			window.close();
		//-->
		</script>
	<?

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