<?php
include 'includes/config.php';

if(isset($_POST['ref_no'])){
    $ref_no = $_POST['ref_no'];

    try {
       
        $stmt = $conn->prepare("DELETE FROM purchase_lines WHERE ref_no = :ref_no");
        $stmt->bindValue(':ref_no', $ref_no);
        $stmt->execute();

        echo "Bill Ref No $ref_no deleted successfully!";
    } catch(PDOException $e){
        echo "Error: " . $e->getMessage();
    }
} else {
    echo "Invalid request!";
}
?>
