$resultId, 'token' => $token )), true, 302); exit; } $bridgeUrl = faceai_build_url($config['backend_internal_url'] . '/bridge/results/' . rawurlencode($resultId), array( 'token' => $token )); $result = faceai_fetch_json($bridgeUrl); $matches = is_array($result['matches'] ?? null) ? $result['matches'] : array(); $photos = array_map(static function ($match) { $photoId = (string) ($match['photoId'] ?? ($match['id'] ?? '')); return array( 'id' => $photoId, 'photoId' => $photoId, 'label' => (string) ($match['label'] ?? $photoId), 'checkpoint' => (string) ($match['checkpoint'] ?? '-'), 'previewUrl' => (string) ($match['previewUrl'] ?? ''), 'score' => $match['score'] ?? null, ); }, $matches); faceai_sim_render_page(array( 'raceId' => (string) ($result['raceId'] ?? ($payload['raceId'] ?? '')), 'lang' => (string) ($result['lang'] ?? 'it'), 'raceSlug' => (string) ($result['raceId'] ?? ($payload['raceId'] ?? '')), 'raceName' => (string) ($result['raceName'] ?? ('Race ' . ($payload['raceId'] ?? ''))), 'returnUrl' => (string) ($result['returnUrl'] ?? 'faceai_simulator.php'), 'banner' => 'Vista filtrata da FaceAI. Sono state trovate ' . count($photos) . ' foto corrispondenti per l utente corrente.', 'totalLabel' => count($photos) . ' foto da FaceAI', 'photos' => $photos, 'showSimulatorBootstrap' => false )); } catch (Throwable $error) { faceai_render_message_page('Errore return FaceAI', $error->getMessage(), array(), 500); }