<?php include 'header-in.php';
include 'backoffice/connection.php'; // Include database connection

// Fetch all rooms from the database
$roomsQuery = "SELECT * FROM rooms ORDER BY id ASC";
$roomsResult = mysqli_query($conn, $roomsQuery);
?>



<!-- ============ INNER BANNER + BREADCRUMB ============ -->
<section class="inner-banner">
  <!-- Background Image (Use hotel lobby/food shot) -->
  <img src="images/slide-1.jpg" alt="Hotel Banner" class="inner-banner-bg">
  <div class="inner-banner-overlay"></div>
  
  <div class="banner-content">
    <h1 class="banner-title">Rooms</h1>
   
    
    <!-- ✅ Center Aligned Breadcrumb -->
    <nav aria-label="breadcrumb">
      <ul class="custom-breadcrumb list-unstyled mb-0">
        <li><a href="index.php"><i class="bi bi-house-door me-1"></i>Home</a></li>
        <li class="separator"><i class="bi bi-chevron-right"></i></li>
        <li class="active">Rooms</li>
      </ul>
    </nav>
  </div>
</section>







<!-- ================= ROOMS LISTING ================= -->
  <section class="section rooms-section">
    <div class="container">

     

      <div class="row g-4 rooms-grid">

        <?php if (mysqli_num_rows($roomsResult) > 0): ?>
          <?php while ($room = mysqli_fetch_assoc($roomsResult)): ?>
            <div class="col-lg-4 col-md-6">
              <div class="room-card">
                <div class="room-image">
                  <?php if (!empty($room['image'])): ?>
                    <img src="backoffice/room_images/<?php echo htmlspecialchars($room['image']); ?>" alt="<?php echo htmlspecialchars($room['room_name']); ?>">
                  <?php else: ?>
                    <img src="images/placeholder.jpg" alt="No Image Available">
                  <?php endif; ?>
                </div>

                <div class="room-content">
                  <h3><?php echo htmlspecialchars($room['room_name']); ?></h3>
                </div>
              </div>
            </div>
          <?php endwhile; ?>
        <?php else: ?>
          <div class="col-12 text-center">
            <p>No rooms available at the moment.</p>
          </div>
        <?php endif; ?>

     

      </div>
    </div>
  </section>







<?php include 'footer.php'; ?>