<?
$sub_menu = "";
include_once("./_common.php");

if(!$is_admin) exit;
$now	= date("Y-m-d H:i:s", $g4[server_time]);

//-- 리뉴얼 스킨 적용 아이디 변경 ------------------------------------------------------------------------------
if($mode == "renewal"){
	$sql	= "update $zmb[table_config] set db_value='$renewal_id' where db_variable='renewal_id'";
	sql_query($sql);
	$sql	= "update $zmb[table_config] set db_value='$renewal_ip' where db_variable='renewal_ip'";
	sql_query($sql);

	zm_gourl("./zm.builder_renewal.php?");
}

//-- 분류 수정 ----------------------------------------------------------------------------------------------
if($mode == "update") {
	$sql_set	= "set ";
	$sql_set	.= "db_topmenu_skin='$in_topmenu_skin', ";
	$sql_set	.= "db_m_topmenu_skin='$in_m_topmenu_skin', ";
	$sql_set	.= "db_bottom_skin='$in_bottom_skin', ";
	$sql_set	.= "db_m_bottom_skin='$in_m_bottom_skin', ";

	$sql_set	.= "db_layout_skin='$in_layout', ";
	$sql_set	.= "db_m_layout_skin='$in_m_layout', ";
	
	if($link_type == "0") {
		$sql_set	.= "db_index_skin='$in_index_skin', ";
		$sql_set	.= "db_m_index_skin='$in_m_index_skin', ";
	}
	
	if($rdo_skin == "2") {
		//-- 페이지
		$sql_set	.= "db_pagename='$in_layout_pagename', ";
		$sql_set	.= "db_m_pagename='$in_m_layout_pagename', ";
	}
	$sql_set	.= "db_org_recno='$org_recno'";
	
	$sql	= "update $zmb[table_builder_renewal_config] " . $sql_set . " where db_org_recno='$org_recno'";

	$rs = sql_query($sql);

	if($rs)		alert("변경 내용을 적용 했습니다.", "./zm.builder_renewal_write.php?recno=$recno");
	else		alert("변경 내용을 적용하던 중 오류가 발생 했습니다.");
}
?>