<?php
	echo "<title>Loading...</title><div id='loading'><div class='loader'></div><br>Loading...</div>";
	date_default_timezone_set("Asia/Jakarta");
	
	$menu_nama			= mysqli_real_escape_string($koneksi, $_POST['menu_nama']);
	$menu_title			= mysqli_real_escape_string($koneksi, $_POST['menu_title']);
	$menu_seo			= mysqli_real_escape_string($koneksi, $_POST['menu_seo']);
	$menu_target		= mysqli_real_escape_string($koneksi, $_POST['menu_target']);
	$menu_status		= mysqli_real_escape_string($koneksi, $_POST['menu_status']);
	$menu_order			= mysqli_real_escape_string($koneksi, $_POST['menu_order']);
	$menu_sub			= mysqli_real_escape_string($koneksi, $_POST['menu_sub']);
	
	$menucat_id			= mysqli_real_escape_string($koneksi, $_POST['menucat_id']);
	$menucat_nama		= mysqli_real_escape_string($koneksi, $_POST['menucat_nama']);
	
	$postdated			= date("Y-m-d H:i:s");
	$updated			= date("Y-m-d H:i:s");
	
	mysqli_query($koneksi, "INSERT INTO cmas_menu (menu_id, menu_nama, menu_title, menu_seo, menu_target, menu_status, menu_order, menu_sub, menucat_id, menucat_nama, postdated, updated, posted_id, posted_username, posted_nama, updated_id, updated_username, updated_nama) VALUES(NULL, '$menu_nama', '$menu_title', '$menu_seo', '$menu_target', '$menu_status', '$menu_order', '$menu_sub', '$menucat_id', '$menucat_nama', '$postdated', '$updated', '$udt[admin_id]', '$udt[admin_username]', '$udt[admin_nama]', '$udt[admin_id]', '$udt[admin_username]', '$udt[admin_nama]')") or die (mysqli_error($koneksi));
	
	$notification_ip = $_SERVER['REMOTE_ADDR'];
	mysqli_query($koneksi, "INSERT INTO cmas_notification (notification_id, notification_status, notification_description, notification_ip, notification_read, postdated, posted_id, posted_username, posted_nama) VALUE(NULL, 'Input', 'Menu: $menu_nama', '$notification_ip', '1', '$updated', '$udt[admin_id]', '$udt[admin_username]', '$udt[admin_nama]')");
	
	echo "<meta http-equiv='refresh' content='0; url=?m=menu_index&is=is'>";
?>
