4f087e862da3aa3216cfce5f94890c6d97e7bb83
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

1) <?php
Bernd Wurst API-Authtoken, Idle-Warnung...

Bernd Wurst authored 4 years ago

2) require_once "lib/api.php";
3) require_once "lib/auftrag.php";
Bernd Wurst Session zerstören wenn der...

Bernd Wurst authored 2 months ago

4) if (!file_exists("../data/".date("Y"))) {
5)     mkdir("../data/".date("Y"));
6) }
7) 
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

8) session_start();
Bernd Wurst kill idle sessions

Bernd Wurst authored 1 year ago

9) if (isset($_SESSION['last_activity']) && $_SESSION['last_activity'] < time()-(20*60)) {
10)     // Session seit 20 Minuten nicht benutzt
11)     if (isset($_SESSION['kundennr']) || isset($_SESSION['orderid'])) {
12)         // Session hat Inhalt
13)         // Auftrag lokal speichern
Bernd Wurst time() am Beginn der Datein...

Bernd Wurst authored 1 year ago

14)         $filename = "../data/".date('Y').'/'.time().'-canceledsession.json';
Bernd Wurst kill idle sessions

Bernd Wurst authored 1 year ago

15)         if (isset($_SESSION['orderid'])) {
Bernd Wurst time() am Beginn der Datein...

Bernd Wurst authored 1 year ago

16)             $filename = "../data/".date('Y').'/'.time().'-canceledsession-'.$_SESSION['orderid'].'.json';
Bernd Wurst kill idle sessions

Bernd Wurst authored 1 year ago

17)         }
18)         @file_put_contents($filename, json_encode($_SESSION));
Bernd Wurst Noch ein Versuch, den Mode...

Bernd Wurst authored 1 month ago

19)         header('Location: clear.php');
20)         die();
Bernd Wurst kill idle sessions

Bernd Wurst authored 1 year ago

21)     }
22) }
23) $_SESSION['last_activity'] = time();
Bernd Wurst API-Aufrufe über Guzzle um...

Bernd Wurst authored 1 year ago

24) $_SESSION['warnings'] = [];
25) 
26) $_SESSION['angeliefert'] = true;
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

27) 
Bernd Wurst API-Authtoken, Idle-Warnung...

Bernd Wurst authored 4 years ago

28) $handle_length = 8;
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

29) if (! isset($_SESSION['handle']) || !$_SESSION['handle']) {
30)     $random = base64_encode(md5(microtime()));
Bernd Wurst API-Authtoken, Idle-Warnung...

Bernd Wurst authored 4 years ago

31)     $_SESSION['handle'] = substr(str_replace(array('+', '=', '/'), '', $random), 0, $handle_length);
Bernd Wurst Änderungen Stand 2019

Bernd Wurst authored 4 years ago

32)     $_SESSION['date'] = date('Y-m-d H:i:s.v');
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

33)     $_SESSION['complete'] = false;
34) }
35) 
Bernd Wurst Änderungen Stand 2019

Bernd Wurst authored 4 years ago

36) 
Bernd Wurst API-Aufrufe über Guzzle um...

Bernd Wurst authored 1 year ago

37) function showError()
38) {
39)     switch ($_REQUEST['form']) {
40)         case 'start':
41)                 $redirect = 'index.php?error&num='.urlencode($number).'&name='.urlencode($name);
42)                 break;
43)         case 'address':
44)                 $redirect = 'address.php?error';
45)                 break;
46)         case 'anlieferung':
47)                 $redirect = 'anlieferung.php?error';
48)                 break;
49)         case 'gitterbox':
50)             $redirect = 'gitterbox.php?error';
51)             break;
52)         case 'obstart':
53)             $redirect = 'obstart.php?error';
54)             break;
55)         case 'gebrauchte':
56)             $redirect = 'gebrauchte.php?error';
57)             break;
58)         case 'auftrag':
59)             $redirect = 'auftrag.php?error';
60)             break;
61)          case 'frischsaft':
62)             $redirect = 'frischsaft.php?error';
63)             break;
64)         case 'summary':
65)             $redirect = 'summary.php?error';
66)             break;
67)     }
68)     header('Location: '.$redirect);
69)     die();
70) }
71) 
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

72) $redirect = NULL;
73) if (isset($_REQUEST['form'])) {
74)     switch ($_REQUEST['form']) {
Bernd Wurst Spätere Anlieferung eingebaut

Bernd Wurst authored 6 years ago

75)         case 'start':
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

