bfc6ce6220997240df9914154bdfde37bdd200ce
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 3 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 3 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 3 years ago

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

Bernd Wurst authored 9 months ago

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

Bernd Wurst authored 9 months ago

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

Bernd Wurst authored 9 months 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 3 years ago

address.php  19) }
Bernd Wurst Neue API 2023

Bernd Wurst authored 9 months 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 3 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 3 years ago

address.php  34) 
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    35) $headline = 'Adresse eingeben';
Bernd Wurst Neue API 2023

Bernd Wurst authored 9 months ago

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

Bernd Wurst authored 3 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 9 months 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 reuse JWT token

Bernd Wurst authored 9 months ago

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

Bernd Wurst authored 9 months ago

address.php  44)            <input name="lname" type="hidden" value="'.$_SESSION['lname'].'">
address.php  45)           <div class="form-group form-group-lg">
address.php  46)             <div><input class="btn btn-primary btn-lg" type="submit" value="Weiter &gt;"></div>
address.php  47)         </div>
address.php  48)         </form>
address.php  49) 
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 9 months ago

address.php  51) 
address.php  52) 
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 3 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 3 years ago

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

Bernd Wurst authored 3 years ago

address.php  58) 
Bernd Wurst Neue API 2023

Bernd Wurst authored 9 months ago

address.php  59)     $fields = array("vorname" => "Vorname",
address.php  60)         "nachname" => "Nachname",
address.php  61)         "firma" => "Firmenname",
address.php  62)         "adresse" => "Adresse",
address.php  63)         "plz" => "PLZ",
address.php  64)         "ort" => "Ort");
address.php  65)     $placeholders = $fields;
address.php  66)     $contents = $kunde;
address.php  67)     foreach ($fields as $field => $label) {
address.php  68)         if (isset($kunde[$field]) && $kunde[$field] == 'bekannt') {
address.php  69)             $placeholders[$field] = $label.' wie beim letzten Besuch';
address.php  70)             $contents[$field] = '';
address.php  71)         } elseif (!isset($contents[$field])) {
address.php  72)             $contents[$field] = '';
address.php  73)         }
address.php  74) 
address.php  75)     }
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 3 years ago

address.php  77) 
address.php  78)     $content .= '
Bernd Wurst Neue API 2023

Bernd Wurst authored 9 months ago

address.php  79)         <form class="form" action="save.php" method="post">
address.php  80)         <input type="hidden" name="form" value="address">';
address.php  81)     /*if (isset($kunde['firma']) && $kunde['firma'] != '') {
address.php  82)         $content .= '
address.php  83)         <div class="form-group form-group-lg row">
address.php  84)             <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  85)         </div>';
address.php  86)     }*/
address.php  87)     $content .= '   <div class="form-group form-group-lg row">
address.php  88)             <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  89)             <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  90)         </div>
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['adresse'].'" autocomplete="street-address" value="'.$contents['adresse'].'"></div>
address.php  93)         </div>
address.php  94)         <div class="form-group form-group-lg row">
address.php  95)             <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  96)             <div class="col-sm-8"><input class="form-control" id="city" name="city" type="text" placeholder="'.$placeholders['ort'].'" autocomplete="locality" value="'.$contents['ort'].'"></div>
address.php  97)         </div>
address.php  98)           <div class="form-group form-group-lg">
address.php  99)             <div><input class="btn btn-primary btn-lg" type="submit" value="Weiter &gt;"></div>
address.php 100)         </div>
address.php 101)         </form>
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php   102) 
Bernd Wurst Neue API 2023

Bernd Wurst authored 9 months ago

address.php 103)     ';
address.php 104) }