<?php
require_once 'core/Database.php';

$stmt = db()->query("SELECT * FROM roles");
$roles = $stmt->fetchAll();

echo "ROLES TABLE:\n";
foreach ($roles as $role) {
    echo "ID: {$role['id']} | Tenant: {$role['tenant_id']} | Name: {$role['name']} | System: {$role['is_system']}\n";
}

$stmt = db()->query("SELECT id, name, role, role_id FROM users");
$users = $stmt->fetchAll();

echo "\nUSERS TABLE:\n";
foreach ($users as $user) {
    echo "ID: {$user['id']} | Name: {$user['name']} | Role (string): {$user['role']} | Role ID: ".($user['role_id'] ?? 'NULL')."\n";
}
