<?php
session_start();
require_once("../lib/dbconn.php");

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

$cek1 = getFromTable("select count(id) from tbl_transaksi");
$kd = $cek1 + 1;

mysql_query("insert into tbl_transaksi (id, jns_trans, tgl_trans, tgl_entry,
			wkt_entry, no_booking, item_id, qty, harga, 
			diskon, jumlah, user_entry) values 
            ('$kd', 'ROOM', '$tgl', CURRENT_DATE, 
        	CURRENT_TIME, '".$_POST[idx]."', '".$_POST[id_kamar]."', 1, ".$_POST[harga].",
        	".$_POST[harga].", 0, '".$_SESSION[nama_usr]."')");

mysql_query("update tbl_room set stat_isi = 1, status_kmr = 'isi' where id = '".$_POST[id_kamar]."' ");
 	
unset($_SESSION["SELECT_KAMAR_CEKIN"]);
unset($_SESSION["SELECT_NOMOR_CEKIN"]);

/*echo "<script language='JavaScript'>document.location='../index2.php?p=cek_in'</script>";*/
echo "<script language='JavaScript'>document.location='../index2.php?p=".$_POST[p]."'</script>";
?>