From 8b08969c690fc4fffb5e3eae390809fd30dcf529 Mon Sep 17 00:00:00 2001 From: Claudio Date: Tue, 16 Sep 2025 11:39:44 +0200 Subject: [PATCH] get matrice --- public/userarea/get_matrice.php | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 public/userarea/get_matrice.php diff --git a/public/userarea/get_matrice.php b/public/userarea/get_matrice.php new file mode 100644 index 0000000..ed1be73 --- /dev/null +++ b/public/userarea/get_matrice.php @@ -0,0 +1,36 @@ + 100] + + // Debug: salva URL usato + $base_url = 'https://93.43.5.102/limsapi/api/odata/'; + $query = http_build_query($options); + $full_url = $base_url . $endpoint . ($query ? '?' . $query : ''); + file_put_contents(__DIR__ . '/last_url.txt', $full_url . PHP_EOL, FILE_APPEND); + + // Chiamata API + $data = $api->get($endpoint, $options); + + // Salva il JSON in locale + file_put_contents(__DIR__ . '/matrici_response.json', json_encode($data, JSON_PRETTY_PRINT)); + + echo json_encode($data); +} catch (Exception $e) { + file_put_contents(__DIR__ . '/error_log.txt', date('Y-m-d H:i:s') . ' - ' . $e->getMessage() . PHP_EOL, FILE_APPEND); + http_response_code(500); + echo json_encode(['error' => $e->getMessage()]); +}