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

<div class="container-fluid px-4">
    <h1 class="mt-4">Data Jadwal Dokter</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 Masuk</th>
                        <th>Jam Keluar</th>
                          <th>Nama Dokter</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_dokter.nama_dokter
        FROM tbl_jadwal 
        INNER JOIN tbl_dokter ON tbl_jadwal.id_dokter = tbl_dokter.id_dokter 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_dokter']; ?></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'; ?>
