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

<div class="container-fluid px-4">
    <h1 class="mt-4">Data 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="kurir_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>Nama Kurir</th>
                        <th>Jenis_kendaraan</th>
                        <th>No Polisi</th>
                        <th>Nama Laundri</th>
                        <th>Aksi</th>
                    </tr>
                </thead>
                <?php 
include '../koneksi.php';
$no=1;
$data = mysqli_query($koneksi, "SELECT tbl_kurir.id_kurir, tbl_kurir.nama_kurir, tbl_kurir.Jenis_kendaraan, tbl_kurir.nopol, tbl_laundri.nama_laundri
        FROM tbl_kurir 
        INNER JOIN tbl_laundri ON tbl_kurir.id_laundri = tbl_laundri.id_laundri ORDER BY tbl_kurir.id_kurir");

while ($d = mysqli_fetch_array($data)) {
?>
                    <tr>
                      <td><?php echo $no++; ?></td>
                      <td><?php echo $d['nama_kurir']; ?></td>
                      <td><?php echo $d['Jenis_kendaraan']; ?></td>
                      <td><?php echo $d['nopol']; ?></td>
                       <td><?php echo $d['nama_laundri']; ?></td>
                      <td>                        
                        <a class="btn btn-warning btn-sm" href="kurir_edit.php?id=<?php echo $d['id_kurir'] ?>"><i class="bi bi-check-circle text-success"></i>Edit</a>
                        <a class="btn btn-danger btn-sm" href="kurir_hapus_konfir.php?id=<?php echo $d['id_kurir'] ?>"><i class="bi bi-trash-fill"></i>Hapus</a>
                      </td>
                    </tr>
                    <?php 
                  }
                  ?>
                </tbody>
                
            </table>
        </div>
    </div>
</div>

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