<?php include '../config/koneksi.php'; session_start(); if(!isset($_SESSION['admin_id'])){ header('Location: login.php'); exit; } ?>
<!DOCTYPE html>
<html>
<head>
    <title>Stok Kamar - Admin</title>
    <link rel="stylesheet" type="text/css" href="style_admin.css">
</head>
<body>
<?php include 'header.php'; ?>
<?php include 'sidebar.php'; ?>
<div class="content">
    <div class="box">
        <h2 style="text-align:center;">Stok Kamar</h2>
        <table>
            <tr>
                <th>Tipe</th>
                <th>Stok Kamar</th>
            </tr>
            <?php
            $q = mysqli_query($conn, "SELECT tipe, COUNT(*) as jumlah FROM kamar WHERE status='tersedia' GROUP BY tipe");
            while($s = mysqli_fetch_assoc($q)){
                echo '<tr>';
                echo '<td>'.htmlspecialchars($s['tipe']).'</td>';
                echo '<td>'.$s['jumlah'].' Kamar</td>';
                echo '</tr>';
            }
            ?>
        </table>
    </div>
</div>
<?php include 'footer.php'; ?>
</body>
</html> 