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

$ket = getFromTable("select keterangan from tbl_referensi where id = '".$_GET[jns]."' and kd = 'POS' ");
title("<img src='../images/sales-report-icon.png' width='65' align='absmiddle' >  List Items ($ket)");


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

<div class="column">
<?php
$SQL1 = "select DISTINCT b.jns_layanan, b.category, a.keterangan
		from tbl_layanan b
		LEFT JOIN tbl_referensi a on a.id = b.category and a.kd = 'KMN'
		where b.jns_layanan = '".$_GET[jns]."' ";
$r1 = mysql_query($SQL1);

while ($row1 = mysql_fetch_array($r1)) {
?>
<div class="ui warning message"><b><?php echo $row1[keterangan]; ?></b></div>
<table class="ui right aligned celled table">
	<thead>
		<tr>
			<th class="left aligned" width="20%">ITEM</th>
			<th>DESCRIPTION</th>
			<th width="15%">PRICE</th>
			<th width="15%">STATUS</th>
		</tr>
	</thead>
	<tbody>
<?php
    $SQL = "select *, case when status_layanan = 1 then 'Available' else 'Not Available' end as status from tbl_layanan where category = '".$row1[category]."' and jns_layanan = '".$_GET[jns]."' ";
    $r = mysql_query($SQL);

    while ($row = mysql_fetch_array($r)) {
    	if ($row[status_layanan] == 0){
			$class = " style = 'color: red;' ";
		} else {
			$class = "";
		}
        ?>
		<tr class="positive">
			<td class="left aligned"><?php echo $row[nm_layanan]; ?></td>
			<td><?php echo $row[ket_layanan];?></td>
			<td>Rp. <?php echo number_format($row[hrg_layanan],2,',','.'); ?></td>
			<td><?php echo $row[status] ;?></td>
		</tr>	

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