76)             $number = '';
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

77)             if (isset($_REQUEST['phone']) && trim($_REQUEST['phone']) != '') {
Bernd Wurst Ergänze lokale Vorwahl bei...

Bernd Wurst authored 6 years ago

78)                 $number = trim($_REQUEST['phone']);
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

79)             }
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

80)             $name = '';
81)             if (isset($_REQUEST['name']) && trim($_REQUEST['name']) != '') {
82)                 $name = trim($_REQUEST['name']);
83)             }
84) 
Bernd Wurst Änderungen Stand 2019

Bernd Wurst authored 4 years ago

85)             if (substr($number, 0, 1) != 0 && substr($number, 0, 3) != '+49') {
Bernd Wurst Ergänze lokale Vorwahl bei...

Bernd Wurst authored 6 years ago

86)                 $number = '07192'.$number;
87)             }
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

88) 
Bernd Wurst Fange ungültige Telefonnumm...

Bernd Wurst authored 1 year ago

89)             $number = format_number_national($number);
90) 
91)             if (! $number || !$name || !format_number_api($number)) {
92)                 $redirect = 'index.php?error&num='.urlencode($number).'&name='.urlencode($name);
93)                 break;
94)             }
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

95) 
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

96)             $_SESSION['name'] = htmlspecialchars($name);
Bernd Wurst anmerkungen ermöglicht

Bernd Wurst authored 6 years ago

97)             $_SESSION['phone'] = htmlspecialchars($number);
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

98)             if (isset($_REQUEST['save']) && $_REQUEST['save'] == 'yes' && $_SESSION['mode'] != 'local') {
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

99)                 setcookie('NAME', $name, time() + 24*3600*500, "");
Bernd Wurst Cookie löschbar, Datenschut...

Bernd Wurst authored 6 years ago

100)                 setcookie('NUMBER', $number, time() + 24*3600*500, "");
101)             }
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

102) 
Bernd Wurst Dateinamen geändert

Bernd Wurst authored 6 years ago

103)             $redirect = 'address.php';
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

104)             break;
105) 
Bernd Wurst Spätere Anlieferung eingebaut

Bernd Wurst authored 6 years ago

106)         case 'address':
Bernd Wurst frage E-Mail-Adresse ab

Bernd Wurst authored 1 year ago

107)             $fields = array("firma", "fname", "lname", "address", "zip", "city", "email");
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

108)             foreach ($fields as $f) {
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

109)                 if (isset($_REQUEST[$f]) && trim($_REQUEST[$f]) != '') {
Bernd Wurst anmerkungen ermöglicht

Bernd Wurst authored 6 years ago

110)                     $_SESSION[$f] = trim(htmlspecialchars($_REQUEST[$f]));
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

111)                 } else {
112)                     if (! isset($_SESSION[$f])) {
113)                         $_SESSION[$f] = '';
114)                     }
115)                 }
116)             }
Bernd Wurst Fehlermeldungen auf BS4 por...

Bernd Wurst authored 6 years ago

117)             if ($_SESSION['lname'] == '') {
118)                 $redirect = 'address.php?error';
119)                 break;
120)             }
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

121)             if (!isset($_SESSION['kundennr']) || !$_SESSION['kundennr']) {
122)                 $_SESSION['kundennr'] = erstelle_kunde($_SESSION);
Bernd Wurst API-Aufrufe über Guzzle um...

Bernd Wurst authored 1 year ago

123)                 if (!$_SESSION['kundennr']) {
124)                     showError();
125)                     }
Bernd Wurst frage E-Mail-Adresse ab

Bernd Wurst authored 1 year ago

126)             } else {
127)                 if (isset($_SESSION['email']) && $_SESSION['email']) {
128)                     update_kunde($_SESSION['kundennr'], ['email' => $_SESSION['email']]);
129)                 }
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

130)             }
131) 
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

132)             if ($_SESSION['mode'] == 'local') {
133)                 $_SESSION['angeliefert'] = true;
134)                 $redirect = 'gitterbox.php';
135)             } elseif (isset($_SESSION['angeliefert'])) {
Bernd Wurst Spätere Anlieferung eingebaut

Bernd Wurst authored 6 years ago

136)                 if ($_SESSION['angeliefert']) {
137)                     $redirect = 'gitterbox.php';
138)                 } else {
139)                     $redirect = 'gitterbox_spaeter.php';
140)                 }
141)             } else {
142)                 $redirect = 'anlieferung.php';
143)             }
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

