From 03771e3ca8abb032d568f49486c35098adb09478 Mon Sep 17 00:00:00 2001 From: Martin Grigoryan Date: Fri, 31 Oct 2025 11:26:11 +0400 Subject: [PATCH] feat: Add quotation modal and iddatadb update for quotation parts/images - Add quotation modal for selecting quotation - Load quotation parts and photos - Update iddatadb with quotation parts and photo references --- public/userarea/load_quotations.php | 32 +++++ public/userarea/modal_partsTable.php | 27 ++++ public/userarea/partsTable.js | 126 +++++++++++++++++- public/userarea/save_parts_photo_iddatadb.php | 48 +++++++ 4 files changed, 227 insertions(+), 6 deletions(-) create mode 100644 public/userarea/load_quotations.php create mode 100644 public/userarea/save_parts_photo_iddatadb.php diff --git a/public/userarea/load_quotations.php b/public/userarea/load_quotations.php new file mode 100644 index 0000000..f850a75 --- /dev/null +++ b/public/userarea/load_quotations.php @@ -0,0 +1,32 @@ +getConnection(); + +// Recupera l'ID dell'utente loggato +$user_id = $iduserlogin ?? 1; + +if (!$user_id) { + echo json_encode(['success' => false, 'message' => "ID dell'utente autenticato mancante"]); + exit; +} + +try { + $stmt = $pdo->prepare( + "SELECT DISTINCT q.* + FROM quotations q + INNER JOIN identification_parts ip + ON ip.idquotations = q.id + AND ip.iddatadb IS NULL + WHERE q.iduser = :iduser" + ); + $stmt->execute([':iduser' => $user_id]); + $quotations = $stmt->fetchAll(PDO::FETCH_ASSOC); + + echo json_encode(['success' => true, 'quotations' => $quotations]); +} catch (PDOException $e) { + echo json_encode(['success' => false, 'message' => 'Errore nel caricamento delle quotations: ' . $e->getMessage()]); +} \ No newline at end of file diff --git a/public/userarea/modal_partsTable.php b/public/userarea/modal_partsTable.php index 697242d..59d7f13 100644 --- a/public/userarea/modal_partsTable.php +++ b/public/userarea/modal_partsTable.php @@ -14,6 +14,7 @@
+
+ +