added note to export

This commit is contained in:
Claudio 2025-10-10 11:31:49 +02:00
parent 68c867a3f4
commit eef9ae8d36

View File

@ -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