<link rel="stylesheet" type="text/css" href="../css/cetak.css">
<?php
@session_start();
require_once("../lib/dbconn.php");
require_once("../lib/form.php");
require_once("../lib/functions.php");

$r2 = mysql_query("select *
				from tbl_pnpm");
$n2 = mysql_num_rows($r2);
if($n2 > 0) $d2 = mysql_fetch_object($r2);
mysql_free_result($r2);

$r = mysql_query("select a.*, b.keterangan as inisial, c.*, d.keterangan as negara
				from tbl_booking a 
				JOIN tbl_referensi b ON b.id = a.kd_inisial and b.kd = 'INS'
				JOIN tbl_referensi c ON c.id = a.jns_room and c.kd = 'ROM'
				join tbl_referensi d on d.id = a.kd_negara and d.kd = 'NGR'
				where a.id_booking = '".$_GET[idx]."' ");
$n = mysql_num_rows($r);
if($n > 0) $d = mysql_fetch_object($r);
mysql_free_result($r);

$id_room = getFromTable("select item_id from tbl_transaksi where jns_trans = 'ROOM' and status_trans = 1 and no_booking = '".$_GET[idx]."' ");
$no_room = getFromTable("select no_room from tbl_room where id = $id_room ");

$downpay = getFromTable("select sum(jml_bayar + sisa - materai) from tbl_pembayaran where no_booking = '".$_GET[idx]."' and jns_bayar = 'DEPOSIT'");
if ($downpay == 0){
	$ket = "BELUM MELAKUKAN UANG MUKA";
}
?>
<table width="100%">
	<tr>
		<td class="judul"><?php echo $d2->nm_hotel; ?></td>
	</tr>
	<tr>
		<td class="judul1"><?php echo $d2->alamat1; ?></td>
	</tr>
	<tr>
		<td class="judul1"><?php echo $d2->alamat2; ?></td>
	</tr>
</table>
<hr class="flare"/>
<table>
	<tr>
		<td width="50%" valign="top">
			<table width="100%">
				<tr>
					<td><img src="../images/<?php echo $d->gambar;?>" class="gambar_room"></td>
				</tr>
				<tr>
					<td class="judul"><?php echo $d->keterangan; ?></td>
				</tr>
				<tr>
					<td class="judul1"><?php echo $d->keterangan2; ?></td>
				</tr>
				<tr>
					<td class="judul2">Price /Night : Rp. <?php echo number_format($d->harga,2,',','.'); ?></td>
				</tr>
			</table>
		</td>
		<td valign="top" align="center">
			<table width="95%" align="center">
				<tr>
					<td class="tbl_form1">NO.RESERVATION</td>
					<td class="tbl_form1">: <?php echo $d->id_booking; ?></td>
				</tr>
				<tr>
					<td class="tbl_form1">Date of Reservation</td>
					<td class="tbl_form2">: <?php echo $d->tgl_cekin; ?> s/d <?php echo $d->tgl_cekout; ?></td>
				</tr>
				<tr>
					<td class="tbl_form1">Order Name</td>
					<td class="tbl_form2">: <?php echo ucwords(strtolower($d->nm_lengkap)); ?></td>
				</tr>
				<tr>
					<td class="tbl_form1">Address</td>
					<td class="tbl_form2">: <?php echo ucwords(strtolower($d->alamat." ".$d->kota." ".$d->kd_pos." ".$d->negara)); ?></td>
				</tr>
				<tr>
					<td class="tbl_form1">No.Hp & Email</td>
					<td class="tbl_form2">: <?php echo $d->no_hp." / ".$d->email; ?></td>
				</tr>
				<tr>
					<td colspan="2"><hr/></td>
				</tr>
				<tr>
					<td colspan="2" class="status"><?php echo $ket;?></td>
				</tr>
				<tr>
					<td colspan="2" class="status1">
						Silahkan melakukan pembayaran kepada staff hotel agar anda mendapatkan No. Kamar!
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<SCRIPT LANGUAGE="JavaScript">
	
function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}
	
printWindow();
</script>