<?php 
	echo "<title>Loading...</title><div id='loading'><div class='loader'></div><br>Loading...</div>";
	date_default_timezone_set('Asia/Jakarta');
	
    $stringreplace		= array ('/','\\',',','.','#',':',';','\'','"','[',']','{','}',')','(','|','`','~','!','@','%','$','^','&','*','=','?','+',' ','_');
	$bustype_id			= mysqli_real_escape_string($koneksi, $_POST['bustype_id']);
	$bustype_nama		= mysqli_real_escape_string($koneksi, $_POST['bustype_nama']);
	$bustype_seo		= strtolower(str_replace($stringreplace,'-',$bustype_nama));
	$bustype_status		= mysqli_real_escape_string($koneksi, $_POST['bustype_status']);
	
	$updated			= date("Y-m-d H:i:s");
	$updated_id			= $udt['admin_id'];
	
	mysqli_query($koneksi, "UPDATE cmas_bustype SET
	bustype_nama		= '$bustype_nama',
	bustype_seo			= '$bustype_seo',
	bustype_status		= '$bustype_status',
	updated				= '$updated',
	updated_id			= '$updated_id'
	WHERE bustype_id	= '$bustype_id'") or die (mysqli_error($koneksi));
	
	mysqli_query($koneksi, "UPDATE cmas_tujuan SET
	bustype_nama		= '$bustype_nama',
	bustype_seo			= '$bustype_seo'
	WHERE bustype_id	= '$bustype_id'") 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, 'Update', 'Bus Type: $bustype_nama', '$notification_ip', '1', '$updated', '$udt[admin_id]', '$udt[admin_username]', '$udt[admin_nama]')");
		
	echo "<meta http-equiv='refresh' content='0; url=?m=bustype_index&us=us'>";	
?>