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

<div class="container-fluid px-4">
    <h1 class="mt-4">Data Jadwal Kurir</h1>
    <ol class="breadcrumb mb-4">
        <li class="breadcrumb-item active">Table</li>
    </ol>
    
    <!-- Table Section -->
    <div class="card mb-4">
        <div class="card-header">
            <a href="home.php" class="btn btn-secondary"> &nbsp Home</a>
    <a href="jadwal_tambah.php" class="btn btn-danger"></i> &nbsp TAMBAH</a>
        </div>
        <div class="card-body">
            <table id="datatablesSimple" class="table table-striped">
                <thead>
                    <tr>
                        <th>NO</th>
                        <th>Hari</th>
                        <th>Jam Jemput</th>
                        <th>Jam Tiba</th>
                        <th>Nama Kurir</th>
                        <th>Nama Laundri</th>
                        <th>Aksi</th>
                    </tr>
                </thead>
                <?php 
include '../koneksi.php';
$no=1;
$data = mysqli_query($koneksi, "SELECT 
    tbl_jadwal.id_jadwal, 
    tbl_jadwal.hari, 
    tbl_jadwal.jam_mulai, 
    tbl_jadwal.jam_selesai, 
    tbl_kurir.nama_kurir,
    tbl_laundri.nama_laundri
FROM tbl_jadwal 
INNER JOIN tbl_kurir ON tbl_jadwal.id_kurir = tbl_kurir.id_kurir 
INNER JOIN tbl_laundri ON tbl_jadwal.id_laundri = tbl_laundri.id_laundri 
ORDER BY tbl_jadwal.id_jadwal");
while ($d = mysqli_fetch_array($data)) {
?>

    <tr>
        <td><?php echo $no++; ?></td>
         
        <
        <td><?php echo $d['hari']; ?></td>
        <td><?php echo $d['jam_mulai']; ?></td>
        <td><?php echo $d['jam_selesai']; ?></td>
         <td><?php echo $d['nama_kurir']; ?></td>
                <td><?php echo $d['nama_laundri']; ?></td>
       
        
        <td>
            <a class="btn btn-warning btn-sm" href="jadwal_edit.php?id=<?php echo $d['id_jadwal'] ?>"><i class="bi bi-check-circle text-success"></i>Edit</a>
            <a class="btn btn-danger btn-sm" href="jadwal_hapus_konfir.php?id=<?php echo $d['id_jadwal'] ?>">Hapus<i class="bi bi-trash-fill"></i></a>
        </td>
    </tr>
<?php
}
?>

</table>
        </div>
    </div>
</div>

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