<?php
require_once '../../includes/config.php';
requireAdmin();
$count = $pdo->query("SELECT COUNT(DISTINCT user_id) FROM study_sessions WHERE created_at >= NOW() - INTERVAL 30 MINUTE")->fetchColumn();
header('Content-Type: application/json');
echo json_encode(['count' => (int)$count]);
