Bernd Wurst commited on 2020-09-01 16:24:17
Zeige 6 geänderte Dateien mit 310 Einfügungen und 147 Löschungen.
... | ... |
@@ -0,0 +1,186 @@ |
1 |
+<?php |
|
2 |
+require_once 'lib/api.php'; |
|
3 |
+require_once 'lib/modal.php'; |
|
4 |
+require_once 'lib/tools.php'; |
|
5 |
+session_start(); |
|
6 |
+ |
|
7 |
+$handle = null; |
|
8 |
+$handle_length = 8; |
|
9 |
+if (isset($_GET['handle'])) { |
|
10 |
+ $handle = $_GET['handle']; |
|
11 |
+} else { |
|
12 |
+ $random = base64_encode(md5(microtime())); |
|
13 |
+ $handle = substr(str_replace(array('+', '=', '/'), '', $random), 0, $handle_length); |
|
14 |
+} |
|
15 |
+ |
|
16 |
+$data = array("handle" => $handle); |
|
17 |
+ |
|
18 |
+$ret = api_call('vorgang/lesen', $data); |
|
19 |
+$a = $ret['vorgang']; |
|
20 |
+ |
|
21 |
+if (isset($_GET['handle']) && $a['revision'] == 0) { |
|
22 |
+ echo "Fehler im System"; |
|
23 |
+ die(); |
|
24 |
+} |
|
25 |
+ |
|
26 |
+ |
|
27 |
+ |
|
28 |
+$previous = 'unbestaetigte.php'; |
|
29 |
+$headline = 'Auftrag bestätigen'; |
|
30 |
+$content = '<form action="#"> |
|
31 |
+<input type="hidden" id="handle" name="handle" value="'.$handle.'">'; |
|
32 |
+ |
|
33 |
+$content .= '<h3>Kundendaten</h3>'; |
|
34 |
+$content .= ' |
|
35 |
+<div class="row"> |
|
36 |
+<div class="col"><label for="name">Name für den Auftrag</label></div><div class="col"><input type="text" name="auftrag_name" id="name" value="'.$a['name'].'"></div><div class="w-100"></div> |
|
37 |
+<div class="col"><label for="telefon">Telefonnummer für den Auftrag</label></div><div class="col"><input type="text" name="auftrag_telefon" id="telefon" value="'.$a['telefon'].'"></div> |
|
38 |
+</div>'; |
|
39 |
+ |
|
40 |
+$content .= '<div class="auftrag-kopf row"> |
|
41 |
+<div class="kundendaten_auftrag col-12 col-sm-6"> |
|
42 |
+<p><em>Angaben des Kunden:</em></p> |
|
43 |
+<p id="auftrag_kundenadresse">'; |
|
44 |
+$content .= adresse($a['kundendaten'], 'auftragsdaten'); |
|
45 |
+ |
|
46 |
+$content .= '</p>'; |
|
47 |
+$content .= '</div> |
|
48 |
+<div class="kundendaten_kunde col-12 col-sm-6"> |
|
49 |
+<p><em>Kundendaten:</em></p> |
|
50 |
+<p id="kundendaten_kundenadresse">---</p>'; |
|
51 |
+$content .= '<input type="hidden" name="kundendaten_kundennr" id="kundendaten_kundennr" value="'.(isset($a['kundennr']) ? $a['kundennr'] : '').'"><button class="btn btn-secondary" id="btn_kunde_suchen">Kunde suchen</button> <button class="btn btn-outline-secondary" id="btn_kunde_aendern">Kunde ändern</button> '; |
|
52 |
+$content .= '</div>'; |
|
53 |
+ |
|
54 |
+$content .= '</div>'; |
|
55 |
+ |
|
56 |
+ |
|
57 |
+$content .= '<div class="unterauftrag-container row">'; |
|
58 |
+foreach ($a['bestellung'] as $best) { |
|
59 |
+ // Evtl. Mehrere Posten in dieser Bestellung |
|
60 |
+ $content .= '<div class="unterauftrag col-12">'; |
|
61 |
+ |
|
62 |
+ $obst = array(); |
|
63 |
+ foreach ($best['gitterbox'] as $gb) { |
|
64 |
+ $img = '<img class="gitterbox" src="/assets/images/gitterbox.png"><br>'; |
|
65 |
+ if ($gb['id']) { |
|
66 |
+ $img .= 'GB #'.$gb['id']; |
|
67 |
+ } else { |
|
68 |
+ $img .= 'Gitterbox'; |
|
69 |
+ } |
|
70 |
+ $obst[] = '<a href="#" class="gitterbox">'.$img.'</a>'; |
|
71 |
+ } |
|
72 |
+ foreach ($best['anhaenger'] as $anh) { |
|
73 |
+ $img = '<img class="anhaenger" src="/assets/images/anhaenger.png"><br>'; |
|
74 |
+ if (isset($anh['kennz'])) { |
|
75 |
+ $img .= ' <strong>'.$anh['kennz'].'</strong> '; |
|
76 |
+ } else { |
|
77 |
+ $img .= ' <em>Anhänger</em>'; |
|
78 |
+ } |
|
79 |
+ $obst[] = '<a href="#" class="anhaenger">'.$img.'</a>'; |
|
80 |
+ } |
|
81 |
+ foreach ($obst as $key => $val) { |
|
82 |
+ $obst[$key] = '<div class="col">'.$val.'</div>'; |
|
83 |
+ } |
|
84 |
+ $content .= '<div class="lieferart row">'.implode('', $obst).'<div class="col"><a href="#" class="gitterbox_neu">+<br>Weitere Lieferung</a></div></div>'; |
|
85 |
+ $content .= '<div class="obstmenge row">'; |
|
86 |
+ $val = 0; |
|
87 |
+ if (isset($best['obstmenge'])) { |
|
88 |
+ $val = $best['obstmenge']; |
|
89 |
+ } |
|
90 |
+ $content .= '<div class="col"><div class="row"><div class="col"><label for="obstmenge">Obstmenge:</label></div><div class="col"><input type="number" id="obstmenge" name="obstmenge" value="'.$val.'" step="10" min="0" maxlength="5"></div></div> |
|
91 |
+ <div class="row">'; |
|
92 |
+ foreach (array(50, 100, 150, 200, 250, 300, 350, 400) as $v) { |
|
93 |
+ $v = max((count($best['gitterbox'])-1),0) * 400 + $v; |
|
94 |
+ $content .= '<div class="col"><button type="button" class="obstmenge_vorschlag btn btn-outline-secondary">'.$v.'</button></div> '; |
|
95 |
+ } |
|
96 |
+ $content .= '</div></div></div>'; |
|
97 |
+ // Gebrauchte |
|
98 |
+ $sel = 'gebrauchte_nein'; |
|
99 |
+ if ($best['gebrauchte']) { |
|
100 |
+ $sel = 'gebrauchte_ja'; |
|
101 |
+ } |
|
102 |
+ $content .= '<div class="row"> |
|
103 |
+ <div class="gebrauchte col-12 col-sm-6">Gebrauchte Kartons:</div><div class="col-sm-6 col-12"><span class="buttonset"> |
|
104 |
+ <input type="radio" name="gebrauchte" id="gebrauchte_ja" value="gebrauchte_ja" '.($best['gebrauchte'] ? 'checked="checked"' : '').'> <label for="gebrauchte_ja">JA</label> |
|
105 |
+ <input type="radio" name="gebrauchte" id="gebrauchte_nein" value="gebrauchte_nein" '.($best['gebrauchte'] ? '' : 'checked="checked"').'> <label for="gebrauchte_nein">NEIN</label> </span> |
|
106 |
+ </div></div>'; |
|
107 |
+ // Neue |
|
108 |
+ $content .= ' |
|
109 |
+ <div class="neue"> |
|
110 |
+ <div class="row"><div class="col-12">Neue:</div></div> |
|
111 |
+ <div class="row"><div class="col-12"><span class="buttonset"> |
|
112 |
+ <input type="radio" name="neue" value="3er" id="btn_neue_3er" '.(isset($best['neue']['3er']) && $best['neue']['3er'] == '100%' ? 'checked="checked"' : '').'> <label for="btn_neue_3er">3er</label> |
|
113 |
+ <input type="radio" name="neue" value="5er" id="btn_neue_5er" '.(isset($best['neue']['5er']) && $best['neue']['5er'] == '100%' ? 'checked="checked"' : '').'> <label for="btn_neue_5er">5er</label> |
|
114 |
+ <input type="radio" name="neue" value="10er" id="btn_neue_10er" '.(isset($best['neue']['10er']) && $best['neue']['10er'] == '100%' ? 'checked="checked"' : '').'> <label for="btn_neue_10er">10er</label> |
|
115 |
+ <input type="radio" name="neue" value="sonstiges" id="btn_neue_sonstiges" '.((isset($best['neue']['10er']) && $best['neue']['10er'] == '100%') || (isset($best['neue']['5er']) && $best['neue']['5er'] == '100%') || (isset($best['neue']['3er']) && $best['neue']['3er'] == '100%') ? '' : 'checked="checked"').'> <label for="btn_neue_sonstiges">Sonstiges</label> |
|
116 |
+ </span> |
|
117 |
+ </div></div>'; |
|
118 |
+ $neue = array("3er" => '', "5er" => '', "10er" => ''); |
|
119 |
+ foreach ($neue as $key => $val) { |
|
120 |
+ $val = ''; |
|
121 |
+ if (isset($best['neue'][$key])) { |
|
122 |
+ $val = $best['neue'][$key]; |
|
123 |
+ } |
|
124 |
+ $neue[] = '<div class="row"><div class="col-5 col-sm-3">Neue <strong>'.$key.'</strong>:</div><div class="col-7 col-sm-6"><input type="text" id="neue_'.$key.'" value="'.$val.'"></div><div class="col-12 col-sm-3"><button type="button" class="btn btn-secondary" id="button_halb_'.$key.'">Halbe Liter in '.$key.'</button></div></div>'; |
|
125 |
+ } |
|
126 |
+ if (isset($best['neue']['sonstiges'])) { |
|
127 |
+ $neue[] = '<em>'.$best['neue']['sonstiges'].'</em>'; |
|
128 |
+ } |
|
129 |
+ $content .= '<div class="neue_detail">'.implode('', $neue).'</div>'; |
|
130 |
+ $content .= '</div>'; |
|
131 |
+ $content .= '<div class="anmerkungen row"><div class="col"><textarea name="anmerkungen" id="anmerkungen">'.htmlspecialchars($best['anmerkungen']).'</textarea></div></div>'; |
|
132 |
+ $content .= '<div class="frischsaft row"><div class="col-5 col-sm-2">Frischsaft:</div><div class="col-7 col-sm-4"><span class="buttonset"> |
|
133 |
+ <input type="radio" name="frischsaft_choose" id="frischsaft_nein" '.(isset($best['frischsaft']) && $best['frischsaft'] > 0 ? '' : 'checked="checked"').'> <label for="frischsaft_nein">Nein</label> |
|
134 |
+ <input type="radio" name="frischsaft_choose" id="frischsaft_ja" '.(isset($best['frischsaft']) && $best['frischsaft'] > 0 ? 'checked="checked"' : '').'> <label for="frischsaft_ja">Ja</label></span> |
|
135 |
+ </div> |
|
136 |
+ <div id="frischsaft_liter" class="col-12 col-sm-6"> |
|
137 |
+ <div class="row"> |
|
138 |
+ <div class="col-6"><input type="number" name="frischsaft" value="'.htmlspecialchars($best['frischsaft']).'"></div> |
|
139 |
+ <div class="col-6">Liter frisch</div> |
|
140 |
+ </div> |
|
141 |
+ </div> |
|
142 |
+ </div>'; |
|
143 |
+ if (count($a['bestellung']) > 1) { |
|
144 |
+ $content .= '<div class="unterauftrag_bestaetigen"><button type="button" class="btn btn-secondary">Diesen Unterauftrag separat annehmen</button></div>'; |
|
145 |
+ } |
|
146 |
+ $content .= '</div>'; // Unterauftrag |
|
147 |
+} |
|
148 |
+ |
|
149 |
+$content .= '</div>'; // unterauftrag-container |
|
150 |
+$content .= '<div class="auftrag_bestaetigen"><button type="button" class="btn btn-primary">Auftrag bestätigen</button> |
|
151 |
+<button type="button" class="btn btn-secondary">Auftrag annehmen und sofort verarbeiten</button></div>'; |
|
152 |
+$content .= '</form>'; |
|
153 |
+ |
|
154 |
+$content .= ' |
|
155 |
+ <div class="modal fade" id="gitterbox-neu-dialog" tabindex="-1" role="dialog" aria-labelledby="Gitterbox" aria-hidden="true"> |
|
156 |
+ <div class="modal-dialog"> |
|
157 |
+ <div class="modal-content"> |
|
158 |
+ <div class="modal-header"> |
|
159 |
+ <h4 class="modal-title">Neue Gitterbox erfassen</h4> |
|
160 |
+ </div> |
|
161 |
+ |
|
162 |
+ <div class="modal-body"> |
|
163 |
+ <p>ID-Nummer: <input type="text" name="gb" id="gitterbox-neu-id" value=""></p> |
|
164 |
+ <p><button type="button" class="btn btn-primary" id="gitterbox-neu-gb">Gitterbox hinzufügen</button></p> |
|
165 |
+ </div> |
|
166 |
+ |
|
167 |
+ <div class="modal-body"> |
|
168 |
+ <p>Kennzeichen: <input type="text" name="kennz" id="gitterbox-neu-kennz" value=""></p> |
|
169 |
+ <p><button type="button" class="btn btn-primary" id="gitterbox-neu-anh">Anhänger hinzufügen</button></p> |
|
170 |
+ </div> |
|
171 |
+ |
|
172 |
+ <div class="modal-footer"> |
|
173 |
+ <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Abbrechen</button> |
|
174 |
+ </div> |
|
175 |
+ </div> |
|
176 |
+ </div> |
|
177 |
+ </div> |
|
178 |
+'; |
|
179 |
+ |
|
180 |
+$content .= modal_kundensuche($a['kundendaten']); |
|
181 |
+$content .= modal_kunde_aendern(); |
|
182 |
+$content .= modal_confirmation(); |
|
183 |
+ |
|
184 |
+ |
|
185 |
+include "template.php"; |
|
186 |
+ |
... | ... |
@@ -1,19 +1,14 @@ |
1 | 1 |
<?php |
2 | 2 |
require_once 'lib/api.php'; |
3 |
-require_once 'lib/modal.php'; |
|
4 |
-require_once 'lib/tools.php'; |
|
5 | 3 |
session_start(); |
4 |
+setlocale(LC_TIME, 'de_DE'); |
|
6 | 5 |
|
7 |
-$handle = null; |
|
8 |
-$handle_length = 8; |
|
9 |
-if (isset($_GET['handle'])) { |
|
10 |
- $handle = $_GET['handle']; |
|
11 |
-} else { |
|
12 |
- $random = base64_encode(md5(microtime())); |
|
13 |
- $handle = substr(str_replace(array('+', '=', '/'), '', $random), 0, $handle_length); |
|
6 |
+$handle = htmlspecialchars($_GET['handle']); |
|
7 |
+if ($handle != $_GET['handle']) { |
|
8 |
+ echo "Ungültige ID"; |
|
9 |
+ die(); |
|
14 | 10 |
} |
15 |
- |
|
16 |
-$data = array("handle" => $handle); |
|
11 |
+$data = array("handle" => $_GET['handle']); |
|
17 | 12 |
|
18 | 13 |
$ret = api_call('vorgang/lesen', $data); |
19 | 14 |
$a = $ret['vorgang']; |
... | ... |
@@ -23,163 +18,108 @@ if (isset($_GET['handle']) && $a['revision'] == 0) { |
23 | 18 |
die(); |
24 | 19 |
} |
25 | 20 |
|
26 |
- |
|
27 |
- |
|
28 | 21 |
$previous = 'unbestaetigte.php'; |
29 |
-$headline = 'Auftrag bestätigen'; |
|
30 |
-$content = '<form action="#"> |
|
31 |
-<input type="hidden" id="handle" name="handle" value="'.$handle.'">'; |
|
22 |
+$headline = 'Neuen Auftrag annehmen'; |
|
23 |
+$content = ''; |
|
32 | 24 |
|
33 |
-$content .= '<h3>Kundendaten</h3>'; |
|
34 |
-$content .= ' |
|
35 |
-<div class="row"> |
|
36 |
-<div class="col"><label for="name">Name für den Auftrag</label></div><div class="col"><input type="text" name="auftrag_name" id="name" value="'.$a['name'].'"></div><div class="w-100"></div> |
|
37 |
-<div class="col"><label for="telefon">Telefonnummer für den Auftrag</label></div><div class="col"><input type="text" name="auftrag_telefon" id="telefon" value="'.$a['telefon'].'"></div> |
|
38 |
-</div>'; |
|
39 |
- |
|
40 |
-$content .= '<div class="auftrag-kopf row"> |
|
41 |
-<div class="kundendaten_auftrag col-12 col-sm-6"> |
|
42 |
-<p><em>Angaben des Kunden:</em></p> |
|
43 |
-<p id="auftrag_kundenadresse">'; |
|
44 |
-$content .= adresse($a['kundendaten'], 'auftragsdaten'); |
|
45 |
- |
|
46 |
-$content .= '</p>'; |
|
47 |
-$content .= '</div> |
|
48 |
-<div class="kundendaten_kunde col-12 col-sm-6"> |
|
49 |
-<p><em>Kundendaten:</em></p> |
|
50 |
-<p id="kundendaten_kundenadresse">---</p>'; |
|
51 |
-$content .= '<input type="hidden" name="kundendaten_kundennr" id="kundendaten_kundennr" value="'.(isset($a['kundennr']) ? $a['kundennr'] : '').'"><button class="btn btn-secondary" id="btn_kunde_suchen">Kunde suchen</button> <button class="btn btn-outline-secondary" id="btn_kunde_aendern">Kunde ändern</button> '; |
|
52 |
-$content .= '</div>'; |
|
53 |
- |
|
54 |
-$content .= '</div>'; |
|
25 |
+if (! $a['status']['bestellt']) { |
|
26 |
+ $content .= '<h4 class="incomplete">Dieser Auftrag ist nicht abgeschlossen worden!</h4>'; |
|
27 |
+} |
|
28 |
+$name = $a['name']; |
|
29 |
+if (!$name) { |
|
30 |
+ $name = '<em>kein Name angegeben</em>'; |
|
31 |
+} |
|
55 | 32 |
|
33 |
+$kdname = ''; |
|
34 |
+if (isset($a['kundennr'])) { |
|
35 |
+ $data = array("kundennr" => $a['kundennr']); |
|
36 |
+ $ret = api_call('kunde/laden', $data); |
|
37 |
+ if (isset($ret['kunde'])) { |
|
38 |
+ $kdname .= '#'.$ret['kunde']['kundennr'].': '; |
|
39 |
+ if (isset($ret['kunde']['firma'])) { |
|
40 |
+ $kdname .= $ret['kunde']['firma']; |
|
41 |
+ } else { |
|
42 |
+ $kdname .= $ret['kunde']['nachname']; |
|
43 |
+ if (isset($ret['kunde']['vorname'])) { |
|
44 |
+ $kdname .= ', '.$ret['kunde']['vorname']; |
|
45 |
+ } |
|
46 |
+ } |
|
47 |
+ if (isset($ret['kunde']['ort'])) { |
|
48 |
+ $kdname .= ' ('.$ret['kunde']['ort'].')'; |
|
49 |
+ } |
|
50 |
+ } |
|
51 |
+} |
|
52 |
+if (! $kdname) { |
|
53 |
+ $kd = $a['kundendaten']; |
|
54 |
+ $kdname = $kd['vorname'].' '.$kd['nachname']."<br>\n".$kd['adresse']."<br>\n".$kd['plz'].' '.$kd['ort']; |
|
55 |
+} |
|
56 | 56 |
|
57 |
-$content .= '<div class="unterauftrag-container row">'; |
|
57 |
+$content .= '<div class="auftrag"> |
|
58 |
+<h4>'.$name.'</h4> |
|
59 |
+<h4>'.$a['telefon'].'</h4>'; |
|
60 |
+if ($kdname) { |
|
61 |
+ $content .= '<p class="kundenname">'.$kdname.'</p>'; |
|
62 |
+} |
|
63 |
+$content .= '<p class="datum">'.strftime('%a, %d.%m.%Y %H:%M', $a['erstellt']).'</p>'; |
|
58 | 64 |
foreach ($a['bestellung'] as $best) { |
59 | 65 |
// Evtl. Mehrere Posten in dieser Bestellung |
60 |
- $content .= '<div class="unterauftrag col-12">'; |
|
61 |
- |
|
62 |
- $obst = array(); |
|
63 |
- foreach ($best['gitterbox'] as $gb) { |
|
64 |
- $img = '<img class="gitterbox" src="/assets/images/gitterbox.png"><br>'; |
|
65 |
- if ($gb['id']) { |
|
66 |
- $img .= 'GB #'.$gb['id']; |
|
67 |
- } else { |
|
68 |
- $img .= 'Gitterbox'; |
|
69 |
- } |
|
70 |
- $obst[] = '<a href="#" class="gitterbox">'.$img.'</a>'; |
|
66 |
+ $content .= '<div class="unterauftrag">'; |
|
67 |
+ $obst = ''; |
|
68 |
+ if (count($best['gitterbox']) == 1) { |
|
69 |
+ $obst .= "1 Gitterbox"; |
|
70 |
+ } elseif (count($best['gitterbox']) > 1) { |
|
71 |
+ $obst .= count($best['gitterbox'])." Gitterboxen"; |
|
71 | 72 |
} |
73 |
+ /* Wenn wir die Gitterbox-IDs nutzen, dann sowas: |
|
74 |
+ foreach ($best['gitterbox'] as $g) { |
|
75 |
+ $obst .= '[ GB #'.$g['id'].' ] '; |
|
76 |
+ } */ |
|
72 | 77 |
foreach ($best['anhaenger'] as $anh) { |
73 |
- $img = '<img class="anhaenger" src="/assets/images/anhaenger.png"><br>'; |
|
74 | 78 |
if (isset($anh['kennz'])) { |
75 |
- $img .= ' <strong>'.$anh['kennz'].'</strong> '; |
|
79 |
+ $obst .= ' Anhänger <strong>'.$anh['kennz'].'</strong> '; |
|
76 | 80 |
} else { |
77 |
- $img .= ' <em>Anhänger</em>'; |
|
81 |
+ $obst .= ' Anhänger'; |
|
78 | 82 |
} |
79 |
- $obst[] = '<a href="#" class="anhaenger">'.$img.'</a>'; |
|
80 | 83 |
} |
81 |
- foreach ($obst as $key => $val) { |
|
82 |
- $obst[$key] = '<div class="col">'.$val.'</div>'; |
|
83 |
- } |
|
84 |
- $content .= '<div class="lieferart row">'.implode('', $obst).'<div class="col"><a href="#" class="gitterbox_neu">+<br>Weitere Lieferung</a></div></div>'; |
|
85 |
- $content .= '<div class="obstmenge row">'; |
|
86 |
- $val = 0; |
|
87 |
- if (isset($best['obstmenge'])) { |
|
88 |
- $val = $best['obstmenge']; |
|
89 |
- } |
|
90 |
- $content .= '<div class="col"><div class="row"><div class="col"><label for="obstmenge">Obstmenge:</label></div><div class="col"><input type="number" id="obstmenge" name="obstmenge" value="'.$val.'" step="10" min="0" maxlength="5"></div></div> |
|
91 |
- <div class="row">'; |
|
92 |
- foreach (array(50, 100, 150, 200, 250, 300, 350, 400) as $v) { |
|
93 |
- $v = max((count($best['gitterbox'])-1),0) * 400 + $v; |
|
94 |
- $content .= '<div class="col"><button type="button" class="obstmenge_vorschlag btn btn-outline-secondary">'.$v.'</button></div> '; |
|
95 |
- } |
|
96 |
- $content .= '</div></div></div>'; |
|
84 |
+ $content .= '<p class="lieferart">'.$obst.'</p>'; |
|
97 | 85 |
// Gebrauchte |
98 |
- $sel = 'gebrauchte_nein'; |
|
99 | 86 |
if ($best['gebrauchte']) { |
100 |
- $sel = 'gebrauchte_ja'; |
|
87 |
+ $content .= '<p class="gebrauchte">Gebrauchte Kartons: <strong>JA</strong></p>'; |
|
88 |
+ } else { |
|
89 |
+ $content .= '<p class="gebrauchte">Gebrauchte Kartons: <strong>NEIN</strong></p>'; |
|
101 | 90 |
} |
102 |
- $content .= '<div class="row"> |
|
103 |
- <div class="gebrauchte col-12 col-sm-6">Gebrauchte Kartons:</div><div class="col-sm-6 col-12"><span class="buttonset"> |
|
104 |
- <input type="radio" name="gebrauchte" id="gebrauchte_ja" value="gebrauchte_ja" '.($best['gebrauchte'] ? 'checked="checked"' : '').'> <label for="gebrauchte_ja">JA</label> |
|
105 |
- <input type="radio" name="gebrauchte" id="gebrauchte_nein" value="gebrauchte_nein" '.($best['gebrauchte'] ? '' : 'checked="checked"').'> <label for="gebrauchte_nein">NEIN</label> </span> |
|
106 |
- </div></div>'; |
|
107 | 91 |
// Neue |
108 |
- $content .= ' |
|
109 |
- <div class="neue"> |
|
110 |
- <div class="row"><div class="col-12">Neue:</div></div> |
|
111 |
- <div class="row"><div class="col-12"><span class="buttonset"> |
|
112 |
- <input type="radio" name="neue" value="3er" id="btn_neue_3er" '.(isset($best['neue']['3er']) && $best['neue']['3er'] == '100%' ? 'checked="checked"' : '').'> <label for="btn_neue_3er">3er</label> |
|
113 |
- <input type="radio" name="neue" value="5er" id="btn_neue_5er" '.(isset($best['neue']['5er']) && $best['neue']['5er'] == '100%' ? 'checked="checked"' : '').'> <label for="btn_neue_5er">5er</label> |
|
114 |
- <input type="radio" name="neue" value="10er" id="btn_neue_10er" '.(isset($best['neue']['10er']) && $best['neue']['10er'] == '100%' ? 'checked="checked"' : '').'> <label for="btn_neue_10er">10er</label> |
|
115 |
- <input type="radio" name="neue" value="sonstiges" id="btn_neue_sonstiges" '.((isset($best['neue']['10er']) && $best['neue']['10er'] == '100%') || (isset($best['neue']['5er']) && $best['neue']['5er'] == '100%') || (isset($best['neue']['3er']) && $best['neue']['3er'] == '100%') ? '' : 'checked="checked"').'> <label for="btn_neue_sonstiges">Sonstiges</label> |
|
116 |
- </span> |
|
117 |
- </div></div>'; |
|
118 |
- $neue = array("3er" => '', "5er" => '', "10er" => ''); |
|
119 |
- foreach ($neue as $key => $val) { |
|
120 |
- $val = ''; |
|
121 |
- if (isset($best['neue'][$key])) { |
|
122 |
- $val = $best['neue'][$key]; |
|
123 |
- } |
|
124 |
- $neue[] = '<div class="row"><div class="col-5 col-sm-3">Neue <strong>'.$key.'</strong>:</div><div class="col-7 col-sm-6"><input type="text" id="neue_'.$key.'" value="'.$val.'"></div><div class="col-12 col-sm-3"><button type="button" class="btn btn-secondary" id="button_halb_'.$key.'">Halbe Liter in '.$key.'</button></div></div>'; |
|
92 |
+ $neue = array(); |
|
93 |
+ if (count($best['neue']) == 1) { |
|
94 |
+ $key = array_keys($best['neue']); |
|
95 |
+ if ($key[0] != 'sonstiges') { |
|
96 |
+ $neue[] = 'Nur/Zuerst <strong>'.$key[0].'</strong>'; |
|
97 |
+ } |
|
98 |
+ } else { |
|
99 |
+ foreach ($best['neue'] as $key => $val) { |
|
100 |
+ $neue[] = '<strong>'.$key.'</strong>: '.$val; |
|
101 |
+ } |
|
125 | 102 |
} |
126 | 103 |
if (isset($best['neue']['sonstiges'])) { |
127 | 104 |
$neue[] = '<em>'.$best['neue']['sonstiges'].'</em>'; |
128 | 105 |
} |
129 |
- $content .= '<div class="neue_detail">'.implode('', $neue).'</div>'; |
|
130 |
- $content .= '</div>'; |
|
131 |
- $content .= '<div class="anmerkungen row"><div class="col"><textarea name="anmerkungen" id="anmerkungen">'.htmlspecialchars($best['anmerkungen']).'</textarea></div></div>'; |
|
132 |
- $content .= '<div class="frischsaft row"><div class="col-5 col-sm-2">Frischsaft:</div><div class="col-7 col-sm-4"><span class="buttonset"> |
|
133 |
- <input type="radio" name="frischsaft_choose" id="frischsaft_nein" '.(isset($best['frischsaft']) && $best['frischsaft'] > 0 ? '' : 'checked="checked"').'> <label for="frischsaft_nein">Nein</label> |
|
134 |
- <input type="radio" name="frischsaft_choose" id="frischsaft_ja" '.(isset($best['frischsaft']) && $best['frischsaft'] > 0 ? 'checked="checked"' : '').'> <label for="frischsaft_ja">Ja</label></span> |
|
135 |
- </div> |
|
136 |
- <div id="frischsaft_liter" class="col-12 col-sm-6"> |
|
137 |
- <div class="row"> |
|
138 |
- <div class="col-6"><input type="number" name="frischsaft" value="'.htmlspecialchars($best['frischsaft']).'"></div> |
|
139 |
- <div class="col-6">Liter frisch</div> |
|
140 |
- </div> |
|
141 |
- </div> |
|
142 |
- </div>'; |
|
143 |
- if (count($a['bestellung']) > 1) { |
|
144 |
- $content .= '<div class="unterauftrag_bestaetigen"><button type="button" class="btn btn-secondary">Diesen Unterauftrag separat annehmen</button></div>'; |
|
106 |
+ $content .= '<div class="neue"><p>'.implode('</p><p>', $neue).'</p></div>'; |
|
107 |
+ if (isset($best['anmerkungen'])) { |
|
108 |
+ $content .= '<div class="anmerkungen">'.htmlspecialchars($best['anmerkungen']).'</div>'; |
|
145 | 109 |
} |
146 |
- $content .= '</div>'; // Unterauftrag |
|
110 |
+ if (isset($best['frischsaft'])) { |
|
111 |
+ $content .= '<div class="frischsaft">'.htmlspecialchars($best['frischsaft']).' Liter frisch</div>'; |
|
147 | 112 |
} |
148 | 113 |
|
149 |
-$content .= '</div>'; // unterauftrag-container |
|
150 |
-$content .= '<div class="auftrag_bestaetigen"><button type="button" class="btn btn-primary">Auftrag bestätigen</button> |
|
151 |
-<button type="button" class="btn btn-secondary">Auftrag annehmen und sofort verarbeiten</button></div>'; |
|
152 |
-$content .= '</form>'; |
|
153 |
- |
|
154 |
-$content .= ' |
|
155 |
- <div class="modal fade" id="gitterbox-neu-dialog" tabindex="-1" role="dialog" aria-labelledby="Gitterbox" aria-hidden="true"> |
|
156 |
- <div class="modal-dialog"> |
|
157 |
- <div class="modal-content"> |
|
158 |
- <div class="modal-header"> |
|
159 |
- <h4 class="modal-title">Neue Gitterbox erfassen</h4> |
|
160 |
- </div> |
|
161 |
- |
|
162 |
- <div class="modal-body"> |
|
163 |
- <p>ID-Nummer: <input type="text" name="gb" id="gitterbox-neu-id" value=""></p> |
|
164 |
- <p><button type="button" class="btn btn-primary" id="gitterbox-neu-gb">Gitterbox hinzufügen</button></p> |
|
165 |
- </div> |
|
114 |
+ $content .= '</div>'; // Unterauftrag |
|
115 |
+} |
|
116 |
+$content .= '</div>'; // auftrag |
|
166 | 117 |
|
167 |
- <div class="modal-body"> |
|
168 |
- <p>Kennzeichen: <input type="text" name="kennz" id="gitterbox-neu-kennz" value=""></p> |
|
169 |
- <p><button type="button" class="btn btn-primary" id="gitterbox-neu-anh">Anhänger hinzufügen</button></p> |
|
170 |
- </div> |
|
171 | 118 |
|
172 |
- <div class="modal-footer"> |
|
173 |
- <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Abbrechen</button> |
|
174 |
- </div> |
|
175 |
- </div> |
|
176 |
- </div> |
|
177 |
- </div> |
|
178 |
-'; |
|
119 |
+$content .= '<div class="auftrag_bestaetigen"> |
|
120 |
+<p><a href="save.php?handle='.$handle.'&action=bestaetigen" class="btn btn-primary">Auftrag bestätigen</a></p> |
|
121 |
+<p><a href="save.php?handle='.$handle.'&action=loeschen" class="btn btn-secondary">Auftrag löschen</a></p>'; |
|
179 | 122 |
|
180 |
-$content .= modal_kundensuche($a['kundendaten']); |
|
181 |
-$content .= modal_kunde_aendern(); |
|
182 |
-$content .= modal_confirmation(); |
|
183 | 123 |
|
184 | 124 |
|
185 | 125 |
include "template.php"; |
... | ... |
@@ -0,0 +1,30 @@ |
1 |
+<?php |
|
2 |
+require_once 'lib/api.php'; |
|
3 |
+require_once 'lib/tools.php'; |
|
4 |
+session_start(); |
|
5 |
+ |
|
6 |
+$data = array("handle" => $_GET['handle']); |
|
7 |
+ |
|
8 |
+$ret = api_call('vorgang/lesen', $data); |
|
9 |
+ |
|
10 |
+if (!isset($ret['vorgang'])) { |
|
11 |
+ echo 'error!'; |
|
12 |
+ die(); |
|
13 |
+} |
|
14 |
+ |
|
15 |
+$vorgang = $ret['vorgang']; |
|
16 |
+ |
|
17 |
+ |
|
18 |
+if ($_GET['action'] == 'bestaetigen') { |
|
19 |
+ $vorgang['status']['bestaetigt'] = time(); |
|
20 |
+} elseif ($_GET['action'] == 'loeschen') { |
|
21 |
+ $vorgang['status']['geloescht'] = time(); |
|
22 |
+} |
|
23 |
+ |
|
24 |
+ |
|
25 |
+$ret = api_call('vorgang/aendern', $vorgang); |
|
26 |
+if (!isset($ret['vorgang'])) { |
|
27 |
+ return; |
|
28 |
+} |
|
29 |
+ |
|
30 |
+header("Location: unbestaetigte.php"); |
... | ... |
@@ -4,9 +4,11 @@ session_start(); |
4 | 4 |
setlocale(LC_TIME, 'de_DE'); |
5 | 5 |
|
6 | 6 |
$data = array("filter" => array( |
7 |
- "field" => "status", |
|
8 |
- "value" => "%bestaetigt%", |
|
9 |
- "relation" => "notlike")); |
|
7 |
+ "subFilter" => array( |
|
8 |
+ array("field" => "status", "value" => "%bestaetigt%", "relation" => "notlike"), |
|
9 |
+ array("field" => "status", "value" => "%geloescht%", "relation" => "notlike") |
|
10 |
+ ), |
|
11 |
+ "subFilterConnective" => "AND")); |
|
10 | 12 |
|
11 | 13 |
$auftraege = api_call('vorgang/liste', $data); |
12 | 14 |
|
... | ... |
@@ -14,7 +16,7 @@ $previous = 'index.php'; |
14 | 16 |
$headline = 'Neue Aufträge annehmen'; |
15 | 17 |
$content = ''; |
16 | 18 |
|
17 |
-$content .= '<div class="navbutton"><a class="btn btn-primary" href="auftrag_bestaetigen.php">Auftrag manuell erfassen</a></div>'; |
|
19 |
+//$content .= '<div class="navbutton"><a class="btn btn-primary" href="auftrag_bestaetigen.php">Auftrag manuell erfassen</a></div>'; |
|
18 | 20 |
$content .= '<div class="auftrag-container">'; |
19 | 21 |
|
20 | 22 |
foreach ($auftraege["vorgaenge"] as $a) { |
... | ... |
@@ -112,5 +114,5 @@ $content .= '</div>'; // auftrag-container |
112 | 114 |
|
113 | 115 |
include "template.php"; |
114 | 116 |
|
115 |
-print_r($auftraege["vorgaenge"]); |
|
117 |
+//print_r($auftraege["vorgaenge"]); |
|
116 | 118 |
|
117 | 119 |