Bernd Wurst commited on 2026-09-02 13:34:15
Zeige 12 geänderte Dateien mit 423 Einfügungen und 126 Löschungen.
| ... | ... |
@@ -0,0 +1,93 @@ |
| 1 |
+document.addEventListener('DOMContentLoaded', function () {
|
|
| 2 |
+ const jaBtn = document.getElementById('btn-kartonsja');
|
|
| 3 |
+ const btnNextStep = document.getElementById('btnNextStep');
|
|
| 4 |
+ const btnBackToModal1 = document.getElementById('btnBackToModal1');
|
|
| 5 |
+ const btnSubmitFinal = document.getElementById('btnSubmitFinal');
|
|
| 6 |
+ const mainForm = document.getElementById('mainForm');
|
|
| 7 |
+ |
|
| 8 |
+ const modal1 = new bootstrap.Modal(document.getElementById('groessenModal'));
|
|
| 9 |
+ const modal2 = new bootstrap.Modal(document.getElementById('prioModal'));
|
|
| 10 |
+ |
|
| 11 |
+ jaBtn.addEventListener('click', function () {
|
|
| 12 |
+ modal1.show(); |
|
| 13 |
+ }); |
|
| 14 |
+ |
|
| 15 |
+ btnNextStep.addEventListener('click', function () {
|
|
| 16 |
+ const selected = []; |
|
| 17 |
+ if (document.getElementById('check3er').checked) selected.push({ id: '3er', label: '3er Kartons' });
|
|
| 18 |
+ if (document.getElementById('check5er').checked) selected.push({ id: '5er', label: '5er Kartons' });
|
|
| 19 |
+ if (document.getElementById('check10er').checked) selected.push({ id: '10er', label: '10er Kartons' });
|
|
| 20 |
+ |
|
| 21 |
+ // Werte in deine originalen Hidden-Fields schreiben |
|
| 22 |
+ document.getElementById('input_3er').value = document.getElementById('check3er').checked ? '1' : '0';
|
|
| 23 |
+ document.getElementById('input_5er').value = document.getElementById('check5er').checked ? '1' : '0';
|
|
| 24 |
+ document.getElementById('input_10er').value = document.getElementById('check10er').checked ? '1' : '0';
|
|
| 25 |
+ |
|
| 26 |
+ if (selected.length > 1) {
|
|
| 27 |
+ buildPrioOptions(selected); |
|
| 28 |
+ modal1.hide(); |
|
| 29 |
+ modal2.show(); |
|
| 30 |
+ } else {
|
|
| 31 |
+ document.getElementById('input_prio').value = selected.length === 1 ? selected[0].id : '';
|
|
| 32 |
+ submitForm(); |
|
| 33 |
+ } |
|
| 34 |
+ }); |
|
| 35 |
+ |
|
| 36 |
+ btnBackToModal1.addEventListener('click', function () {
|
|
| 37 |
+ modal2.hide(); |
|
| 38 |
+ modal1.show(); |
|
| 39 |
+ }); |
|
| 40 |
+ |
|
| 41 |
+ btnSubmitFinal.addEventListener('click', function () {
|
|
| 42 |
+ const checkedPrio = document.querySelector('input[name="prioRadio"]:checked');
|
|
| 43 |
+ if (!checkedPrio) {
|
|
| 44 |
+ alert('Bitte wählen Sie eine Größe aus, die zuerst benutzt werden soll.');
|
|
| 45 |
+ return; |
|
| 46 |
+ } |
|
| 47 |
+ document.getElementById('input_prio').value = checkedPrio.value;
|
|
| 48 |
+ submitForm(); |
|
| 49 |
+ }); |
|
| 50 |
+ |
|
| 51 |
+ function buildPrioOptions(items) {
|
|
| 52 |
+ const container = document.getElementById('prioOptionsContainer');
|
|
| 53 |
+ container.innerHTML = ''; |
|
| 54 |
+ |
|
| 55 |
+ // Aktuell gespeicherten Wert aus dem Hidden-Field auslesen |
|
| 56 |
+ const currentPrio = document.getElementById('input_prio').value;
|
|
| 57 |
+ |
|
| 58 |
+ items.forEach((item, index) => {
|
|
| 59 |
+ const inputId = 'prio_' + item.id; |
|
| 60 |
+ |
|
| 61 |
+ const input = document.createElement('input');
|
|
| 62 |
+ input.type = 'radio'; |
|
| 63 |
+ input.className = 'btn-check'; |
|
| 64 |
+ input.name = 'prioRadio'; |
|
| 65 |
+ input.id = inputId; |
|
| 66 |
+ input.value = item.id; |
|
| 67 |
+ input.autocomplete = 'off'; |
|
| 68 |
+ |
|
| 69 |
+ // Prüfung: Passt die ID zum Wert im Hidden-Field? |
|
| 70 |
+ // Falls nichts gespeichert ist, nimmt er den ersten Eintrag als Standard. |
|
| 71 |
+ if (currentPrio === item.id || (!currentPrio && index === 0)) {
|
|
| 72 |
+ input.checked = true; |
|
| 73 |
+ } |
|
| 74 |
+ |
|
| 75 |
+ const label = document.createElement('label');
|
|
| 76 |
+ label.className = 'btn btn-outline-primary btn-lg p-3 fs-3 fw-bold'; |
|
| 77 |
+ label.htmlFor = inputId; |
|
| 78 |
+ label.innerText = item.label + ' zuerst benutzen'; |
|
| 79 |
+ |
|
| 80 |
+ container.appendChild(input); |
|
| 81 |
+ container.appendChild(label); |
|
| 82 |
+ }); |
|
| 83 |
+ } |
|
| 84 |
+ |
|
| 85 |
+ function submitForm() {
|
|
| 86 |
+ const hiddenJa = document.createElement('input');
|
|
| 87 |
+ hiddenJa.type = 'hidden'; |
|
| 88 |
+ hiddenJa.name = 'kartonsja'; |
|
| 89 |
+ hiddenJa.value = 'Ja'; |
|
| 90 |
+ mainForm.appendChild(hiddenJa); |
|
| 91 |
+ mainForm.submit(); |
|
| 92 |
+ } |
|
| 93 |
+}); |
| ... | ... |
@@ -22,4 +22,29 @@ document.addEventListener('DOMContentLoaded', function() {
|
| 22 | 22 |
}, 300); // 300ms Verzögerung, kann je nach Gerät angepasst werden |
| 23 | 23 |
}); |
| 24 | 24 |
}); |
| 25 |
+ |
|
| 26 |
+ // JavaScript |
|
| 27 |
+ const boxInput = document.getElementById('box_label');
|
|
| 28 |
+ const infoBox = document.getElementById('noNumberInfo');
|
|
| 29 |
+ const btnText = document.getElementById('btnText');
|
|
| 30 |
+ const btnIcon = document.getElementById('btnIcon');
|
|
| 31 |
+ const divider = document.getElementById('divider');
|
|
| 32 |
+ |
|
| 33 |
+ boxInput.addEventListener('input', function() {
|
|
| 34 |
+ const value = this.value.trim(); |
|
| 35 |
+ |
|
| 36 |
+ if (value !== '') {
|
|
| 37 |
+ // Eingabe vorhanden: Hinweis ausblenden, Button anpassen |
|
| 38 |
+ infoBox.classList.add('d-none');
|
|
| 39 |
+ divider.classList.add('d-none'); // Trenner ausblenden
|
|
| 40 |
+ btnText.textContent = `Box ${value} wählen`;
|
|
| 41 |
+ btnIcon.classList.add('d-none'); // Optional: Plus-Icon ausblenden
|
|
| 42 |
+ } else {
|
|
| 43 |
+ // Eingabe leer: Hinweis anzeigen, Standard-Text setzen |
|
| 44 |
+ infoBox.classList.remove('d-none');
|
|
| 45 |
+ divider.classList.remove('d-none'); // Trenner wieder anzeigen
|
|
| 46 |
+ btnText.textContent = 'Box mit Namen beschriftet'; |
|
| 47 |
+ btnIcon.classList.remove('d-none');
|
|
| 48 |
+ } |
|
| 49 |
+ }); |
|
| 25 | 50 |
}); |
| ... | ... |
@@ -26,7 +26,8 @@ function idleAlert() {
|
| 26 | 26 |
$(document).ready( function () {
|
| 27 | 27 |
$('body').fadeIn(200);
|
| 28 | 28 |
document.body.scrollIntoView(); |
| 29 |
- if ($('input[name=form]').val() != 'start') {
|
|
| 29 |
+ var path = window.location.pathname; |
|
| 30 |
+ if (!(path.endsWith('index.php') || path === '/')) {
|
|
| 30 | 31 |
// Wenn nicht auf der Startseite, dann nach der Wartezeit fragen wie man weiter machen möchte. |
| 31 | 32 |
setTimeout(idleAlert, idleTimeout); |
| 32 | 33 |
} |
| ... | ... |
@@ -112,6 +112,73 @@ h1, h2, h3 {
|
| 112 | 112 |
} |
| 113 | 113 |
|
| 114 | 114 |
|
| 115 |
+/* 1. Standard-Zustand (Sieht aus wie ein Button) */ |
|
| 116 |
+ .custom-floating-btn .form-control {
|
|
| 117 |
+ background-color: #0d6efd; |
|
| 118 |
+ border-color: #0d6efd; |
|
| 119 |
+ color: #ffffff !important; |
|
| 120 |
+ cursor: pointer; |
|
| 121 |
+ transition: all 0.2s ease-in-out; |
|
| 122 |
+ } |
|
| 123 |
+ |
|
| 124 |
+ /* Label weiß einfärben im Button-Zustand */ |
|
| 125 |
+ .custom-floating-btn label {
|
|
| 126 |
+ color: #ffffff !important; |
|
| 127 |
+ transition: all 0.2s ease-in-out; |
|
| 128 |
+ } |
|
| 129 |
+ |
|
| 130 |
+ /* Pfeile bei type="number" weiß machen */ |
|
| 131 |
+ .custom-floating-btn .form-control::-webkit-inner-spin-button, |
|
| 132 |
+ .custom-floating-btn .form-control::-webkit-outer-spin-button {
|
|
| 133 |
+ filter: invert(1); |
|
| 134 |
+ } |
|
| 135 |
+ |
|
| 136 |
+ /* Hover-Effekt */ |
|
| 137 |
+ .custom-floating-btn:hover .form-control {
|
|
| 138 |
+ background-color: #0b5ed7; |
|
| 139 |
+ border-color: #0a58ca; |
|
| 140 |
+ } |
|
| 141 |
+ |
|
| 142 |
+ /* 2. Fokus-Zustand & wenn Text eingegeben wurde */ |
|
| 143 |
+ .custom-floating-btn .form-control:focus, |
|
| 144 |
+ .custom-floating-btn .form-control:not(:placeholder-shown) {
|
|
| 145 |
+ background-color: #ffffff; |
|
| 146 |
+ border-color: #86b7fe; |
|
| 147 |
+ color: #212529 !important; |
|
| 148 |
+ cursor: text; |
|
| 149 |
+ } |
|
| 150 |
+ |
|
| 151 |
+ /* Label wieder dunkel färben, wenn fokussiert oder ausgefüllt */ |
|
| 152 |
+ .custom-floating-btn .form-control:focus ~ label, |
|
| 153 |
+ .custom-floating-btn .form-control:not(:placeholder-shown) ~ label {
|
|
| 154 |
+ color: #6c757d !important; |
|
| 155 |
+ } |
|
| 156 |
+ |
|
| 157 |
+ /* Pfeile bei Fokus wieder normal stellen */ |
|
| 158 |
+ .custom-floating-btn .form-control:focus::-webkit-inner-spin-button, |
|
| 159 |
+ .custom-floating-btn .form-control:focus::-webkit-outer-spin-button {
|
|
| 160 |
+ filter: none; |
|
| 161 |
+ } |
|
| 162 |
+ /* CSS */ |
|
| 163 |
+.divider-with-text {
|
|
| 164 |
+ display: flex; |
|
| 165 |
+ align-items: center; |
|
| 166 |
+ text-align: center; |
|
| 167 |
+ color: #6c757d; |
|
| 168 |
+ font-size: 0.875rem; |
|
| 169 |
+} |
|
| 170 |
+ |
|
| 171 |
+.divider-with-text::before, |
|
| 172 |
+.divider-with-text::after {
|
|
| 173 |
+ content: ''; |
|
| 174 |
+ flex: 1; |
|
| 175 |
+ border-bottom: 1px solid #dee2e6; |
|
| 176 |
+} |
|
| 177 |
+ |
|
| 178 |
+.divider-with-text span {
|
|
| 179 |
+ padding: 0 0.75rem; |
|
| 180 |
+} |
|
| 181 |
+ |
|
| 115 | 182 |
|
| 116 | 183 |
.modal-body.terms {
|
| 117 | 184 |
text-align: left; |
| ... | ... |
@@ -183,21 +250,6 @@ input[type=submit] {
|
| 183 | 250 |
background-position: center 10px; |
| 184 | 251 |
} |
| 185 | 252 |
|
| 186 |
-#btn-kartonsja {
|
|
| 187 |
- min-width: 280px; |
|
| 188 |
- padding-top: 170px; |
|
| 189 |
- background-image: url("images/kartons.png");
|
|
| 190 |
- background-repeat: no-repeat; |
|
| 191 |
- background-position: center 10px; |
|
| 192 |
-} |
|
| 193 |
- |
|
| 194 |
-#btn-kartonsnein {
|
|
| 195 |
- min-width: 280px; |
|
| 196 |
- padding-top: 170px; |
|
| 197 |
- background-image: url("images/keinekartons.png");
|
|
| 198 |
- background-repeat: no-repeat; |
|
| 199 |
- background-position: center 10px; |
|
| 200 |
-} |
|
| 201 | 253 |
|
| 202 | 254 |
#btn-frischsaftja {
|
| 203 | 255 |
min-width: 280px; |
| ... | ... |
@@ -13,22 +13,85 @@ if (isset($_REQUEST['error'])) {
|
| 13 | 13 |
|
| 14 | 14 |
|
| 15 | 15 |
$content .= ' |
| 16 |
- <form class="form" action="save.php" method="post"> |
|
| 16 |
+<form class="form" id="mainForm" action="save.php" method="post"> |
|
| 17 | 17 |
<input type="hidden" name="form" value="gebrauchte"> |
| 18 |
- '; |
|
| 19 |
- if (isset($_SESSION['angeliefert']) && $_SESSION['angeliefert'] === false) {
|
|
| 20 |
- $content .= '<p>Werden Sie gebrauchte Bag-in-Box-Kartons mitbringen?</p>'; |
|
| 21 |
- } else {
|
|
| 22 |
- $content .= '<p>Haben Sie <strong>gebrauchte Bag-in-Box-Kartons</strong> mitgebracht und bei uns unter Dach gestellt?</p>'; |
|
| 23 |
- } |
|
| 24 |
-$content .= ' |
|
| 25 |
- <div class="form-group form-group-lg row"> |
|
| 26 |
- <div class="col-sm-6 d-grid"><input type="submit" class="btn btn-lg btn-light" id="btn-kartonsja" name="kartonsja" value="Ja"></div> |
|
| 27 |
- <div class="col-sm-6 d-grid"><input type="submit" class="btn btn-lg btn-light" id="btn-kartonsnein" name="kartonsnein" value="Nein"></div> |
|
| 18 |
+ <!-- Exakt deine Hidden-Inputs für PHP --> |
|
| 19 |
+ <input type="hidden" name="gebrauchte_3er" id="input_3er" value="'.(($_SESSION['gebrauchte_3er'] ?? false) ? '1' : '0').'"> |
|
| 20 |
+ <input type="hidden" name="gebrauchte_5er" id="input_5er" value="'.(($_SESSION['gebrauchte_5er'] ?? false) ? '1' : '0').'"> |
|
| 21 |
+ <input type="hidden" name="gebrauchte_10er" id="input_10er" value="'.(($_SESSION['gebrauchte_10er'] ?? false) ? '1' : '0').'"> |
|
| 22 |
+ <input type="hidden" name="gebrauchte_prio" id="input_prio" value="'.htmlspecialchars($_SESSION['gebrauchte_prio'] ?? '').'"> |
|
| 23 |
+ |
|
| 24 |
+ <p>Haben Sie <strong>gebrauchte Bag-in-Box-Kartons</strong> mitgebracht und bei uns unter Dach gestellt?</p> |
|
| 25 |
+ |
|
| 26 |
+ <div class="form-group form-group-lg row g-3"> |
|
| 27 |
+ <!-- Ja-Button mit deinen Bildern und IDs --> |
|
| 28 |
+ <div class="col-sm-6 d-grid"> |
|
| 29 |
+ <button type="button" class="btn btn-lg btn-light p-3 d-flex flex-column align-items-center justify-content-center" id="btn-kartonsja"> |
|
| 30 |
+ <img src="assets/images/kartons.png" alt="Ja" class="img-fluid mb-2" style="max-height: 120px;"> |
|
| 31 |
+ <span class="fs-2">Ja</span> |
|
| 32 |
+ </button> |
|
| 28 | 33 |
</div> |
| 29 | 34 |
|
| 35 |
+ <!-- Nein-Button --> |
|
| 36 |
+ <div class="col-sm-6 d-grid"> |
|
| 37 |
+ <button type="submit" class="btn btn-lg btn-light p-3 d-flex flex-column align-items-center justify-content-center" id="btn-kartonsnein" name="kartonsnein" value="Nein"> |
|
| 38 |
+ <img src="assets/images/keinekartons.png" alt="Nein" class="img-fluid mb-2" style="max-height: 120px;"> |
|
| 39 |
+ <span class="fs-2">Nein</span> |
|
| 40 |
+ </button> |
|
| 41 |
+ </div> |
|
| 42 |
+ </div> |
|
| 30 | 43 |
</form> |
| 31 | 44 |
|
| 45 |
+<!-- MODAL 1: Größenauswahl --> |
|
| 46 |
+<div class="modal fade" id="groessenModal" tabindex="-1" aria-labelledby="groessenModalLabel" aria-hidden="true"> |
|
| 47 |
+ <div class="modal-dialog modal-dialog-centered"> |
|
| 48 |
+ <div class="modal-content"> |
|
| 49 |
+ <div class="modal-header"> |
|
| 50 |
+ <h5 class="modal-title fs-4 fw-bold" id="groessenModalLabel">Welche Karton-Größen haben Sie abgestellt?</h5> |
|
| 51 |
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Schließen"></button> |
|
| 52 |
+ </div> |
|
| 53 |
+ <div class="modal-body"> |
|
| 54 |
+ <p class="text-muted mb-3">Mehrfachauswahl möglich:</p> |
|
| 55 |
+ <div class="d-grid gap-3"> |
|
| 56 |
+ <input type="checkbox" class="btn-check" id="check3er" autocomplete="off" '.(!empty($_SESSION['gebrauchte_3er']) ? 'checked' : '').'> |
|
| 57 |
+ <label class="btn btn-outline-success btn-lg p-3 fs-3 fw-bold" for="check3er">3er Kartons</label> |
|
| 58 |
+ |
|
| 59 |
+ <input type="checkbox" class="btn-check" id="check5er" autocomplete="off" '.(!empty($_SESSION['gebrauchte_5er']) ? 'checked' : '').'> |
|
| 60 |
+ <label class="btn btn-outline-success btn-lg p-3 fs-3 fw-bold" for="check5er">5er Kartons</label> |
|
| 61 |
+ |
|
| 62 |
+ <input type="checkbox" class="btn-check" id="check10er" autocomplete="off" '.(!empty($_SESSION['gebrauchte_10er']) ? 'checked' : '').'> |
|
| 63 |
+ <label class="btn btn-outline-success btn-lg p-3 fs-3 fw-bold" for="check10er">10er Kartons</label> |
|
| 64 |
+ </div> |
|
| 65 |
+ </div> |
|
| 66 |
+ <div class="modal-footer"> |
|
| 67 |
+ <button type="button" class="btn btn-secondary btn-lg" data-bs-dismiss="modal">Abbrechen</button> |
|
| 68 |
+ <button type="button" class="btn btn-primary btn-lg px-4" id="btnNextStep">Weiter</button> |
|
| 69 |
+ </div> |
|
| 70 |
+ </div> |
|
| 71 |
+ </div> |
|
| 72 |
+</div> |
|
| 73 |
+ |
|
| 74 |
+<!-- MODAL 2: Prioritätsauswahl --> |
|
| 75 |
+<div class="modal fade" id="prioModal" tabindex="-1" aria-labelledby="prioModalLabel" aria-hidden="true"> |
|
| 76 |
+ <div class="modal-dialog modal-dialog-centered"> |
|
| 77 |
+ <div class="modal-content"> |
|
| 78 |
+ <div class="modal-header"> |
|
| 79 |
+ <h5 class="modal-title fs-4 fw-bold" id="prioModalLabel">Welche Größe soll ZUERST befüllt werden?</h5> |
|
| 80 |
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Schließen"></button> |
|
| 81 |
+ </div> |
|
| 82 |
+ <div class="modal-body"> |
|
| 83 |
+ <p class="text-muted mb-3">Bitte wählen Sie Ihre bevorzugte Größe:</p> |
|
| 84 |
+ <div class="d-grid gap-3" id="prioOptionsContainer"> |
|
| 85 |
+ <!-- Wird dynamisch per JS befüllt --> |
|
| 86 |
+ </div> |
|
| 87 |
+ </div> |
|
| 88 |
+ <div class="modal-footer"> |
|
| 89 |
+ <button type="button" class="btn btn-secondary btn-lg" id="btnBackToModal1">Zurück</button> |
|
| 90 |
+ <button type="button" class="btn btn-primary btn-lg px-4" id="btnSubmitFinal">Weiter</button> |
|
| 91 |
+ </div> |
|
| 92 |
+ </div> |
|
| 93 |
+ </div> |
|
| 94 |
+</div> |
|
| 32 | 95 |
'; |
| 33 | 96 |
|
| 34 | 97 |
|
| ... | ... |
@@ -1,5 +1,8 @@ |
| 1 | 1 |
<?php |
| 2 | 2 |
require_once "utils.php"; |
| 3 |
+ |
|
| 4 |
+$boxnummern = true; |
|
| 5 |
+ |
|
| 3 | 6 |
session_start(); |
| 4 | 7 |
if ((isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'local') || |
| 5 | 8 |
(isset($_COOKIE['MODE']) && $_COOKIE['MODE'] == 'local')) {
|
| ... | ... |
@@ -39,12 +42,13 @@ if (isset($_REQUEST['error'])) {
|
| 39 | 42 |
$add_container_buttons = ''; |
| 40 | 43 |
$add_container_buttons .= '<div class="d-grid gap-4">'; // Bootstrap Stack für vertikale Buttons |
| 41 | 44 |
|
| 42 |
-if ($_SESSION['mode'] == 'remote') {
|
|
| 45 |
+if ($_SESSION['mode'] == 'remote' && $boxnummern) {
|
|
| 43 | 46 |
// 1. QR-Code scannen (Leitet auf eine Seite mit Kamera-Logik) |
| 44 | 47 |
$add_container_buttons .= '<a href="scan_container.php" class="btn btn-primary btn-lg">'; |
| 45 | 48 |
$add_container_buttons .= '<i class="fas fa-qrcode me-2"></i> QR-Code von Box scannen</a>'; |
| 46 | 49 |
} |
| 47 | 50 |
// 2. Nummer manuell eingeben |
| 51 |
+if ($boxnummern) {
|
|
| 48 | 52 |
$add_container_buttons .= ' |
| 49 | 53 |
<div class="form-group form-group-lg row"> |
| 50 | 54 |
<div class="col-sm-6 d-grid"><button type="button" id="btn-gitterbox" class="btn btn-lg btn-light" data-bs-toggle="modal" data-bs-target="#manualBoxModal"> |
| ... | ... |
@@ -52,7 +56,15 @@ $add_container_buttons .= ' |
| 52 | 56 |
<div class="col-sm-6 d-grid"><button type="button" id="btn-anhaenger" class="btn btn-lg btn-light" data-bs-toggle="modal" data-bs-target="#trailerModal"> |
| 53 | 57 |
Anhänger abgestellt</a></div> |
| 54 | 58 |
</div>'; |
| 55 |
- |
|
| 59 |
+} else {
|
|
| 60 |
+ $add_container_buttons .= ' |
|
| 61 |
+ <div class="form-group form-group-lg row"> |
|
| 62 |
+ <div class="col-sm-6 d-grid"><a href="save.php?form=add_container&type=box&label=" id="btn-gitterbox" class="btn btn-lg btn-light"> |
|
| 63 |
+ Gitterbox</a></div> |
|
| 64 |
+ <div class="col-sm-6 d-grid"><button type="button" id="btn-anhaenger" class="btn btn-lg btn-light" data-bs-toggle="modal" data-bs-target="#trailerModal"> |
|
| 65 |
+ Anhänger abgestellt</a></div> |
|
| 66 |
+ </div>'; |
|
| 67 |
+} |
|
| 56 | 68 |
$add_container_buttons .= '</div>'; // Ende d-grid |
| 57 | 69 |
|
| 58 | 70 |
|
| ... | ... |
@@ -97,7 +109,7 @@ if (isset($_REQUEST['box']) && is_numeric($_REQUEST['box'])) {
|
| 97 | 109 |
|
| 98 | 110 |
// Anzeige des Typs (Box mit Nummer, ohne Nummer oder Anhänger) |
| 99 | 111 |
$label = ($box['type'] == 'trailer') ? 'Anhänger ' . $box['label'] : 'Box ' . $box['label']; |
| 100 |
- if ($box['type'] == 'box' && $box['label'] == '') { $label = 'Box ohne Nummer'; }
|
|
| 112 |
+ if ($box['type'] == 'box' && $box['label'] == '') { $label = ($boxnummern ? 'Box mit Namensschild' : 'Gitterbox'); }
|
|
| 101 | 113 |
|
| 102 | 114 |
// Auswahl des Bildchens je nach Typ |
| 103 | 115 |
$iconPath = ($box['type'] == 'trailer') ? 'assets/icons/trailer.svg' : 'assets/icons/box.svg'; |
| ... | ... |
@@ -157,21 +169,40 @@ $content .= ' |
| 157 | 169 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Schließen"></button> |
| 158 | 170 |
</div> |
| 159 | 171 |
|
| 172 |
+ <!-- HTML --> |
|
| 160 | 173 |
<div class="modal-body"> |
| 161 |
- <p>Bitte geben Sie die Nummer ein, die auf der Box steht:</p> |
|
| 162 |
- <div class="form-floating mb-3"> |
|
| 163 |
- <input type="number" class="form-control form-control-lg" id="box_label" name="label" placeholder="123" autofocus> |
|
| 164 |
- <label for="box_label">Box-Nummer</label> |
|
| 174 |
+ <p class="text-center">Bitte geben Sie die Nummer ein, die auf der Box steht:</p> |
|
| 175 |
+ |
|
| 176 |
+ <div class="form-floating custom-floating-btn mb-3"> |
|
| 177 |
+ <input |
|
| 178 |
+ type="number" |
|
| 179 |
+ class="form-control text-center" |
|
| 180 |
+ id="box_label" |
|
| 181 |
+ name="label" |
|
| 182 |
+ placeholder="Box-Nummer" |
|
| 183 |
+ > |
|
| 184 |
+ <label for="box_label" class="w-100 text-center">Box-Nummer</label> |
|
| 185 |
+ </div> |
|
| 186 |
+ |
|
| 187 |
+<div id="divider" class="divider-with-text my-3"> |
|
| 188 |
+ <span>oder</span> |
|
| 189 |
+</div> |
|
| 190 |
+ |
|
| 191 |
+ <!-- Alternativ-Hinweis mit Bild --> |
|
| 192 |
+ <div id="noNumberInfo" class="d-flex align-items-center justify-content-between gap-2 my-3"> |
|
| 193 |
+ |
|
| 194 |
+ <span class="small text-muted">Alternativ können Sie auch Ihren Namen an der Box anbringen:</span> |
|
| 195 |
+ <img src="assets/images/namensschild.png" alt="Namensschild" style="width: 133px; height: 42px; object-fit: contain;"> |
|
| 165 | 196 |
</div> |
| 166 |
- <p>Wenn Sie die Nummer leer lassen, müssen Sie Ihren Namen an der Box anbringen!</p> |
|
| 167 | 197 |
</div> |
| 168 | 198 |
|
| 169 | 199 |
<div class="modal-footer"> |
| 170 | 200 |
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Abbrechen</button> |
| 171 | 201 |
<button type="submit" class="btn btn-primary"> |
| 172 |
- <i class="fas fa-plus me-2"></i> Box hinzufügen |
|
| 202 |
+ <span id="btnText">Box mit Namen beschriftet</span> |
|
| 173 | 203 |
</button> |
| 174 | 204 |
</div> |
| 205 |
+ |
|
| 175 | 206 |
</form> |
| 176 | 207 |
</div> |
| 177 | 208 |
</div> |
| ... | ... |
@@ -197,12 +228,21 @@ $content .= ' |
| 197 | 228 |
<input type="text" class="form-control form-control-lg" id="trailer_label" name="label" placeholder="WN-AB 123" autofocus> |
| 198 | 229 |
<label for="trailer_label">Kennzeichen (optional)</label> |
| 199 | 230 |
</div> |
| 231 |
+<div id="divider" class="divider-with-text my-3"> |
|
| 232 |
+ <span>oder</span> |
|
| 200 | 233 |
</div> |
| 201 | 234 |
|
| 235 |
+ <!-- Alternativ-Hinweis mit Bild --> |
|
| 236 |
+ <div id="noNumberInfo" class="d-flex align-items-center justify-content-between gap-2 my-3"> |
|
| 237 |
+ |
|
| 238 |
+ <span class="small text-muted">Alternativ können Sie auch Ihren Namen mit einem Magnetschild anbringen:</span> |
|
| 239 |
+ <img src="assets/images/namensschild.png" alt="Namensschild" style="width: 133px; height: 42px; object-fit: contain;"> |
|
| 240 |
+ </div> |
|
| 241 |
+ </div> |
|
| 202 | 242 |
<div class="modal-footer"> |
| 203 | 243 |
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Abbrechen</button> |
| 204 | 244 |
<button type="submit" class="btn btn-primary"> |
| 205 |
- <i class="fas fa-plus me-2"></i> Anhänger hinzufügen |
|
| 245 |
+ Anhänger hinzufügen |
|
| 206 | 246 |
</button> |
| 207 | 247 |
</div> |
| 208 | 248 |
</form> |
| ... | ... |
@@ -44,7 +44,7 @@ if (isset($_REQUEST['noremember'])) {
|
| 44 | 44 |
|
| 45 | 45 |
$content .= ' |
| 46 | 46 |
<p>Bitte teilen Sie uns Ihren <strong>Namen</strong> und Ihre <strong>Telefonnummer</strong> mit, damit wir prüfen können, ob wir Sie schon kennen.</p> |
| 47 |
- <form class="form row g-3 d-flex" action="save.php" method="post"> |
|
| 47 |
+ <form class="form row g-3 d-flex mb-4" action="save.php" method="post"> |
|
| 48 | 48 |
<input type="hidden" name="form" value="customer"> |
| 49 | 49 |
<div class="col-md-9"> |
| 50 | 50 |
<div class="row form-group form-group-lg g-2 mb-2"> |
| ... | ... |
@@ -84,39 +84,6 @@ $content .= '</div> |
| 84 | 84 |
</div> |
| 85 | 85 |
</div> |
| 86 | 86 |
</form> |
| 87 |
- |
|
| 88 |
- <div class="card mb-3" id="disclaimer"> |
|
| 89 |
- <div class="card-header">Rechtliches</div> |
|
| 90 |
- <div class="card-body"><p class="card-text">Dies ist ein Angebot der Mosterei Wurst, Murrhardt-Köchersberg.</p> |
|
| 91 |
- <a href="#" data-bs-toggle="modal" data-bs-target="#datenschutz">Datenschutzhinweise lesen</a> |
|
| 92 |
- </div> |
|
| 93 |
- </div> |
|
| 94 |
- |
|
| 95 |
- <div class="modal fade" id="datenschutz"> |
|
| 96 |
- <div class="modal-dialog"> |
|
| 97 |
- <div class="modal-content"> |
|
| 98 |
- |
|
| 99 |
- <!-- Modal Header --> |
|
| 100 |
- <div class="modal-header"> |
|
| 101 |
- <h5 class="modal-title">Datenschutzhinweise</h5> |
|
| 102 |
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
|
| 103 |
- </div> |
|
| 104 |
- |
|
| 105 |
- <!-- Modal body --> |
|
| 106 |
- <div class="modal-body"> |
|
| 107 |
- <p>Wir speichern die eingegebenen Daten zum Zwecke der Erbringung unserer Dienstleistung. Eine Weitergabe der Daten erfolgt nicht. Sie haben einen Anspruch auf Löschung der personenbezogenen Daten, sofern keine laufende oder beauftragte Dienstleistung dem entgegen steht. Kontaktieren Sie uns dazu bitte auf beliebigem Weg'.($_SESSION['mode'] != 'local' ? ', wie im <a target="_blank" href="https://mosterei-wurst.de/impressum/">Impressum</a> angegeben' : '').'.</p> |
|
| 108 |
- <p>Dieses Angebot verwendet Cookies zur Ablaufsteuerung. Einer auftragsbezogenen Kontaktaufnahme stimmen Sie durch Nutzung des Angebots explizit zu.</p> |
|
| 109 |
-'.($_SESSION['mode'] != 'local' ? '<p>Der Name und die verwendete Telefonnummer wird (sofern Sie dies nicht abwählen) zusätzlich langfristig in Ihrem Browser gespeichert um Ihnen beim nächsten Besuch einen erhöhten Komfort zu bieten. Diese gespeicherte Nummer können Sie <a href="clear.php?number">sofort aus Ihrem Browser löschen</a>.</p>' : '').' |
|
| 110 |
- </div> |
|
| 111 |
- |
|
| 112 |
- <!-- Modal footer --> |
|
| 113 |
- <div class="modal-footer"> |
|
| 114 |
- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Verstanden</button> |
|
| 115 |
- </div> |
|
| 116 |
- |
|
| 117 |
- </div> |
|
| 118 |
- </div> |
|
| 119 |
-</div> |
|
| 120 | 87 |
'; |
| 121 | 88 |
|
| 122 | 89 |
include("template.php");
|
| ... | ... |
@@ -111,8 +111,11 @@ if (isset($_REQUEST['form'])) {
|
| 111 | 111 |
if (strlen($label) !== 3) {
|
| 112 | 112 |
$redirect = 'index.php?error=Die Box-Nummer muss genau 3-stellig sein.'; |
| 113 | 113 |
break; |
| 114 |
+ } else {
|
|
| 115 |
+ $redirect = 'index.php?error=Die Box-Nummer ist ungültig'; |
|
| 114 | 116 |
} |
| 115 | 117 |
|
| 118 |
+ |
|
| 116 | 119 |
// 2. Ziffern extrahieren |
| 117 | 120 |
$z1 = (int)$label[0]; |
| 118 | 121 |
$z2 = (int)$label[1]; |
| ... | ... |
@@ -263,6 +266,10 @@ if (isset($_REQUEST['form'])) {
|
| 263 | 266 |
if (isset($_REQUEST['kartonsnein'])) {
|
| 264 | 267 |
$_SESSION['kartons'] = false; |
| 265 | 268 |
} |
| 269 |
+ $_SESSION['gebrauchte_3er'] = ($_REQUEST['gebrauchte_3er'] == 1); |
|
| 270 |
+ $_SESSION['gebrauchte_5er'] = ($_REQUEST['gebrauchte_5er'] == 1); |
|
| 271 |
+ $_SESSION['gebrauchte_10er'] = ($_REQUEST['gebrauchte_10er'] == 1); |
|
| 272 |
+ $_SESSION['gebrauchte_prio'] = $_REQUEST['gebrauchte_prio'] ?: null; |
|
| 266 | 273 |
|
| 267 | 274 |
$_SESSION['gebrauchte_done'] = true; |
| 268 | 275 |
$redirect = nextPage(); |
| ... | ... |
@@ -336,31 +343,50 @@ if (isset($_SESSION['neue'])) {
|
| 336 | 343 |
if (isset($_SESSION['containers']) && count($_SESSION['containers']) > 0) {
|
| 337 | 344 |
$auftrag['containers'] = array_values($_SESSION['containers']); |
| 338 | 345 |
} |
| 339 |
- // usedPackages |
|
| 340 |
- if (isset($_SESSION['kartons'])) {
|
|
| 341 |
- $auftrag['haveUsed'] = (bool) $_SESSION['kartons']; |
|
| 342 |
- } |
|
| 343 | 346 |
|
| 344 |
- // plannedPackagings |
|
| 345 |
- if (isset($_SESSION['neue'])) {
|
|
| 346 |
- $plan = []; |
|
| 347 |
- if ($_SESSION['neue'] == 'sonstiges') {
|
|
| 348 |
- $auftrag['free'] = $_SESSION["sonstiges"]; |
|
| 349 |
- } else {
|
|
| 350 |
- $plan[] = [ |
|
| 351 |
- "packageType" => $_SESSION['neue'], |
|
| 352 |
- "wish" => "rest" |
|
| 353 |
- ]; |
|
| 347 |
+ |
|
| 348 |
+ // Array mit allen verfügbaren Kartongrößen |
|
| 349 |
+ $groessen = ['3er', '5er', '10er']; |
|
| 350 |
+ |
|
| 351 |
+ // Alle vom Kunden mitgebrachten Größen filtern |
|
| 352 |
+ $mitgebrachteGroessen = array_filter($groessen, function($groesse) {
|
|
| 353 |
+ return !empty($_SESSION['gebrauchte_' . $groesse]); |
|
| 354 |
+ }); |
|
| 355 |
+ |
|
| 356 |
+ // Initialisierung der Zielstruktur |
|
| 357 |
+ $auftrag['haveUsed'] = !empty($mitgebrachteGroessen); |
|
| 358 |
+ $auftrag['usedFirst'] = null; |
|
| 359 |
+ $auftrag['wishes'] = []; |
|
| 360 |
+ |
|
| 361 |
+ if ($auftrag['haveUsed']) {
|
|
| 362 |
+ |
|
| 363 |
+ // Priorität (usedFirst) bestimmen: |
|
| 364 |
+ // Falls explizit in 'gebrauchte_prio' gesetzt, sonst die einzige mitgebrachte Größe |
|
| 365 |
+ if ($_SESSION['gebrauchte_prio']) {
|
|
| 366 |
+ $auftrag['usedFirst'] = $_SESSION['gebrauchte_prio']; |
|
| 367 |
+ } elseif (count($mitgebrachteGroessen) === 1) {
|
|
| 368 |
+ $auftrag['usedFirst'] = reset($mitgebrachteGroessen); |
|
| 354 | 369 |
} |
| 355 |
- if (isset($_SESSION['frischsaft']) && $_SESSION['frischsaft'] > 0) {
|
|
| 356 |
- $plan[] = [ |
|
| 357 |
- "packageType" => "frischsaft", |
|
| 358 |
- "wish" => $_SESSION['frischsaft'] |
|
| 359 |
- ]; |
|
| 360 | 370 |
} |
| 361 | 371 |
|
| 362 |
- $auftrag['wishes'] = $plan; |
|
| 372 |
+ // Kundenwunsch für neue Kartons |
|
| 373 |
+ $wunschNeue = $_SESSION['neue'] ?? null; |
|
| 363 | 374 |
|
| 375 |
+ // 'wishes'-Array gemäß deiner Datenstruktur aufbauen |
|
| 376 |
+ foreach ($mitgebrachteGroessen as $groesse) {
|
|
| 377 |
+ if ($groesse === $wunschNeue) {
|
|
| 378 |
+ // Die primär gewünschte Größe erhält "rest" |
|
| 379 |
+ $auftrag['wishes'][] = [ |
|
| 380 |
+ 'packageType' => $groesse, |
|
| 381 |
+ 'wish' => 'rest' |
|
| 382 |
+ ]; |
|
| 383 |
+ } else {
|
|
| 384 |
+ // Alle weiteren mitgebrachten Größen erhalten "only-used" |
|
| 385 |
+ $auftrag['wishes'][] = [ |
|
| 386 |
+ 'packageType' => $groesse, |
|
| 387 |
+ 'wish' => 'only-used' |
|
| 388 |
+ ]; |
|
| 389 |
+ } |
|
| 364 | 390 |
} |
| 365 | 391 |
|
| 366 | 392 |
|
| ... | ... |
@@ -22,37 +22,45 @@ $content = ' |
| 22 | 22 |
</div> |
| 23 | 23 |
|
| 24 | 24 |
<script> |
| 25 |
-// Wir nutzen die spezialisierte Klasse für mehr Kontrolle |
|
| 25 |
+ |
|
| 26 | 26 |
const html5QrCode = new Html5Qrcode("reader");
|
| 27 | 27 |
|
| 28 |
-const qrCodeSuccessCallback = (decodedText, decodedResult) => {
|
|
| 29 |
- // Stoppt die Kamera nach Erfolg |
|
| 30 |
- html5QrCode.stop().then((ignore) => {
|
|
| 31 |
- // Reduktion der URL auf die Nummer, wie zuvor besprochen |
|
| 32 |
- let boxNumber = decodedText; |
|
| 28 |
+const qrCodeSuccessCallback = async (decodedText, decodedResult) => {
|
|
| 29 |
+ try {
|
|
| 30 |
+ // 1. Kamera stoppen und DOM-Elemente bereinigen |
|
| 31 |
+ await html5QrCode.stop(); |
|
| 32 |
+ html5QrCode.clear(); |
|
| 33 |
+ |
|
| 34 |
+ // 2. Daten verarbeiten |
|
| 35 |
+ let boxNumber = ""; |
|
| 33 | 36 |
if (decodedText.includes("box=")) {
|
| 34 | 37 |
const urlParts = decodedText.split("?");
|
| 35 | 38 |
if (urlParts.length > 1) {
|
| 36 | 39 |
const params = new URLSearchParams(urlParts[1]); |
| 37 |
- if (params.has("box")) { boxNumber = params.get("box"); }
|
|
| 40 |
+ if (params.has("box")) {
|
|
| 41 |
+ boxNumber = params.get("box");
|
|
| 38 | 42 |
} |
| 39 | 43 |
} |
| 40 |
- window.location.href = "index.php?box=" + encodeURIComponent(boxNumber); |
|
| 41 |
- }).catch((err) => {
|
|
| 42 |
- console.error("Fehler beim Stoppen:", err);
|
|
| 43 |
- }); |
|
| 44 |
+ } |
|
| 45 |
+ let redirectUrl = "index.php?box=" + encodeURIComponent(boxNumber); |
|
| 46 |
+ if (boxNumber == "") {
|
|
| 47 |
+ redirectUrl = "index.php?error=Der QR-Code enthält keine Box-Nummer"; |
|
| 48 |
+ } |
|
| 49 |
+ // 3. Kurze Pause für Android-WebRTC zum Freigeben der Hardware |
|
| 50 |
+ setTimeout(() => {
|
|
| 51 |
+ window.location.href = redirectUrl; |
|
| 52 |
+ }, 150); |
|
| 53 |
+ |
|
| 54 |
+ } catch (err) {
|
|
| 55 |
+ console.error("Fehler beim Stoppen des Scanners:", err);
|
|
| 56 |
+ } |
|
| 44 | 57 |
}; |
| 45 | 58 |
|
| 46 | 59 |
const config = { fps: 10, qrbox: { width: 250, height: 250 } };
|
| 47 | 60 |
|
| 48 |
-// DIREKTER START: |
|
| 49 |
-// "facingMode: "environment"" erzwingt die Rückkamera. |
|
| 50 |
-// Durch den Aufruf von .start() wird der interne "Start"-Button der Library übersprungen. |
|
| 51 | 61 |
html5QrCode.start({ facingMode: "environment" }, config, qrCodeSuccessCallback)
|
| 52 | 62 |
.catch((err) => {
|
| 53 |
- // Falls die Rückkamera nicht gefunden wird oder Berechtigung fehlt |
|
| 54 | 63 |
console.error("Kamera konnte nicht gestartet werden:", err);
|
| 55 |
- // Fallback: Zeige Fehlermeldung im UI |
|
| 56 | 64 |
document.getElementById("reader").innerHTML =
|
| 57 | 65 |
\'<div class="alert alert-danger">Kamera-Zugriff verweigert oder keine Rückkamera gefunden.</div>\'; |
| 58 | 66 |
}); |
| ... | ... |
@@ -47,27 +47,49 @@ if ($name_required) {
|
| 47 | 47 |
$anlieferung .= '<div class="alert alert-warning">Bitte Namen an Box bzw. Anhänger anbringen!</div>'; |
| 48 | 48 |
} |
| 49 | 49 |
|
| 50 |
+// Zuordnung der Größen-IDs zu lesbaren Texten |
|
| 51 |
+$groessenLabels = [ |
|
| 52 |
+ '3er' => '3-Liter-Kartons', |
|
| 53 |
+ '5er' => '5-Liter-Kartons', |
|
| 54 |
+ '10er' => '10-Liter-Kartons' |
|
| 55 |
+]; |
|
| 56 |
+ |
|
| 57 |
+// Alle mitgebrachten Größen ermitteln |
|
| 58 |
+$mitgebrachte = []; |
|
| 59 |
+foreach (['3er', '5er', '10er'] as $groesse) {
|
|
| 60 |
+ if (!empty($_SESSION['gebrauchte_' . $groesse])) {
|
|
| 61 |
+ $mitgebrachte[] = $groessenLabels[$groesse]; |
|
| 62 |
+ } |
|
| 63 |
+} |
|
| 64 |
+ |
|
| 65 |
+// Textgenerierung |
|
| 50 | 66 |
$abfuellung = ''; |
| 51 |
-if ($_SESSION['neue'] == '3er') {
|
|
| 52 |
- if ($_SESSION['kartons']) {
|
|
| 53 |
- $abfuellung = 'Wir füllen zunächst Ihre gebrauchten Kartons (wenn vorhanden zuerst 3er) und falls noch Saft übrig ist, füllen wir diesen in <strong>3-Liter-Kartons</strong>.'; |
|
| 67 |
+ |
|
| 68 |
+if ($_SESSION['neue'] == 'sonstiges') {
|
|
| 69 |
+ $abfuellung = 'Sie haben uns folgende Nachricht hinterlassen:<br><blockquote>'.$_SESSION['sonstiges'].'</blockquote>'; |
|
| 54 | 70 |
} else {
|
| 55 |
- $abfuellung = 'Wir füllen Ihren Saft in <strong>3-Liter-Kartons</strong>.'; |
|
| 56 |
- } |
|
| 57 |
-} elseif ($_SESSION['neue'] == '5er') {
|
|
| 58 |
- if ($_SESSION['kartons']) {
|
|
| 59 |
- $abfuellung = 'Wir füllen zunächst Ihre gebrauchten Kartons (wenn vorhanden zuerst 5er) und falls noch Saft übrig ist, füllen wir diesen in <strong>5-Liter-Kartons</strong>.'; |
|
| 71 |
+ $neuerKartonText = $groessenLabels[$_SESSION['neue']] ?? ''; |
|
| 72 |
+ if (!empty($mitgebrachte)) {
|
|
| 73 |
+ // 1. Details zu den gebrauchten Kartons formulieren |
|
| 74 |
+ if (count($mitgebrachte) === 1) {
|
|
| 75 |
+ $gebrauchteText = 'Ihre gebrauchten ' . $mitgebrachte[0]; |
|
| 60 | 76 |
} else {
|
| 61 |
- $abfuellung = 'Wir füllen Ihren Saft in <strong>5-Liter-Kartons</strong>.'; |
|
| 77 |
+ $prioKarton = $groessenLabels[$_SESSION['gebrauchte_prio']] ?? $mitgebrachte[0]; |
|
| 78 |
+ $gebrauchteText = 'Ihre gebrauchten Kartons (' . implode(' und ', $mitgebrachte) . ', <strong>zuerst ' . $prioKarton . '</strong>)';
|
|
| 62 | 79 |
} |
| 63 |
-} elseif ($_SESSION['neue'] == '10er') {
|
|
| 64 |
- if ($_SESSION['kartons']) {
|
|
| 65 |
- $abfuellung = 'Wir füllen zunächst Ihre gebrauchten Kartons (wenn vorhanden zuerst 10er) und falls noch Saft übrig ist, füllen wir diesen in <strong>10-Liter-Kartons</strong>.'; |
|
| 80 |
+ |
|
| 81 |
+ // 2. Gesamttext mit Anschluss-Wunsch bauen |
|
| 82 |
+ if ($neuerKartonText) {
|
|
| 83 |
+ $abfuellung = 'Wir füllen zunächst ' . $gebrauchteText . ' und falls noch Saft übrig ist, füllen wir diesen in neue <strong>' . $neuerKartonText . '</strong>.'; |
|
| 66 | 84 |
} else {
|
| 67 |
- $abfuellung = 'Wir füllen Ihren Saft in <strong>10-Liter-Kartons</strong>.'; |
|
| 85 |
+ $abfuellung = 'Wir füllen alles in ' . $gebrauchteText . '.'; |
|
| 68 | 86 |
} |
| 69 | 87 |
} else {
|
| 70 |
- $abfuellung = 'Sie haben uns folgende Nachricht hinterlassen:<br><blockquote>'.$_SESSION['sonstiges'].'</blockquote>'; |
|
| 88 |
+ // Keine gebrauchten Kartons vorhanden |
|
| 89 |
+ if ($neuerKartonText) {
|
|
| 90 |
+ $abfuellung = 'Wir füllen Ihren Saft in <strong>' . $neuerKartonText . '</strong>.'; |
|
| 91 |
+ } |
|
| 92 |
+ } |
|
| 71 | 93 |
} |
| 72 | 94 |
|
| 73 | 95 |
$adresse = $_SESSION['lname'].', '.$_SESSION['fname']; |
| ... | ... |
@@ -97,11 +119,7 @@ $content .= ' |
| 97 | 119 |
<div class="card-header">Gebrauchte Kartons</div> |
| 98 | 120 |
<div class="card-body">'; |
| 99 | 121 |
if ($_SESSION['kartons']) {
|
| 100 |
- if ($_SESSION['angeliefert']) {
|
|
| 101 |
- $content .= '<p class="card-text">Sie haben Ihre gebrauchten Kartons am dafür vorgesehenen Platz abgestellt und mit Ihrem Namen beschriftet.</p>'; |
|
| 102 |
- } else {
|
|
| 103 |
- $content .= '<p class="card-text">Sie werden Ihre gebrauchten Kartons mit dem Obst bringen und am dafür vorgesehenen Platz abstellen und mit Ihrem Namen beschriften.</p>'; |
|
| 104 |
- } |
|
| 122 |
+ $content .= '<p class="card-text">Sie haben Ihre gebrauchten Kartons am dafür vorgesehenen Platz abgestellt und die Kiste mit Ihrem Namen beschriftet.</p>'; |
|
| 105 | 123 |
} else {
|
| 106 | 124 |
$content .= '<p class="card-text">Sie haben <strong>keine</strong> gebrauchten Kartons, die wir wieder befüllen sollen.</p>'; |
| 107 | 125 |
} |
| ... | ... |
@@ -26,7 +26,9 @@ if (isset($_REQUEST['history_pos']) && $_REQUEST['history_pos'] >= 0) {
|
| 26 | 26 |
array_pop($_SESSION['page_history']); |
| 27 | 27 |
} else {
|
| 28 | 28 |
$previous = end($_SESSION['page_history']); |
| 29 |
+ if ($_SERVER['PHP_SELF'] != $previous) {
|
|
| 29 | 30 |
$_SESSION['page_history'][] = $_SERVER['PHP_SELF']; |
| 31 |
+ } |
|
| 30 | 32 |
// Index ist count()-1 |
| 31 | 33 |
$history_pos = count($_SESSION['page_history'])-1; |
| 32 | 34 |
} |
| ... | ... |
@@ -79,7 +81,9 @@ if (isset($_REQUEST['history_pos']) && $_REQUEST['history_pos'] >= 0) {
|
| 79 | 81 |
}?> |
| 80 | 82 |
<?= $content ?> |
| 81 | 83 |
<?php if (basename($_SERVER['PHP_SELF']) != 'finish.php') { ?>
|
| 84 |
+ <div class="mt-2"> |
|
| 82 | 85 |
<a href="#" id="allesloeschen" data-bs-toggle="modal" data-bs-target="#allesloeschen-dialog" class="btn btn-sm btn-block btn-outline-danger" data-bs-href="clear.php">Alle Eingaben löschen und von vorne beginnen</a> |
| 86 |
+ </div> |
|
| 83 | 87 |
<div class="modal fade" id="allesloeschen-dialog" tabindex="-1" role="dialog" aria-labelledby="Bestaetigung" aria-hidden="true"> |
| 84 | 88 |
<div class="modal-dialog"> |
| 85 | 89 |
<div class="modal-content"> |
| 86 | 90 |