<?php
//------------------------------------------------------------------------------
// RC 삭제
//------------------------------------------------------------------------------

// 인클루드
require_once( "../inc/session.php" );
require_once( "../inc/common.inc" );         // 공통 함수 모음
require_once( "../inc/db_pgsql.inc" ); // 데이터베이스 인터페이스

$admin_seq = 1; 

$AdminLevel = 1;
//$suid = $HTTP_COOKIE_VARS[SUID];
$suid = $_COOKIE[SUID];

if ($suid != "guru222")
{
	AlertBack("전체관리자만 접근할 수 있습니다.");
	exit;
}

// POST 변수 취득
$arrange   = $_GET["arrange"];

$objConn = new DB_Sql;

$strSQL_1 = " UPDATE t_rms_rc_index " .
            " SET deleted_yn = 'Y' " .
			" WHERE arrange = '$arrange' ";
           
$res1 = $objConn->query($strSQL_1);

$strSQL_2 = " UPDATE t_rms_rc_server_index ".
			" SET deleted_yn = 'Y' " .
			" WHERE etc2 = '$arrange' ";
$res2 = $objConn->query($strSQL_2);

if( $res1 && $res2 )
{
     //$objConn->commitTrans();
     $objConn->close();
     AlertMsg( "$rc_name RC가 삭제되었습니다." );
     echo( "<META http-equiv='refresh' content='0; url=$DOC_ROOT/rcmng/rc_list.html'>" );
}
else
{
    $objConn->rollbackTrans();
    $objConn->close();
    AlertBack( "error: database query failed" );
}
?>
