<?php
include 'config.php';

// Check pending registrations
echo "=== PENDING REGISTRATIONS ===\n";
$stmt = $conn->prepare("SELECT id, email, is_verified, expires_at, created_at FROM pending_registrations ORDER BY created_at DESC");
$stmt->execute();
$result = $stmt->get_result();

if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        echo "Email: " . $row['email'] . " | Verified: " . $row['is_verified'] . " | Created: " . $row['created_at'] . " | Expires: " . $row['expires_at'] . "\n";
    }
} else {
    echo "No pending registrations\n";
}
$stmt->close();

// Check registered users
echo "\n=== REGISTERED USERS ===\n";
$stmt = $conn->prepare("SELECT id, email, is_email_verified, created_at FROM users ORDER BY created_at DESC");
$stmt->execute();
$result = $stmt->get_result();

if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        echo "Email: " . $row['email'] . " | Verified: " . $row['is_email_verified'] . " | Created: " . $row['created_at'] . "\n";
    }
} else {
    echo "No users\n";
}
$stmt->close();
?>
