From eef9ae8d36cd60f580e934fdec49c25d6f8a12e5 Mon Sep 17 00:00:00 2001 From: Claudio Date: Fri, 10 Oct 2025 11:31:49 +0200 Subject: [PATCH] added note to export --- public/userarea/export_to_lims.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/public/userarea/export_to_lims.php b/public/userarea/export_to_lims.php index aa2cca1..4ca7a8b 100644 --- a/public/userarea/export_to_lims.php +++ b/public/userarea/export_to_lims.php @@ -35,12 +35,11 @@ try { // 🔹 STEP 1+2: Fetch Cliente ID + Schema ID $stmt = $pdo->prepare(" - SELECT et.idclient AS clienteId, et.idschema AS schemaId - FROM datadb as d - INNER JOIN excel_templates as et ON d.templateid = et.id - WHERE d.iddatadb = :iddatadb - LIMIT 1 - "); + SELECT idclient AS clienteId, idschema AS schemaId + FROM datadb + WHERE iddatadb = :iddatadb + LIMIT 1 +"); $stmt->execute(['iddatadb' => $iddatadb]); $result = $stmt->fetch(PDO::FETCH_ASSOC); @@ -51,11 +50,11 @@ try { $clienteId = (int) $result['clienteId']; $schemaId = (int) $result['schemaId']; - // 🔹 STEP 3: Fetch Parts (including idmatrice) + // 🔹 STEP 3: Fetch Parts (including idmatrice and note) $stmt = $pdo->prepare(" - SELECT part_number, part_description, material, color, mix, idmatrice - FROM identification_parts - WHERE iddatadb = :iddatadb + SELECT part_number, part_description, material, color, mix, idmatrice, note + FROM identification_parts + WHERE iddatadb = :iddatadb "); $stmt->execute(['iddatadb' => $iddatadb]); $parts = $stmt->fetchAll(PDO::FETCH_ASSOC); @@ -135,7 +134,7 @@ try { "Matrice" => $matriceId, "SottoMatrice" => null, "SchemaCustomField" => $schemaId, - "NoteWeb" => $part["part_description"] ?? "" + "NoteWeb" => $part["note"] ?? "" // Modificato da part_description a note ]; // Costruisci curl-like per questo campione