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

<div class="container-fluid px-4">
    <h1 class="mt-4">Data Poli</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="poli_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 Poli</th>
                        <th>Keterangan</th>
                        <th>Aksi</th>
                    </tr>
                </thead>
                <?php 
                  include '../koneksi.php';
                  $no=1;
                  $data = mysqli_query($koneksi,"SELECT * FROM tbl_poli");
                  while($d = mysqli_fetch_array($data)){
                    ?>
                    <tr>
                      <td><?php echo $no++; ?></td>
                      <td><?php echo $d['nama_poli']; ?></td>
                      <td><?php echo $d['keterangan']; ?></td>
                      <td>                        
                        <a class="btn btn-warning btn-sm" href="poli_edit.php?id=<?php echo $d['id_poli'] ?>"><i class="bi bi-check-circle text-success"></i>Edit</a>
                        <a class="btn btn-danger btn-sm" href="poli_hapus_konfir.php?id=<?php echo $d['id_poli'] ?>"><i class="bi bi-trash-fill"></i>Hapus</a>
                      </td>
                    </tr>
                    <?php 
                  }
                  ?>
                </tbody>
                
            </table>
        </div>
    </div>
</div>

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