<?php
include '../includes/db.php';

echo "=== All Tables ===\n";
$tables = $pdo->query("SHOW TABLES")->fetchAll(PDO::FETCH_COLUMN);
foreach ($tables as $table) {
    if (stripos($table, 'judge') !== false) {
        echo "Found: $table\n";
    }
}

echo "\n=== Judge Assignment Columns ===\n";
$columns = $pdo->query("DESCRIBE judge_assignments")->fetchAll(PDO::FETCH_ASSOC);
foreach ($columns as $col) {
    echo "{$col['Field']} - {$col['Type']}\n";
}

echo "\n=== Check if judge info is in users table ===\n";
$users_stmt = $pdo->query("SELECT id, username, role FROM users WHERE role LIKE '%judge%' LIMIT 5");
foreach ($users_stmt->fetchAll(PDO::FETCH_ASSOC) as $user) {
    echo "User ID: {$user['id']}, Username: {$user['username']}, Role: {$user['role']}\n";
}
