<?php
require 'db.php';

$id = intval($_POST['id'] ?? 0);
if($id > 0){
    // Delete all payments first
    $conn->query("DELETE FROM bondhoki_payments WHERE bondhoki_id=$id");
    // Delete customer
    $conn->query("DELETE FROM bondhoki_customers WHERE id=$id");
}
header("Location: bondhoki_list.php");
exit;
?>
