<?php
require_once 'config/database.php';

echo "Available academic sessions:\n";
$stmt = $pdo->query("SELECT * FROM academic_sessions ORDER BY session_name DESC");
$sessions = $stmt->fetchAll();
foreach ($sessions as $s) {
    echo '- ID: ' . $s['id'] . ', Name: ' . $s['session_name'] . ', Status: ' . $s['status'] . ', Current: ' . $s['is_current'] . "\n";
}

echo "\nActive academic sessions:\n";
$stmt = $pdo->query("SELECT * FROM academic_sessions WHERE status='active' ORDER BY session_name DESC");
$sessions = $stmt->fetchAll();
foreach ($sessions as $s) {
    echo '- ID: ' . $s['id'] . ', Name: ' . $s['session_name'] . ', Status: ' . $s['status'] . ', Current: ' . $s['is_current'] . "\n";
}
?>