144)             break;
145) 
Bernd Wurst Spätere Anlieferung eingebaut

Bernd Wurst authored 6 years ago

146)         case 'anlieferung':
147)             if (isset($_REQUEST['schonda'])) {
148)                 $_SESSION['angeliefert'] = true;
149)                 $redirect = 'gitterbox.php';
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

150)             }
Bernd Wurst Spätere Anlieferung eingebaut

Bernd Wurst authored 6 years ago

151)             if (isset($_REQUEST['kommtnoch'])) {
152)                 $_SESSION['angeliefert'] = false;
153)                 $redirect = 'gitterbox_spaeter.php';
154)             }
155)             break;
156)         case 'gitterbox':
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

157)             if (isset($_REQUEST['lieferart'])) {
158)                 if ($_REQUEST['lieferart'] == 'gitterbox') {
159)                     $_SESSION['lieferart'] = 'gitterbox';
Bernd Wurst anmerkungen ermöglicht

Bernd Wurst authored 6 years ago

160)                     $_SESSION['gbcount'] = htmlspecialchars($_REQUEST['gbcount']);
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

161)                 }
162)                 if ($_REQUEST['lieferart'] == 'anhaenger') {
163)                     $_SESSION['lieferart'] = 'anhaenger';
Bernd Wurst anmerkungen ermöglicht

Bernd Wurst authored 6 years ago

164)                     $_SESSION['kennz'] = htmlspecialchars($_REQUEST['kennz']);
Bernd Wurst Spätere Anlieferung eingebaut

Bernd Wurst authored 6 years ago

165)                     if ($_SESSION['angeliefert'] === false && ! $_SESSION['kennz']) {
166)                         $redirect = 'gitterbox_spaeter.php?error';
167)                         break;
168)                     }
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

169)                 }
170)             }
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

171)             $redirect = 'obstart.php';
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

172)             break;
173) 
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

174)          case 'obstart':
175)             $_SESSION['obstart'] = $_REQUEST['obstart'];
176)             $redirect = 'gebrauchte.php';
177) 
Bernd Wurst Spätere Anlieferung eingebaut

Bernd Wurst authored 6 years ago

178)          case 'gebrauchte':
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

179)             if (isset($_REQUEST['kartonsja'])) {
180)                 $_SESSION['kartons'] = true;
181)             } 
182)             if (isset($_REQUEST['kartonsnein'])) {
183)                 $_SESSION['kartons'] = false;
184)             }
185) 
Bernd Wurst Dateinamen geändert

Bernd Wurst authored 6 years ago

186)             $redirect = 'auftrag.php';
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

187)             break;
Bernd Wurst Spätere Anlieferung eingebaut

Bernd Wurst authored 6 years ago

188)          case 'auftrag':
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

189)             if (isset($_REQUEST['3er'])) {
190)                 $_SESSION['neue'] = '3er';
191)             }
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

192)             if (isset($_REQUEST['5er'])) {
193)                 $_SESSION['neue'] = '5er';
194)             }
195)             if (isset($_REQUEST['10er'])) {
196)                 $_SESSION['neue'] = '10er';
197)             }
198)             if (isset($_REQUEST['submit']) && isset($_REQUEST['sonstiges']) && $_REQUEST['sonstiges'] != '') {
199)                 $_SESSION['neue'] = 'sonstiges';
Bernd Wurst anmerkungen ermöglicht

Bernd Wurst authored 6 years ago

200)                 $_SESSION['sonstiges'] = htmlspecialchars($_REQUEST['sonstiges']);
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

201)             }
202) 
203) 
Bernd Wurst Dateinamen geändert

Bernd Wurst authored 6 years ago

204)             $redirect = 'frischsaft.php';
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

205)             break;
206) 
Bernd Wurst Spätere Anlieferung eingebaut

Bernd Wurst authored 6 years ago

207)          case 'frischsaft':
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

208)             if (isset($_REQUEST['frischsaftnein'])) {
209)                 $_SESSION['frischsaft'] = 0;
210)             } elseif (isset($_REQUEST['frischsaft'])) {
Bernd Wurst anmerkungen ermöglicht

Bernd Wurst authored 6 years ago

211)                 $_SESSION['frischsaft'] = htmlspecialchars($_REQUEST['frischsaft']);
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

212)             }
213) 
Bernd Wurst Dateinamen geändert

Bernd Wurst authored 6 years ago

214)             $redirect = 'summary.php';
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

