<?php
session_start();
ob_start();
error_reporting(E_ALL);
ini_set('display_errors', 1);

// TEMPORARY DIRECT DELETE - REMOVE AFTER FIX
if (isset($_GET['delete_id']) && isset($_GET['studentid'])) {
    include "../../include/config.php"; // Adjust path as needed
    
    $delete_id = mysqli_real_escape_string($conn, $_GET['delete_id']);
    $studentid = mysqli_real_escape_string($conn, $_GET['studentid']);
    
    $delete_query = mysqli_query($conn, "DELETE FROM payments WHERE id = '$delete_id'");
    
    if ($delete_query) {
        header("location: payment_record.php?studentid=$studentid&msg=deleted");
        exit();
    } else {
        header("location: payment_record.php?studentid=$studentid&msg=error");
        exit();
    }
}

include "../include/config.php";
// ... rest of your code