<?php
require_once 'config.php';
require_once 'includes/Database.php';

$db = new Database();
$users = $db->fetchAll('SELECT id, username, full_name, extension, is_active FROM users ORDER BY full_name');

echo "Kullanıcı Listesi:\n";
echo "==================\n";
foreach($users as $user) {
    echo $user['id'] . ' - ' . $user['full_name'] . ' (' . $user['extension'] . ') - Aktif: ' . ($user['is_active'] ? 'Evet' : 'Hayır') . "\n";
}

// Outgoing calls tablosundaki kullanıcıları da kontrol edelim
echo "\nOutgoing calls tablosundaki kullanıcılar:\n";
echo "=========================================\n";
$outgoingUsers = $db->fetchAll('SELECT DISTINCT user_id FROM outgoing_calls ORDER BY user_id');
foreach($outgoingUsers as $user) {
    echo "User ID: " . $user['user_id'] . "\n";
}
?>
