Freitext auf separater Seite
Bernd Wurst

Bernd Wurst commited on 2025-10-22 10:41:21
Zeige 2 geänderte Dateien mit 25 Einfügungen und 6 Löschungen.

... ...
@@ -41,18 +41,14 @@ if ($_SESSION['kartons']) {
41 41
     $suffix = '';
42 42
 }
43 43
 
44
+if (isset($_REQUEST['sonstiges'])) {
44 45
     $content .= '
45 46
     <form class="form" action="save.php" method="post">
46 47
     <input type="hidden" name="form" value="auftrag">
47 48
     <p>Welche <strong>Karton-Größen</strong> sollen wir für Sie herstellen?</p>
48 49
 
49
-    <div class="form-group form-group-lg row g-2">
50
-        <div class="col-sm-4 col-xs-12 d-grid"><button class="btn btn-lg btn-light" id="btn-3er" name="3er" value="3er">'.$prefix.'<strong>3er</strong>'.$suffix.'</buton></div>
51
-        <div class="col-sm-4 col-xs-12 d-grid"><button class="btn btn-lg btn-light" id="btn-5er" name="5er" value="5er">'.$prefix.'<strong>5er</strong>'.$suffix.'</buton></div>
52
-        <div class="col-sm-4 col-xs-12 d-grid"><button class="btn btn-lg btn-light" id="btn-10er" name="10er" value="10er">'.$prefix.'<strong>10er</strong>'.$suffix.'</buton></div>
53
-    </div>
54 50
     <div class="form-group form-group-lg">
55
-        <label for="sonstiges">Falls obiges nicht zutrifft, beschreiben Sie bitte hier Ihren Wunsch.</label>
51
+        <label for="sonstiges">Beschreiben Sie bitte hier Ihren Wunsch:</label>
56 52
         <div class="row justify-content-center">
57 53
             <div class="col-sm-10 mb-2"><textarea class="form-control" name="sonstiges" id="sonstiges" placeholder="Ihr Wunsch"></textarea></div>
58 54
         </div>
... ...
@@ -65,5 +61,24 @@ $content .= '
65 61
 
66 62
 ';
67 63
 
64
+} else {
65
+    $content .= '
66
+    <form class="form" action="save.php" method="post">
67
+    <input type="hidden" name="form" value="auftrag">
68
+    <p>Welche <strong>Karton-Größen</strong> sollen wir für Sie herstellen?</p>
69
+
70
+    <div class="form-group form-group-lg row g-2 mb-3">
71
+        <div class="col-sm-4 col-xs-12 d-grid"><button class="btn btn-lg btn-light" id="btn-3er" name="3er" value="3er">'.$prefix.'<strong>3er</strong>'.$suffix.'</button></div>
72
+        <div class="col-sm-4 col-xs-12 d-grid"><button class="btn btn-lg btn-light" id="btn-5er" name="5er" value="5er">'.$prefix.'<strong>5er</strong>'.$suffix.'</button></div>
73
+        <div class="col-sm-4 col-xs-12 d-grid"><button class="btn btn-lg btn-light" id="btn-10er" name="10er" value="10er">'.$prefix.'<strong>10er</strong>'.$suffix.'</button></div>
74
+    </div>
75
+    <div class="form-group form-group-lg">
76
+        <div class="col-sm-12 col-xs-12 d-grid"><button class="btn btn-lg btn-light" id="btn-sonstiges" name="sonstiges" value="sonstiges">Ein anderer Wunsch</button></div>
77
+    </div>
78
+    </form>
79
+
80
+';
81
+}
82
+
68 83
 
69 84
 include("template.php");
... ...
@@ -223,6 +223,10 @@ if (isset($_REQUEST['form'])) {
223 223
             if (isset($_REQUEST['submit']) && isset($_REQUEST['sonstiges']) && $_REQUEST['sonstiges'] != '') {
224 224
                 $_SESSION['neue'] = 'sonstiges';
225 225
                 $_SESSION['sonstiges'] = htmlspecialchars($_REQUEST['sonstiges']);
226
+            } elseif (isset($_REQUEST['sonstiges'])) {
227
+                $_SESSION['neue'] = 'sonstiges';
228
+                $redirect = 'auftrag.php?sonstiges';
229
+                break;
226 230
             }
227 231
 
228 232
 
229 233