<?php
 require_once __DIR__ . '/config/config.php';
header('Content-Type: application/json');

$sql = "SELECT id, full_name, email, phone, account_balance, account_status FROM users ORDER BY id DESC";
$result = $conn->query($sql);

$users = [];
if ($result && $result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        $users[] = $row;
    }
}

echo json_encode(['success' => true, 'users' => $users]);
$conn->close();
