From 7a7b2fe67e534a3aea7b458b19980ee3e585a391 Mon Sep 17 00:00:00 2001 From: Gemini Date: Fri, 15 May 2026 15:28:08 +0000 Subject: [PATCH] Fix: SQL-Fehler in Artikelliste, Weiterleitungsfehler in Lagerorten und Header-Positionierung in Packlisten-Editor behoben --- src/articles.php | 4 ++-- src/manage_packing_list_items.php | 8 ++++++-- src/storage_locations.php | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/articles.php b/src/articles.php index c4eef7d..69b530c 100644 --- a/src/articles.php +++ b/src/articles.php @@ -121,8 +121,8 @@ $stmt_man_load->execute(); $manufacturers_for_filter = $stmt_man_load->get_result()->fetch_all(MYSQLI_ASSOC); $stmt_man_load->close(); -$stmt_loc_load = $conn->prepare("SELECT id, name FROM storage_locations WHERE user_id IN ($placeholders) OR household_id = ? ORDER BY name ASC"); -$stmt_loc_load->bind_param($all_types, ...$all_params); +$stmt_loc_load = $conn->prepare("SELECT id, name FROM storage_locations WHERE user_id IN ($placeholders) ORDER BY name ASC"); +$stmt_loc_load->bind_param($types, ...$household_member_ids); $stmt_loc_load->execute(); $storage_locations_for_bulk = $stmt_loc_load->get_result()->fetch_all(MYSQLI_ASSOC); $stmt_loc_load->close(); diff --git a/src/manage_packing_list_items.php b/src/manage_packing_list_items.php index 4308f3c..e9f0e54 100644 --- a/src/manage_packing_list_items.php +++ b/src/manage_packing_list_items.php @@ -10,7 +10,6 @@ if (!isset($_SESSION['user_id'])) { exit; } require_once 'db_connect.php'; -require_once 'header.php'; $current_user_id = $_SESSION['user_id']; $packing_list_id = isset($_GET['id']) ? intval($_GET['id']) : 0; @@ -49,6 +48,8 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['empty_table'])) { exit; } +require_once 'header.php'; + $col_class_lager = ($phase == 1) ? 'col-phase1-lager' : (($phase == 2) ? 'd-none' : 'col-lg-4'); $col_class_table = ($phase == 1) ? 'col-phase1-table' : (($phase == 2) ? 'col-lg-6' : 'col-lg-4'); $col_class_rucksack = ($phase == 2) ? 'col-lg-6' : (($phase == 1) ? 'd-none' : 'col-lg-4'); @@ -279,8 +280,11 @@ $conn->close();
-
+
Auf dem Tisch
+
+ +
diff --git a/src/storage_locations.php b/src/storage_locations.php index 4269149..5881802 100644 --- a/src/storage_locations.php +++ b/src/storage_locations.php @@ -13,6 +13,20 @@ if (!isset($_SESSION['user_id'])) { } require_once 'db_connect.php'; +// AKTION: BARCODE GENERIEREN +if (isset($_GET['action']) && $_GET['action'] == 'generate_barcode' && isset($_GET['id'])) { + $location_id = intval($_GET['id']); + $token = bin2hex(random_bytes(16)); + $stmt_token = $conn->prepare("UPDATE storage_locations SET public_token = ? WHERE id = ? AND user_id IN ($placeholders)"); + $all_params = array_merge([$token, $location_id], $household_member_ids); + $all_types = 'si' . $types; + $stmt_token->bind_param($all_types, ...$all_params); + $stmt_token->execute(); + $stmt_token->close(); + header("Location: storage_locations.php"); + exit; +} + require_once 'header.php'; $current_user_id = $_SESSION['user_id'];