diff --git a/Dockerfile b/Dockerfile index c5e1386..a977949 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y \ RUN a2enmod rewrite # Copy application source -COPY . /var/www/html/ +COPY src/ /var/www/html/ # Set permissions for upload directory RUN mkdir -p /var/www/html/uploads/images && \ diff --git a/add_article.php b/src/add_article.php old mode 100755 new mode 100644 similarity index 95% rename from add_article.php rename to src/add_article.php index 768e015..0c3ca28 --- a/add_article.php +++ b/src/add_article.php @@ -209,6 +209,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $conn->close(); ?> + + + +

Neuen Artikel erstellen

@@ -348,6 +352,22 @@ document.addEventListener('DOMContentLoaded', function() { quantityOwnedInput.disabled = false; } }); + + // Initialize Tom Select for searchable dropdowns + const tsOptions = { + create: false, + sortField: { field: "text", direction: "asc" }, + onChange: function(value) { + // Force trigger change event for the "New" option toggle logic + const event = new Event('change'); + this.input.dispatchEvent(event); + } + }; + + if(document.getElementById('manufacturer_id')) new TomSelect('#manufacturer_id', tsOptions); + if(document.getElementById('category_id')) new TomSelect('#category_id', tsOptions); + if(document.getElementById('parent_article_id')) new TomSelect('#parent_article_id', tsOptions); + if(document.getElementById('storage_location_id')) new TomSelect('#storage_location_id', tsOptions); }); diff --git a/add_packing_list.php b/src/add_packing_list.php old mode 100755 new mode 100644 similarity index 100% rename from add_packing_list.php rename to src/add_packing_list.php diff --git a/api_packing_list_handler.php b/src/api_packing_list_handler.php old mode 100755 new mode 100644 similarity index 100% rename from api_packing_list_handler.php rename to src/api_packing_list_handler.php diff --git a/articles.php b/src/articles.php old mode 100755 new mode 100644 similarity index 100% rename from articles.php rename to src/articles.php diff --git a/assets/css/style.css b/src/assets/css/style.css similarity index 98% rename from assets/css/style.css rename to src/assets/css/style.css index 4ef2d41..558950b 100755 --- a/assets/css/style.css +++ b/src/assets/css/style.css @@ -460,9 +460,16 @@ body::before { .section-card { border: 1px solid rgba(0,0,0,0.08); border-radius: var(--border-radius-md); - overflow: hidden; /* Ensure header radius respects container */ + overflow: visible; /* Allow dropdowns to overflow */ background-color: var(--glass-bg); backdrop-filter: var(--glass-blur); + position: relative; + transition: z-index 0.1s step-start; /* Instant z-index change */ +} + +/* Lift card when interacting to ensure dropdowns appear over subsequent cards */ +.section-card:hover, .section-card:focus-within { + z-index: 10; } .section-card .card-header { @@ -470,10 +477,13 @@ body::before { color: var(--color-primary-dark); border-bottom: 1px solid rgba(0,0,0,0.05); font-weight: 700; + border-top-left-radius: var(--border-radius-md); + border-top-right-radius: var(--border-radius-md); } .section-card .card-body { background-color: transparent; + overflow: visible; /* Allow dropdowns to overflow */ } .paste-area { diff --git a/backpack_utils.php b/src/backpack_utils.php similarity index 100% rename from backpack_utils.php rename to src/backpack_utils.php diff --git a/backpacks.php b/src/backpacks.php old mode 100755 new mode 100644 similarity index 100% rename from backpacks.php rename to src/backpacks.php diff --git a/categories.php b/src/categories.php old mode 100755 new mode 100644 similarity index 100% rename from categories.php rename to src/categories.php diff --git a/db_connect.php b/src/db_connect.php similarity index 96% rename from db_connect.php rename to src/db_connect.php index 1ab0bb0..a565767 100644 --- a/db_connect.php +++ b/src/db_connect.php @@ -9,7 +9,7 @@ $dbname = getenv('DB_NAME'); // 2. Fallback: config.ini (Lokale Entwicklung) if (!$servername || !$username || !$dbname) { - $config_path = __DIR__ . '/config.ini'; + $config_path = __DIR__ . '/../config.ini'; if (file_exists($config_path)) { $config = parse_ini_file($config_path); if ($config) { diff --git a/delete_article.php b/src/delete_article.php old mode 100755 new mode 100644 similarity index 100% rename from delete_article.php rename to src/delete_article.php diff --git a/delete_packing_list.php b/src/delete_packing_list.php old mode 100755 new mode 100644 similarity index 100% rename from delete_packing_list.php rename to src/delete_packing_list.php diff --git a/duplicate_packing_list.php b/src/duplicate_packing_list.php old mode 100755 new mode 100644 similarity index 100% rename from duplicate_packing_list.php rename to src/duplicate_packing_list.php diff --git a/edit_article.php b/src/edit_article.php old mode 100755 new mode 100644 similarity index 96% rename from edit_article.php rename to src/edit_article.php index f0f7144..3804698 --- a/edit_article.php +++ b/src/edit_article.php @@ -260,6 +260,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && $can_edit) { $conn->close(); ?> + + + +

Artikel bearbeiten

