cbb3ed9fb852507c932710af2f446ed5083b3517
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 4 years ago

address.php   2) require_once "lib/api.php";
address.php   3) require_once "lib/auftrag.php";
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php     4) session_start();
step2.php     5) 
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

address.php   6) if (!isset($_SESSION['phone']) || (!isset($_SESSION['name']) && !isset($_SESSION['firma']) && !isset($_SESSION['lname']))) {
address.php   7)     header('Location: index.php?error&num='.urlencode($_SESSION['phone']).'&name='.urlencode($_SESSION['name']));
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php     8)     die();
step2.php     9) }
step2.php    10) 
Bernd Wurst Änderungen Stand 2019

Bernd Wurst authored 4 years ago

address.php  11) 
address.php  12) $content = '';
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

address.php  13) $_SESSION['lname'] = ucwords($_SESSION['name']);
Bernd Wurst API-Aufrufe über Guzzle um...

Bernd Wurst authored 1 year ago

address.php  14) $_SESSION['fname'] = '';
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

address.php  15) if (strpos($_SESSION['name'], ' ') !== false) {
address.php  16)     $parts = explode(" ", ucwords($_SESSION['name']));
address.php  17)     $_SESSION['lname'] = array_pop($parts);
address.php  18)     $_SESSION['fname'] = implode(" ", $parts);
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

address.php  19) }
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

address.php  20) if (isset($_SESSION['name']) && !isset($_SESSION['kundennr'])) {
address.php  21)     $kunde = suche_kunde($_SESSION['name'], $_SESSION['phone']);
address.php  22)     if ($kunde) {
address.php  23)         $_SESSION['kundennr'] = $kunde['id'];
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

address.php  24)     }
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    25) }
step2.php    26) 
step2.php    27) if (isset($_REQUEST['error'])) {
Bernd Wurst Fehlermeldungen auf BS4 por...

Bernd Wurst authored 6 years ago

address.php  28)     $content .= '<div class="card text-white bg-danger mb-3">
address.php  29)     <div class="card-header">Fehler</div>
address.php  30)     <div class="card-body">Bitte geben Sie Ihren Namen an.</div>
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    31)     </div>';
step2.php    32) }
step2.php    33) 
Bernd Wurst besserer Debug-Modus, Handh...

Bernd Wurst authored 4 years ago

address.php  34) 
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    35) $headline = 'Adresse eingeben';
Bernd Wurst frage E-Mail-Adresse ab

Bernd Wurst authored 1 year ago

address.php  36) if (isset($_SESSION['kundennr']) && $_SESSION['kundennr']) {
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

address.php  37)     $headline = 'Willkommen zurück!';
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    38)     $content .= '
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

address.php  39)         <p>Schön, wir kennen uns ja schon! Aus Datenschutzgründen wird Ihre Adresse hier nicht angezeigt. Sofern Sie Änderungen an Ihren Kundendaten wünschen, sprechen Sie uns bitte vor Ort darauf an.</p>';
address.php  40)     $content .= '
address.php  41)         <form class="form" action="save.php" method="post">
address.php  42)         <input type="hidden" name="form" value="address">';
Bernd Wurst frage E-Mail-Adresse ab

Bernd Wurst authored 1 year ago

address.php  43)     if (!kunde_hat_email($_SESSION['kundennr'])) {
address.php  44)         $content .= '<p><strong>Eine kleine Bitte:</strong> Wir kennen bisher noch keine E-Mail-Adresse von Ihnen. Wenn Sie uns eine E-Mail-Adresse angeben, können wir Sie auch per E-Mail über die Fertigstellung Ihres Auftrags benachrichtigen.</p>
address.php  45)         <div class="form-group form-group-lg row">
address.php  46)             <div class="col-sm-12"><input class="form-control" id="email" name="email" type="text" placeholder="E-Mail-Adresse" autocomplete="email"></div>
address.php  47)             </div>';
address.php  48)     }
address.php  49) 
Bernd Wurst reuse JWT token

Bernd Wurst authored 1 year ago

address.php  50)     $content .= '<input name="fname" type="hidden" value="'.(isset($_SESSION['fname']) ? $_SESSION['fname'] : '').'">
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

