<?php

require_once("../models/db_connection.php");
if (isset($_GET['id'])) {
    $sql = mysqli_query($conn, "DELETE FROM expenses WHERE id = '$_GET[id]'");
    if ($sql) {
        echo "<script>
        alert('Expense deleted successfully');
        window.location.href = 'view_expenses.php';
    </script>";
    }
}
