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

$cnt = count($_POST['m_chk']);

for($i=0;$i<$cnt;$i++) {

	$k = $_POST['m_chk'][$i];

	if($_POST['m_type'][$k] == "cf") {

		$sql_common = " cf_1_subj		= '{$_POST['m_admin_display'][$k]}'
						, cf_1			= '{$_POST['m_admin'][$k]}'
						, cf_2			= '{$_POST['m_writer'][$k]}'
						, cf_3			= '{$_POST['m_popular'][$k]}'
						";

		sql_query("update {$g5['config_table']} set $sql_common ");

	} else if($_POST['m_type'][$k] == "gr") {

		$sql_common = " gr_1_subj		= '{$_POST['m_title'][$k]}'
						, gr_1			= '{$_POST['m_desc'][$k]}'
						, gr_3_subj		= '{$_POST['m_at'][$k]}'
						, gr_3			= '{$_POST['m_admin'][$k]}'
						, gr_4_subj		= '{$_POST['m_ac'][$k]}'
						";

		sql_query("update {$g5['group_table']} set $sql_common where gr_id = '{$_POST['m_id'][$k]}'");

	} else if($_POST['m_type'][$k] == "bo") {

		$sql_common = " bo_1_subj		= '{$_POST['m_title'][$k]}'
						, bo_1			= '{$_POST['m_desc'][$k]}'
						, bo_3			= '{$_POST['m_admin'][$k]}'
						, bo_4			= '{$_POST['m_writer'][$k]}'
						";

		sql_query("update {$g5['board_table']} set $sql_common where bo_table = '{$_POST['m_id'][$k]}'");
	}
}

goto_url(AMINA_URL."/admin.extra.php");

?>