<?php
include '../koneksi.php';

if (isset($_GET['id'])) {
    $id = $_GET['id'];
    $query = mysqli_query($koneksi, "DELETE FROM buku WHERE id_buku = '$id'");

    if ($query) {
        header('Location: ../index.php?alert=hapus_berhasil');
        exit();
    } else {
        header('Location: ../index.php?alert=hapus_gagal');
        exit();
    }
} else {
    header('Location: ../index.php?alert=hapus_gagal');
    exit();
}
?>