215)             break;
Bernd Wurst Spätere Anlieferung eingebaut

Bernd Wurst authored 6 years ago

216)         case 'summary':
Bernd Wurst anmerkungen ermöglicht

Bernd Wurst authored 6 years ago

217)             if (isset($_REQUEST['anmerkungen'])) {
218)                 $_SESSION['anmerkungen'] = htmlspecialchars($_REQUEST['anmerkungen']);
219)             }
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

220) 
221)             $_SESSION['complete'] = true;
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

222)             $redirect = 'finish.php';
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

223)             break;
224) 
225)     }
226) }
227) 
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

228) /*
229)  * Um das Speichern in der API kümmern wir uns, wenn Kundendaten, Obstart und grundsätzliche Auftragsdaten feststehen
230)  */
231) if (isset($_SESSION['neue'])) {
232)     // Bevor dieses Datenfeld vorhanden ist, macht Speichern keinen Sinn
233)     $auftrag = [];
234)     /* Herunterladen bringt nichts, da wir einfach immer unsere bekannten Daten rein schieben. Parallelität ist nicht gewünscht
235)      * if (isset($auftrag['id'])) {
236)         // Auftrag ist schon in der API, aktuellen Stand herunter laden
237)         $auftrag = api_call('GET', 'orders/'.$auftrag['id']);
238)     }*/
239) 
240)     // customer
241)     if (isset($_SESSION['kundennr'])) {
242)         $auftrag['customer'] = $_SESSION['kundennr'];
Bernd Wurst API-Aufrufe über Guzzle um...

Bernd Wurst authored 1 year ago

243)         $auftrag['notificationName'] = $_SESSION['name'];
244)         $auftrag['notificationPhone'] = $_SESSION['phone'];
Bernd Wurst Speichere (neu eingegebene)...

Bernd Wurst authored 1 year ago

245)         $auftrag['notificationEmail'] = isset($_SESSION['email']) ? $_SESSION['email'] : null;
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

246)     }
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

247)     // fruitType
248)     $ret = api_call('GET', 'fruitTypes');
Bernd Wurst API-Aufrufe über Guzzle um...

Bernd Wurst authored 1 year ago

249)     $ret = $ret['data'];
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

250)     foreach ($ret as $fruit) {
251)         if ($_SESSION['obstart'] == $fruit['label']) {
252)             $auftrag['fruitType'] = $fruit['id'];
253)         }
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

254)     }
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

255)     // containers
256)     if (isset($_SESSION['lieferart']) && $_SESSION['lieferart'] == 'gitterbox' && isset($_SESSION['gbcount']) && $_SESSION['gbcount'] > 0) {
257)         $auftrag['containers'] = array_fill(0, $_SESSION['gbcount'], [ "type" => "box", "weight" => 400 ]);
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

258)     }
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

259)     if (isset($_SESSION['lieferart']) && $_SESSION['lieferart'] == 'anhaenger') {
260)         if (!isset($_SESSION['kennz'])) {
261)             $_SESSION['kennz'] = null;
262)         }
263)         $auftrag['containers'] = [
264)             ["type" => "trailer",
265)             "weight" => 0,
266)             "label" => $_SESSION['kennz']]
267)         ];
268)     }
269)     // usedPackages
270)     if (isset($_SESSION['kartons'])) {
271)         $auftrag['usedPackages'] = (bool) $_SESSION['kartons'];
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

272)     }
273) 
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

274)     // plannedPackagings
275)     if (isset($_SESSION['neue'])) {
276)         if ($_SESSION['neue'] == 'sonstiges') {
277)             $auftrag['notes'] = (isset($_SESSION['anmerkungen']) ? $_SESSION['anmerkungen'] . "\n\n" : '') . $_SESSION["sonstiges"];
Bernd Wurst Bugfix: Frischsaft wurde ni...

Bernd Wurst authored 1 year ago

278)         }
279)         $plan = [];
280)         $ret = api_call('GET', 'packageTypes');
281)         $ret = $ret['data'];
282)         foreach ($ret as $pt) {
283)             if ($pt['label'] == $_SESSION['neue']) {
284)                 $plan[] = [ "packageType" => $pt['id'],
285)                             "rest" => true ];
286)             }
287)             if ($pt['label'] == 'frischsaft' && isset($_SESSION['frischsaft']) && $_SESSION['frischsaft'] > 0) {
288)                 $plan[] = [ "packageType" => $pt['id'],
289)                             "count" => $_SESSION['frischsaft']];
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

