<div class="d-flex justify-content-between align-items-center mb-4">
    <h3 class="fw-bold text-coffee mb-0"><i class="bi bi-tags text-coffee-gold me-2"></i> Kategori Yönetimi</h3>
    <a href="?sayfa=kategoriEkle" class="btn btn-coffee rounded-pill px-4 py-2"><i class="bi bi-plus-circle me-2 text-white"></i> Yeni Kategori Ekle</a>
</div>

<?php

$sql = "SELECT * FROM kategoriler";
$ornek = mysqli_query($conn, $sql);
echo "<div class='table-responsive border border-light rounded-4 shadow-sm bg-white p-3'>
    <table class=\"table table-hover align-middle table-borderless mb-0\" >
    <thead>
    <tr class=\"table-light border-bottom\">
      <th scope=\"col\" class=\"py-3\">Kategori Adı</th>
      <th scope=\"col\" class=\"py-3 text-center\" style=\"width: 240px;\">İşlemler</th>
      </tr>
  </thead>
  <tbody>";
while ($row = mysqli_fetch_array($ornek, MYSQLI_BOTH)) {
    $id = $row[0];
    $ad = $row["kategori_ad"];

    echo "<tr class=\"border-bottom\">";
    echo "<td class=\"py-3\"><strong class=\"text-dark\">$ad</strong></td>";
    echo "<td class=\"py-3 text-center\">";
    echo "  <a href=\"?sayfa=kategoriEkle&kategoriID=$id\" class=\"btn btn-sm btn-outline-coffee rounded-pill px-3 py-1.5 me-1\"><i class=\"bi bi-pencil me-1\"></i> Düzenle</a>";
    echo "  <a href=\"?sayfa=kategoriSil&kategoriID=$id\" onclick=\"return confirm('Bu kategoriyi silmek istediğinize emin misiniz?');\" class=\"btn btn-sm btn-outline-danger rounded-pill px-3 py-1.5\"><i class=\"bi bi-trash me-1\"></i> Sil</a>";
    echo "</td>";
    echo "</tr>";
}
echo "</tbody></table></div>";
