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

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

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

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

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

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

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

		$sql_common = " gr_1_subj		= '{$_POST['m_title'][$i]}'
						, gr_1			= '{$_POST['m_desc'][$i]}'
						, gr_3			= '{$_POST['m_admin'][$i]}'
						";

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

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

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

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

}

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

?>