<?php
include 'db.php';
$id = intval($_GET['id']);

if($id > 0){
    $conn->query("DELETE FROM expenses WHERE id=$id");
    echo "<script>alert('🗑 Expense deleted successfully'); window.location='expenses_list.php';</script>";
} else {
    echo "<script>alert('❌ Invalid Expense ID'); window.location='expenses_list.php';</script>";
}
?>