290)             }
291)         }
Bernd Wurst Bugfix: Frischsaft wurde ni...

Bernd Wurst authored 1 year ago

292)         $auftrag['plannedPackagings'] = $plan;
293)         
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

294)     }
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

295) 
296) 
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

297)     // notes
Bernd Wurst Session zerstören wenn der...

Bernd Wurst authored 2 months ago

298)     if (!isset($auftrag['notes'])) {
299)         $auftrag['notes'] = '';
300)     }
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

301)     if (isset($_SESSION['anmerkungen']) && $_SESSION['anmerkungen'] != '') {
302)         $auftrag['notes'] = $_SESSION['anmerkungen'] . (isset($_SESSION["sonstiges"]) ? "\n\n" . $_SESSION["sonstiges"] : '');
303)     }
Bernd Wurst Session zerstören wenn der...

Bernd Wurst authored 2 months ago

304)     $auftrag['notes'] .= "\nAuftrag wurde " . ($_SESSION['mode'] == 'local' ? 'am Terminal' : 'mit einem eigenen Gerät') . ' erstellt.';
305)     if (!isset($_SESSION['complete']) || $_SESSION['complete'] == false) {
306)         $auftrag['notes'] .= "\nAuftrag unvollständig erfasst.";
307)     }
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

308) 
Bernd Wurst API-Aufrufe über Guzzle um...

Bernd Wurst authored 1 year ago

309)     // Auftrag lokal speichern
310)     $filename = "../data/".date('Y').'/'.time().'.json';
311)     if (isset($_SESSION['orderid'])) {
Bernd Wurst time() am Beginn der Datein...

Bernd Wurst authored 1 year ago

312)         $filename = "../data/".date('Y').'/'.time().'-'.$_SESSION['orderid'].'.json';
Bernd Wurst API-Aufrufe über Guzzle um...

Bernd Wurst authored 1 year ago

313)     }
314)     @file_put_contents($filename, json_encode($auftrag));
315)      if (isset($_SESSION['orderid']) && $_SESSION['orderid']) {
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

316)         // update
317)         $ret = api_call('PUT', 'orders/'.$_SESSION['orderid'], $auftrag);
318)     } else {
319)         // neu
320)         $ret = api_call('POST', 'orders', $auftrag);
Bernd Wurst API-Aufrufe über Guzzle um...

Bernd Wurst authored 1 year ago

321)     }
322)     if ($ret['status_code'] >= 400) {
323)         foreach ($ret['data']['validation_errors'] as $item) {
Bernd Wurst Fange ungültige Telefonnumm...

Bernd Wurst authored 1 year ago

324)             $_SESSION['warnings'][] = $item['key'].': '.$item['message'];
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

325)         }
Bernd Wurst API-Aufrufe über Guzzle um...

Bernd Wurst authored 1 year ago

326)         return showError();
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

327)     }
Bernd Wurst API-Aufrufe über Guzzle um...

Bernd Wurst authored 1 year ago

328)     $ret = $ret['data'];
329)     $_SESSION['orderid'] = $ret['id'];
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

330) 
Bernd Wurst API-Aufrufe über Guzzle um...

Bernd Wurst authored 1 year ago

331)     if (!isset($ret['id'])) {
332)         echo "Es gabe einen Fehler beim Abspeichern des Auftrags. Wir bitten dies zu entschuldigen und einen Papierauftrag auszufüllen.";
333)         file_put_contents("../error.log", 
334)             date("Y-m-d H:i:s") . ': '.json_encode($auftrag).
335)             print_r($ret, true).'\n', FILE_APPEND | LOCK_EX);
336)         die();
337)     }
338) 
339)     // Auftrag lokal speichern
340)     if (isset($_SESSION['orderid'])) {
Bernd Wurst time() am Beginn der Datein...

Bernd Wurst authored 1 year ago

341)         $filename = "../data/".date('Y').'/'.time().'-'.$_SESSION['orderid'].'.json';
Bernd Wurst API-Aufrufe über Guzzle um...

Bernd Wurst authored 1 year ago

342)     }
343)     @file_put_contents($filename, json_encode($auftrag));
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

344)     /*
345)     if ($ret['status'] == 'error') {
346)         echo 'Es gibt ein Problem beim Speichern des Auftrags. Bitte verwenden Sie diesmal einen Papier-Auftrag.';
347)         die();
348)     }
349)     */
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

350) }
351)