<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");

title("<img src='../images/sales-report-icon.png' width='65' align='absmiddle' >  Choise Room Type");

unset($_SESSION["SELECT_KAMAR"]);
unset($_SESSION["SELECT_TGL1"]);
unset($_SESSION["SELECT_TGL2"]);

if (isset($_GET["idx"])) {
    $_SESSION["SELECT_KAMAR"] = $_GET["idx"];
    $_SESSION["SELECT_TGL1"] = $_GET["tgl1"];
    $_SESSION["SELECT_TGL2"] = $_GET["tgl2"];
    ?>
    <SCRIPT language="JavaScript">
        window.opener.location = window.opener.location;
        window.close();
    </SCRIPT>
    <?php
    exit;
}

?>
<!--h4 class="ui top attached block header">Kamar Tersedia</h4-->

<div class="ui two cards">
<?php
    $SQL = "select * from tbl_referensi where id != '000' and kd = 'ROM' order by id ";
    $r = mysql_query($SQL);

    while ($row = mysql_fetch_array($r)) {
    	$cek_kosong = getFromTable("select count(id) from tbl_room where kd_jenis = '".$row[id]."' and stat_isi = 0");
    	
        ?>

	<div class="ui card">
		<div class="image dimmable">
			
		<img src="../images/<?php echo $row[gambar];?>">
		</div>
		<div class="content">
			<div class="header"><?php echo $row[keterangan]; ?></div>
				<div class="meta">
				<a class="group">Room Available : <?php echo$cek_kosong ;?></a>
				</div>
				<div class="description"><?php echo $row[keterangan2];?></div>
		</div>
		<div class="extra content">
			<?php if ($cek_kosong > 0) { ?>
			<a href="cek_kamar.php?tgl1=<?php echo $_GET[tgl1];?>&tgl2=<?php echo $_GET[tgl2];?>&idx=<?php echo $row[id];?>" class="right floated created">Select</a>
			<?php } ?>
			<a class="friends"><font color="#3959c6"> Rate / Night : Rp. <?php echo number_format($row[harga],2,',','.'); ?></font></a>
		</div>
	</div>



	<?php } ?>
</div>
<div style="clear: both; display: block;"></div>
