<?php
$sub_menu = "777200";
include_once('./_common.php');
include_once(AMINA_PATH.'/lib/admin.lib.php');

//스킨타입설정
if($loc == "m") {
	if($sca) {
		$skin_type = 3;
	} else {
		$skin_type = 2;
	}
} else {
	if($sca) { 
		$skin_type = 1;
	} else {
		$skin_type = 0;
	}
}

if($loc == "ma" && $ma) {
	switch($ma) {
		case 'func'	: $db_id = $g5['amina']; $chk_id = $_POST['chk_func_id']; break;
		case 'skin'	: $db_id = $g5['amina_skin']; $chk_id = $_POST['chk_skin_id']; break;
		default		: $db_id = '';
	}

	if($db_id) {
		for($i=0;$i<count($chk_id);$i++) {
		    $k = $chk_id[$i];
		    $ma_id = $_POST['ma_id'][$k];
		    sql_query(" delete from {$db_id} where id = '$ma_id' ");
		}		
	}
	goto_url(AMINA_URL."/admin.dashboard.php?bo_table=".$bo_table."&loc=".$loc);
}

//관리모드
if($loc == "ma" && $id) {
	if($type == "func") {
	    sql_query(" delete from {$g5['amina']} where id = '$id' ");
	} else {
	    sql_query(" delete from {$g5['amina_skin']} where id = '$id' ");
	}
	goto_url(AMINA_URL."/admin.dashboard.php?bo_table=".$bo_table."&loc=".$loc);
}

//삭제시
if($mode == "d" && $id) {
    sql_query(" delete from {$g5['amina_skin']} where id = '$id' ");
	goto_url(AMINA_URL."/admin.dashboard.php?bo_table=".$bo_table."&loc=".$loc);
}

//배열키값 생성
$amina_keys = array();
$amina_keys = array_keys($amina);

// 기능저장
if($loc == "func") {
	include(AMINA_PATH.'/admin.update.func.php');
} else {
	include(AMINA_PATH.'/admin.update.skin.php');
}

goto_url(AMINA_URL."/admin.dashboard.php?bo_table=".$bo_table."&loc=".$loc."&sca=".urlencode($sca));

?>