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

unset($_SESSION["SELECT_ROOM"]);
unset($_SESSION["SELECT_PACK"]);

if (isset($_GET["pkt"])) {
	$_SESSION["SELECT_ROOM"] = $_GET["idx"];
	$_SESSION["SELECT_PACK"] = $_GET["pkt"];
	?>
    <SCRIPT language="JavaScript">
        window.opener.location = window.opener.location;
        window.close();
    </SCRIPT>
    <?php
    exit; 
}
	
if (isset($_GET["idx"])) {
    
    title("<img src='../images/sales-report-icon.png' width='65' align='absmiddle' >  Package List");
	$sql = "select * from tbl_layanan where jns_layanan = '006' and jenis = 'Package' ";
	$r = mysql_query($sql);
	$n = mysql_num_rows($r);
	
	?>
	<table id='mytable' class="gridtable tableWithFloatingHeader" width="100%" border="1px">
		<tr>
			<td class="gridtable_th" align="center">No</td>
			<td class="gridtable_th" align="center">&nbsp;</td>
			<td class="gridtable_th" align="center">Description</td>
			<td class="gridtable_th" align="center">Price</td>
		</tr>
		<?php
		$no = 1;
	while ($row = mysql_fetch_array($r)) {
		?>
		<tr>
			<td class="gridtable_td" align="center"><?php echo $no++; ?></td>
			<td class="gridtable_td" align="center"><a href="<?php echo "$SC?idx=".$_GET[idx]."&pkt=".$row[id]; ?>"><img src="../images/icon-ok.png"/></a></td>
			<td class="gridtable_td" align=""><?php echo $row[nm_layanan]; ?></td>
			<td class="gridtable_td" align="right"><?php echo number_format($row[hrg_layanan],2,",","."); ?></td>
		</tr>
		<?php } ?>
	</table>
	<?php
    
} else {
	



if (isset($_GET[e])){
	title("<img src='../images/sales-report-icon.png' width='65' align='absmiddle' >  List Reservation Banquet");
	$sql = "select * from tbl_banquet where tgl_pakai >= CURRENT_DATE and jns_room = '".$_GET[e]."'";
	$r = mysql_query($sql);
		$n = mysql_num_rows($r);
		
	
	?>
	<div align="center"><a href="<?php echo "$SC?idx=".$_GET[e]; ?>"><img src="../images/icon-ok.png"> Select Meeting Room</a></div>
	<table id='mytable' class="gridtable tableWithFloatingHeader" width="100%" border="1px">
		<tr>
			<td class="gridtable_th" align="center">No</td>
			<td class="gridtable_th" align="center">Date </td>
			<td class="gridtable_th" align="center">Time</td>
			<td class="gridtable_th" align="center">Guest</td>
			<td class="gridtable_th" align="center">Adress</td>
			<td class="gridtable_th" align="center">Institution</td>
			<td class="gridtable_th" align="center">Description</td>
		</tr>
		<?php
		$no = 1;
	while ($row = mysql_fetch_array($r)) {
		?>
		<tr>
			<td class="gridtable_td" align="center"><?php echo $no++; ?></td>
			<td class="gridtable_td" align="center"><?php echo $row[tgl_pakai]; ?></td>
			<td class="gridtable_td" align="center"><?php echo $row[wkt_pakai]; ?></td>
			<td class="gridtable_td" align=""><?php echo $row[nm_pemesan]; ?></td>
			<td class="gridtable_td" align=""><?php echo $row[alamat]." ".$row[kota]; ?></td>
			<td class="gridtable_td"><?php echo $row[instansi]; ?></td>
			<td class="gridtable_td"><?php echo $row[keterangan]; ?></td>
		</tr>
		<?php } ?>
	</table>
	<?php
} else {
	
title("<img src='../images/sales-report-icon.png' width='65' align='absmiddle' >  Meeting Room");

$sql = "select * from tbl_referensi where id != '000' and kd = 'BKT' order by keterangan";
$r = mysql_query($sql);
	$n = mysql_num_rows($r);
	

?>
<table id='mytable' class="gridtable tableWithFloatingHeader" width="100%" border="1px">
	<tr>
		<td class="gridtable_th" align="center">No</td>
		<td class="gridtable_th" align="center">&nbsp;</td>
		<td class="gridtable_th" align="center">Meeting Room Type</td>
	</tr>
	<?php
	$no = 1;
while ($row = mysql_fetch_array($r)) {
	?>
	<tr>
		<td class="gridtable_td" align="center"><?php echo $no++; ?></td>
		<td class="gridtable_td" align="center"><a href="<?php echo "$SC?e=$row[id]"; ?>"><img src="../images/icon-clock.png"/></a></td>
		<td class="gridtable_td"><?php echo $row[keterangan]; ?></td>
	</tr>
	<?php } ?>
</table>
<?php } 
}
?>