<?php 
	echo "<title>Loading...</title><div id='loading'><div class='loader'></div><br>Loading...</div>";
	date_default_timezone_set('Asia/Jakarta');
	
	$stringreplace 	= array ('/','\\',',','.','#',':',';','\'','"','[',']','{','}',')','(','|','`','~','!','@','%','$','^','&','*','=','?','+',' ','_');
	
	$tujuan_nama	= mysqli_real_escape_string($koneksi, $_POST['tujuan_nama']);
	$tujuan_harga	= mysqli_real_escape_string($koneksi, $_POST['tujuan_harga']);
	$tujuan_hari	= mysqli_real_escape_string($koneksi, $_POST['tujuan_hari']);
	$tujuan_seo		= strtolower(str_replace($stringreplace,'-',$tujuan_nama));
	$tujuan_status	= mysqli_real_escape_string($koneksi, $_POST['tujuan_status']);
	
	$bustype_id		= mysqli_real_escape_string($koneksi, $_POST['bustype_id']);
	$btdb = mysqli_query($koneksi, "SELECT * FROM cmas_bustype WHERE bustype_id='$bustype_id'");
	$btdt = mysqli_fetch_array($btdb);
	$bustype_nama	= $btdt['bustype_nama'];
	$bustype_seo	= strtolower(str_replace($stringreplace,'-',$bustype_nama));
	
	$postdated		= date("Y-m-d H:i:s");
	$updated		= date("Y-m-d H:i:s");
	$posted_id		= $udt['admin_id'];
	$updated_id		= $udt['admin_id'];
	
	mysqli_query($koneksi, "INSERT INTO cmas_tujuan (tujuan_id, tujuan_nama, tujuan_harga, tujuan_hari, tujuan_seo, tujuan_status, bustype_id, bustype_nama, bustype_seo, postdated, updated, posted_id, updated_id) VALUES(NULL, '$tujuan_nama', '$tujuan_harga', '$tujuan_hari', '$tujuan_seo', '$tujuan_status', '$bustype_id', '$bustype_nama', '$bustype_seo', '$postdated', '$updated', '$posted_id', '$updated_id')") or die (mysqli_error($koneksi));
	
	echo "<meta http-equiv='refresh' content='0; url=?m=tujuan_indexkat&id=$bustype_id&is=is'>";
?>