<?php
require_once '../../engine/engine.php';

$scanId = $_GET['scan_id'] ?? '';
if (!$scanId) {
	echo json_encode(['error' => 'Scan ID fehlt']);
	exit;
}

$stmt = $pdo->prepare("SELECT scanned_total, limit_count FROM scan_meta WHERE scan_id = ?");
$stmt->execute([$scanId]);
$data = $stmt->fetch(PDO::FETCH_ASSOC);

echo json_encode([
	'scanned' => (int)($data['scanned_total'] ?? 0),
	'total'   => (int)($data['limit_count'] ?? 0)
]);