<?php
declare(strict_types=1);
require_once __DIR__ . '/../helpers.php';
$userId = as_int((string)($_GET['user_id'] ?? '0'));
require_view_all_user($userId);
$conn = db();
$result = $conn->query('SELECT id, full_name, username, role, created_at FROM users ORDER BY full_name ASC');
$data = [];
while ($row = $result->fetch_assoc()) $data[] = $row;
respond(['success' => true, 'data' => $data]);
