<?php
// Koneksi ke database
include 'koneksi.php'; // Pastikan path ini benar
include 'header1.php'; // Menggunakan header.php

// Query untuk mendapatkan semua laundri dari tabel 'tbl_laundri'
$query = "SELECT id_laundri, nama_laundri FROM tbl_laundri";
$result = mysqli_query($koneksi, $query);

// Periksa jika query gagal
if (!$result) {
    die("Query Error: " . mysqli_error($koneksi));
}
?>

<!-- ListView Data laundri -->
<ul class="list-group">
    <?php while ($row = mysqli_fetch_assoc($result)) { ?>
    <li class="list-group-item d-flex justify-content-between align-items-center">
        <div>
            <h5 class="mb-1">
                <a href="detail_laundri.php?id=<?php echo $row['id_laundri']; ?>" class="text-decoration-none text-dark">
                    <?php echo htmlspecialchars($row['nama_laundri']); ?>
                </a>
            </h5>
        </div>
    </li>
    <?php } ?>
</ul>

<!-- Tambahkan script JS SB Admin dan Bootstrap -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="path/to/sb-admin-2.min.js"></script>
</body>
</html>