@@ -422,6 +426,21 @@ document.addEventListener('DOMContentLoaded', function() { quantityOwnedInput.disabled = false; } }); + + // Initialize Tom Select + const tsOptions = { + create: false, + sortField: { field: "text", direction: "asc" }, + onChange: function(value) { + const event = new Event('change'); + this.input.dispatchEvent(event); + } + }; + + if(document.getElementById('manufacturer_id')) new TomSelect('#manufacturer_id', tsOptions); + if(document.getElementById('category_id')) new TomSelect('#category_id', tsOptions); + if(document.getElementById('parent_article_id')) new TomSelect('#parent_article_id', tsOptions); + if(document.getElementById('storage_location_id')) new TomSelect('#storage_location_id', tsOptions); }); diff --git a/edit_backpack.php b/src/edit_backpack.php old mode 100755 new mode 100644 similarity index 83% rename from edit_backpack.php rename to src/edit_backpack.php index ea8d8c6..662ac62 --- a/edit_backpack.php +++ b/src/edit_backpack.php @@ -90,10 +90,41 @@ if ($backpack_id > 0) { } } +// Load Manufacturers +$stmt_man_load = $conn->prepare("SELECT id, name FROM manufacturers WHERE user_id = ? ORDER BY name ASC"); +$stmt_man_load->bind_param("i", $user_id); +$stmt_man_load->execute(); +$manufacturers = $stmt_man_load->get_result()->fetch_all(MYSQLI_ASSOC); +$stmt_man_load->close(); + // Handle Form Submission BEFORE loading header if ($_SERVER['REQUEST_METHOD'] == 'POST') { $name = trim($_POST['name']); - $manufacturer = trim($_POST['manufacturer']); + + // Manufacturer Logic + $manufacturer = ''; + if (isset($_POST['manufacturer_select'])) { + if ($_POST['manufacturer_select'] === 'new') { + $new_man = trim($_POST['new_manufacturer_name']); + if (!empty($new_man)) { + // Optional: Save to manufacturers table for future use + $stmt_new_man = $conn->prepare("INSERT INTO manufacturers (name, user_id) VALUES (?, ?)"); + $stmt_new_man->bind_param("si", $new_man, $user_id); + $stmt_new_man->execute(); + $manufacturer = $new_man; + } + } else { + // Look up name from ID + $man_id = intval($_POST['manufacturer_select']); + foreach ($manufacturers as $m) { + if ($m['id'] == $man_id) { + $manufacturer = $m['name']; + break; + } + } + } + } + $model = trim($_POST['model']); $weight = intval($_POST['weight_grams']); $volume = intval($_POST['volume_liters']); @@ -212,9 +243,16 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { exit; } +// Handle Form Submission BEFORE loading header +// ... (existing logic) ... + require_once 'header.php'; ?> + + + +
@@ -237,7 +275,20 @@ require_once 'header.php';
- + +
@@ -324,6 +375,21 @@ require_once 'header.php'; diff --git a/edit_packing_list_details.php b/src/edit_packing_list_details.php old mode 100755 new mode 100644 similarity index 99% rename from edit_packing_list_details.php rename to src/edit_packing_list_details.php index 5a8b33b..cc31c62 --- a/edit_packing_list_details.php +++ b/src/edit_packing_list_details.php @@ -365,5 +365,4 @@ function selectBackpack(userId, bpId) { .bp-select-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); border-color: var(--color-primary); } - - \ No newline at end of file + \ No newline at end of file diff --git a/footer.php b/src/footer.php old mode 100755 new mode 100644 similarity index 100% rename from footer.php rename to src/footer.php diff --git a/header.php b/src/header.php old mode 100755 new mode 100644 similarity index 100% rename from header.php rename to src/header.php diff --git a/help.php b/src/help.php old mode 100755 new mode 100644 similarity index 100% rename from help.php rename to src/help.php diff --git a/household.php b/src/household.php old mode 100755 new mode 100644 similarity index 100% rename from household.php rename to src/household.php diff --git a/household_actions.php b/src/household_actions.php old mode 100755 new mode 100644 similarity index 100% rename from household_actions.php rename to src/household_actions.php diff --git a/index.php b/src/index.php old mode 100755 new mode 100644 similarity index 100% rename from index.php rename to src/index.php diff --git a/keinbild.png b/src/keinbild.png old mode 100755 new mode 100644 similarity index 100% rename from keinbild.png rename to src/keinbild.png diff --git a/login.php b/src/login.php old mode 100755 new mode 100644 similarity index 100% rename from login.php rename to src/login.php diff --git a/logo.png b/src/logo.png old mode 100755 new mode 100644 similarity index 100% rename from logo.png rename to src/logo.png diff --git a/logout.php b/src/logout.php old mode 100755 new mode 100644 similarity index 100% rename from logout.php rename to src/logout.php diff --git a/manage_packing_list_items.php b/src/manage_packing_list_items.php old mode 100755 new mode 100644 similarity index 92% rename from manage_packing_list_items.php rename to src/manage_packing_list_items.php index 2d91290..7385b1c --- a/manage_packing_list_items.php +++ b/src/manage_packing_list_items.php @@ -51,7 +51,7 @@ if ($current_user_household_id) { $placeholders = implode(',', array_fill(0, count($household_member_ids), '?')); $types = str_repeat('i', count($household_member_ids)); -$sql_all_articles = "SELECT a.id, a.name, a.weight_grams, a.quantity_owned, a.product_designation, a.consumable, a.parent_article_id, c.name as category_name, m.name as manufacturer_name +$sql_all_articles = "SELECT a.id, a.name, a.weight_grams, a.quantity_owned, a.product_designation, a.consumable, a.parent_article_id, a.image_url, c.name as category_name, m.name as manufacturer_name FROM articles a LEFT JOIN categories c ON a.category_id = c.id LEFT JOIN manufacturers m ON a.manufacturer_id = m.id @@ -150,6 +150,7 @@ $conn->close();
Änderungen gespeichert!
+