<?php
$PID = "banquet";
session_start();
require_once("../lib/dbconn.php");

/*echo "<pre>";
echo print_r($_POST);
echo "</pre>";*/

$harga = getFromTable("select hrg_layanan from tbl_layanan where id = ".$_POST["item_id"]);

mysql_query("update tbl_banquet set tgl_pakai = '".$_POST[tgl_pakai]."', 
			wkt_pakai = '".$_POST[wkt_pakai]."', jns_room = '".$_POST[jns]."', 
			nm_pemesan = '".$_POST[nm_pemesan]."', alamat = '".$_POST[alamat]."', 
			kota = '".$_POST[kota]."', no_tlpn = '".$_POST[no_tlpn]."', 
			email = '".$_POST[email]."', instansi = '".$_POST[instansi]."', 
			keterangan = '".$_POST[keterangan]."' where no_banquet = '".$_POST[idx]."'");

/**
* @Insert ke tabel transaksi
*/

mysql_query("update tbl_transaksi set tgl_trans = '".$_POST[tgl_pakai]."', tgl_entry = CURRENT_DATE,
			wkt_entry = CURRENT_TIME, item_id = '".$_POST[item_id]."', harga = $harga
			where id = '".$_POST[id_trans]."' ");

echo "<script language='JavaScript'>document.location='../index2.php?p=banquet&idx=".$_POST[idx]."&act=edit'</script>";
?>