0277419db67fa1850d056e5b3f769a7d9621501e
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']);
address.php  14) if (strpos($_SESSION['name'], ' ') !== false) {
address.php  15)     $parts = explode(" ", ucwords($_SESSION['name']));
address.php  16)     $_SESSION['lname'] = array_pop($parts);
address.php  17)     $_SESSION['fname'] = implode(" ", $parts);
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

address.php  18) }
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

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

Bernd Wurst authored 4 years ago

address.php  23)     }
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 4 years ago

address.php  33) 
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 1 year ago

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

Bernd Wurst authored 4 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 1 year ago

address.php  38)         <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  39)     $content .= '
address.php  40)         <form class="form" action="save.php" method="post">
address.php  41)         <input type="hidden" name="form" value="address">';
address.php  42)     $content .= '<input name="fname" type="hidden" value="'.$_SESSION['fname'].'">
address.php  43)            <input name="lname" type="hidden" value="'.$_SESSION['lname'].'">
address.php  44)           <div class="form-group form-group-lg">
address.php  45)             <div><input class="btn btn-primary btn-lg" type="submit" value="Weiter &gt;"></div>
address.php  46)         </div>
address.php  47)         </form>
address.php  48) 
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 1 year ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 4 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 4 years ago

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

Bernd Wurst authored 4 years ago

address.php  57) 
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 4 years ago

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

Bernd Wurst authored 1 year ago

address.php  78)         <form class="form" action="save.php" method="post">
address.php  79)         <input type="hidden" name="form" value="address">';
address.php  80)     /*if (isset($kunde['firma']) && $kunde['firma'] != '') {
address.php  81)         $content .= '
address.php  82)         <div class="form-group form-group-lg row">
address.php  83)             <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  84)         </div>';
address.php  85)     }*/
address.php  86)     $content .= '   <div class="form-group form-group-lg row">
address.php  87)             <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  88)             <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  89)         </div>
address.php  90)         <div class="form-group form-group-lg row">
address.php  91)             <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  92)         </div>
address.php  93)         <div class="form-group form-group-lg row">
address.php  94)             <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  95)             <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  96)         </div>
address.php  97)           <div class="form-group form-group-lg">
address.php  98)             <div><input class="btn btn-primary btn-lg" type="submit" value="Weiter &gt;"></div>
address.php  99)         </div>
address.php 100)         </form>
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php   101) 
Bernd Wurst Neue API 2023

Bernd Wurst authored 1 year ago

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