<?php
require_once __DIR__ . '/../../config/session.php';
require_once __DIR__ . '/../../config/db.php';
require_once __DIR__ . '/../../config/response.php';

require_login();

$stmt = $pdo->query("SELECT id, name, email, role, status, created_at, last_login_at FROM users WHERE is_deleted = 0 ORDER BY created_at DESC");
$users = $stmt->fetchAll();

jsonResponse(['success' => true, 'data' => $users]);
