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

$id = intval($_GET['id'] ?? 0);

if ($id > 0) {
    // Hapus detail dulu
    $conn->query("DELETE FROM tabel_transaksi_detail WHERE transaksi_id=$id");
    // Hapus master
    $conn->query("DELETE FROM tabel_transaksi WHERE id=$id");
}

echo "<script>alert('Transaksi berhasil dihapus!'); location.href='../index.php?page=transaksi';</script>";
?>
