getConnection(); $logDir = __DIR__ . '/logs/api/'; // Estrae un riassunto breve dell'errore dal file di log della commessa function extractErrorSummary(string $logDir, ?string $logFile): string { if (empty($logFile)) return ''; $path = $logDir . basename($logFile); if (!is_file($path)) return ''; $content = @file_get_contents($path); if ($content === false || $content === '') return ''; // 1) prova col "detail" del JSON del 500 if (preg_match('/"detail"\s*:\s*"([^"]+)"/', $content, $m)) { return trim(stripcslashes($m[1])); } // 2) fallback: ultima riga MESSAGE: if (preg_match_all('/^MESSAGE:\s*(.+)$/m', $content, $m) && !empty($m[1])) { return trim(end($m[1])); } return ''; } // Query: solo le righe in errore per questo template $userFilter = $show_all_users ? '' : 'AND d.user_id = ?'; $baseWhere = "WHERE d.templateid = ? AND d.status = 'x' {$userFilter}"; $baseParams = [$template_id]; if (!$show_all_users) $baseParams[] = $user_id; $countStmt = $pdo->prepare("SELECT COUNT(*) FROM datadb d {$baseWhere}"); $countStmt->execute($baseParams); $totalRows = (int)$countStmt->fetchColumn(); $totalPages = max(1, (int)ceil($totalRows / $perPage)); if ($page > $totalPages) $page = $totalPages; $stmt = $pdo->prepare(" SELECT d.*, CONCAT(u.first_name, ' ', u.last_name) AS user_name FROM datadb d LEFT JOIN auth_users u ON d.user_id = u.id {$baseWhere} ORDER BY d.export_date DESC, d.iddatadb DESC LIMIT {$perPage} OFFSET " . (($page - 1) * $perPage) . " "); $stmt->execute($baseParams); $rowsData = $stmt->fetchAll(PDO::FETCH_ASSOC); ?> Export Errors - <?= htmlspecialchars($titlewebsite ?? '', ENT_QUOTES, 'UTF-8'); ?>
Imported (i) To LIMS (l) Errors (x) ( of errori)
1): $pageQuery = $_GET; unset($pageQuery['page']); $pageBase = 'errors.php?' . http_build_query($pageQuery); ?>
Pagina di — righe
Export falliti verso il LIMS

Nessun errore di export. 🎉

Azioni Status Client Errore Data export File import
Error File