<?php
require 'db.php';
require 'helpers.php';
require_committee();

if (!isset($_GET['id']) || !isset($_GET['student_id'])) {
    die('Invalid request');
}

$fee_id = (int)$_GET['id'];
$student_id = $_GET['student_id'];

// Soft delete other fee
$stmt = $mysqli1->prepare("UPDATE other_fees SET deleted_at = NOW() WHERE id = ?");
$stmt->bind_param("i", $fee_id);

if ($stmt->execute()) {
    header('Location: student_profile_admin.php?student_id=' . urlencode($student_id) . '&success=1');
} else {
    die('Error deleting other fee: ' . $mysqli1->error);
}