address.php  51)            <input name="lname" type="hidden" value="'.$_SESSION['lname'].'">
address.php  52)           <div class="form-group form-group-lg">
address.php  53)             <div><input class="btn btn-primary btn-lg" type="submit" value="Weiter &gt;"></div>
address.php  54)         </div>
address.php  55)         </form>
address.php  56) 
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    57)     ';
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

address.php  58) 
address.php  59) 
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    60) } else { 
step2.php    61)     $content .= '
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

address.php  62)         <p>Bitte geben Sie in diesem Schritt Ihre Adresse ein.</p>
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    63)     ';
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

address.php  64) 
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

address.php  65) 
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

address.php  66)     $fields = array("vorname" => "Vorname",
address.php  67)         "nachname" => "Nachname",
address.php  68)         "firma" => "Firmenname",
Bernd Wurst frage E-Mail-Adresse ab

Bernd Wurst authored 1 year ago

address.php  69)         "email" => "E-Mail",
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

address.php  70)         "adresse" => "Adresse",
address.php  71)         "plz" => "PLZ",
address.php  72)         "ort" => "Ort");
address.php  73)     $placeholders = $fields;
address.php  74)     $contents = $kunde;
address.php  75)     foreach ($fields as $field => $label) {
address.php  76)         if (isset($kunde[$field]) && $kunde[$field] == 'bekannt') {
address.php  77)             $placeholders[$field] = $label.' wie beim letzten Besuch';
address.php  78)             $contents[$field] = '';
address.php  79)         } elseif (!isset($contents[$field])) {
address.php  80)             $contents[$field] = '';
address.php  81)         }
address.php  82) 
address.php  83)     }
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    84) 
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

address.php  85) 
address.php  86)     $content .= '
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

address.php  87)         <form class="form" action="save.php" method="post">
address.php  88)         <input type="hidden" name="form" value="address">';
address.php  89)     /*if (isset($kunde['firma']) && $kunde['firma'] != '') {
address.php  90)         $content .= '
address.php  91)         <div class="form-group form-group-lg row">
address.php  92)             <div class="col-sm-12"><input class="form-control" id="address" name="address" type="text" placeholder="'.$placeholders['firma'].'" autocomplete="street-address" value="'.$contents['firma'].'"></div>
address.php  93)         </div>';
address.php  94)     }*/
address.php  95)     $content .= '   <div class="form-group form-group-lg row">
address.php  96)             <div class="col-sm-6"><input class="form-control" id="fname" name="fname" type="text" placeholder="'.$placeholders['vorname'].'" autocomplete="given-name" value="'.$_SESSION['fname'].'"></div>
address.php  97)             <div class="col-sm-6"><input class="form-control" id="lname" name="lname" type="text" placeholder="'.$placeholders['nachname'].'" autocomplete="family-name" value="'.$_SESSION['lname'].'"></div>
address.php  98)         </div>
address.php  99)         <div class="form-group form-group-lg row">
address.php 100)             <div class="col-sm-12"><input class="form-control" id="address" name="address" type="text" placeholder="'.$placeholders['adresse'].'" autocomplete="street-address" value="'.$contents['adresse'].'"></div>
address.php 101)         </div>
address.php 102)         <div class="form-group form-group-lg row">
address.php 103)             <div class="col-sm-4"><input class="form-control" id="zip" name="zip" type="text" placeholder="'.$placeholders['plz'].'" autocomplete="postal-code" value="'.$contents['plz'].'"></div>
address.php 104)             <div class="col-sm-8"><input class="form-control" id="city" name="city" type="text" placeholder="'.$placeholders['ort'].'" autocomplete="locality" value="'.$contents['ort'].'"></div>
Bernd Wurst frage E-Mail-Adresse ab

Bernd Wurst authored 1 year ago

address.php 105)         </div>
address.php 106)         <div class="form-group form-group-lg row">
address.php 107)             <div class="col-sm-12"><input class="form-control" id="email" name="email" type="text" placeholder="'.$placeholders['email'].'" autocomplete="email" value="'.$contents['email'].'"></div>
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

address.php 108)         </div>
address.php 109)           <div class="form-group form-group-lg">
address.php 110)             <div><input class="btn btn-primary btn-lg" type="submit" value="Weiter &gt;"></div>
address.php 111)         </div>
address.php 112)         </form>
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php   113) 
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

address.php 114)     ';
address.php 115) }