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

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

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