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

// Fake session
session_start();
$_SESSION['user_id'] = 1;
$_SESSION['role'] = 'super_admin';

// Fake POST data
$_SERVER['REQUEST_METHOD'] = 'POST';
$_POST = [
    'student_id' => 32,
    'full_name' => 'Testing Student',
    'father_name' => 'tttt',
    'mother_name' => 'Test Mother',
    'roll_number' => '1234567890',
    'registration_number' => 'REG123',
    'course_name' => 'Test Course',
    'institution_name' => 'Test Inst',
    'exam_session' => '2023-2024',
    'exam_type' => 'Annual',
    'exam_centre' => 'Test Centre'
];
$_GET['id'] = 32;

// Override Auth to bypass redirect
require_once __DIR__ . '/../config.php';
require_once __DIR__ . '/../includes/db.php';
require_once __DIR__ . '/../includes/auth.php';

// Now include the edit script
// Since it has header("Location:..."), we might want to catch it or just let it redirect
try {
    ob_start();
    include __DIR__ . '/edit-admit-card-full.php';
    ob_end_clean();
    echo "SUCCESS";
} catch (\Throwable $e) {
    echo "ERROR: " . $e->getMessage();
}
