489c01713161208e2a2ca4b016c0010c0a862230
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 bestehende Kunden über die...

Bernd Wurst authored 4 years ago

address.php  13) $kunde = null;
address.php  14) if (isset($_SESSION['name'])) {
address.php  15)     $kunde = suche_kunde($_SESSION['name'], $_SESSION['phone']);
address.php  16) }
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    17) if ($kunde) {
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

address.php  18)     $fields = array("kundennr" => "kundennr", "firma" => "firma", "fname" => "vorname", "lname" => "nachname", "address" => "adresse", "zip" => "plz", "city" => "ort");
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

address.php  19)     foreach ($fields as $sesskey => $arrkey) {
Bernd Wurst API-Authtoken, Idle-Warnung...

Bernd Wurst authored 4 years ago

address.php  20)         if (isset($_SESSION[$sesskey]) && $_SESSION[$sesskey] != '' && $_SESSION[$sesskey] != 'bekannt') {
address.php  21)             $kunde[$arrkey] = $_SESSION[$sesskey];
address.php  22)         }
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

address.php  23)         if (isset($kunde[$arrkey])) {
address.php  24)             $_SESSION[$sesskey] = $kunde[$arrkey];
address.php  25)         }
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

address.php  26)     }
address.php  27)     unset($_SESSION['name']);
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    28) }
step2.php    29) 
step2.php    30) if (isset($_REQUEST['error'])) {
Bernd Wurst Fehlermeldungen auf BS4 por...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

step2.php    34)     </div>';
step2.php    35) }
step2.php    36) 
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

address.php  37) if (!$kunde) {
address.php  38)     $kunde = array('kundennr' => '', 'firma' => '', 'nachname' => '', 'vorname' => '', 'adresse' => '', 'plz' => '', 'ort' => '');
address.php  39)     $fields = array("kundennr" => "kundennr", "firma" => "firma", "fname" => "vorname", "lname" => "nachname", "address" => "adresse", "zip" => "plz", "city" => "ort");
address.php  40) 
address.php  41)     foreach ($fields as $sesskey => $arrkey) {
address.php  42)         if (isset($_SESSION[$sesskey])) {
address.php  43)             $kunde[$arrkey] = $_SESSION[$sesskey];
address.php  44)         }
address.php  45)     }
Bernd Wurst besserer Debug-Modus, Handh...

Bernd Wurst authored 4 years ago

address.php  46)     if (isset($_SESSION['name'])) {
address.php  47)         $kunde['nachname'] = ucwords($_SESSION['name']);
address.php  48)         if (strpos($_SESSION['name'], ' ') !== false) {
address.php  49)             $parts = explode(" ", ucwords($_SESSION['name']));
address.php  50)             $kunde['nachname'] = array_pop($parts);
address.php  51)             $kunde['vorname'] = implode(" ", $parts);
address.php  52) 
address.php  53)         }
address.php  54)     }
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

address.php  55) }
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    56) $headline = 'Adresse eingeben';
Bernd Wurst besserer Debug-Modus, Handh...

Bernd Wurst authored 4 years ago

address.php  57) if ($kunde['kundennr']) {
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

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

Bernd Wurst authored 6 years ago

step2.php    59)     $content .= '
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

address.php  60)         <p>Schön, wir kennen uns ja schon! Wenn sich an Ihrer Adresse seit Ihrem letztem Besuch etwas geändert hat, ändern Sie es bitte hier. Ansonsten können Sie die Felder so lassen. Aus Datenschutzgründen werden die gespeicherten Daten hier nicht angezeigt.</p>
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 4 years ago

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

Bernd Wurst authored 6 years ago

step2.php    65)     ';
step2.php    66) }
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

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

Bernd Wurst authored 4 years ago

address.php  68) $fields = array("vorname" => "Vorname",
address.php  69)     "nachname" => "Nachname",
address.php  70)     "firma" => "Firmenname",
address.php  71)     "adresse" => "Adresse",
address.php  72)     "plz" => "PLZ",
address.php  73)     "ort" => "Ort");
address.php  74) $placeholders = $fields;
address.php  75) $contents = $kunde;
address.php  76) foreach ($fields as $field => $label) {
address.php  77)     if (isset($kunde[$field]) && $kunde[$field] == 'bekannt') {
address.php  78)         $placeholders[$field] = $label.' wie beim letzten Besuch';
address.php  79)         $contents[$field] = '';
address.php  80)     } elseif (!isset($contents[$field])) {
address.php  81)         $contents[$field] = '';
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

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

Bernd Wurst authored 4 years ago

address.php  83) 
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 4 years ago

address.php  86) 
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    87) $content .= '
step2.php    88)     <form class="form" action="save.php" method="post">
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

address.php  89)     <input type="hidden" name="form" value="address">';
address.php  90) if (isset($kunde['firma']) && $kunde['firma'] != '') {
address.php  91)     $content .= '
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    92)     <div class="form-group form-group-lg row">
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

address.php  93)         <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  94)     </div>';
address.php  95) }
address.php  96) $content .= '   <div class="form-group form-group-lg row">
address.php  97)         <div class="col-sm-6"><input class="form-control" id="fname" name="fname" type="text" placeholder="'.$placeholders['vorname'].'" autocomplete="given-name" value="'.$contents['vorname'].'"></div>
address.php  98)         <div class="col-sm-6"><input class="form-control" id="lname" name="lname" type="text" placeholder="'.$placeholders['nachname'].'" autocomplete="family-name" value="'.$contents['nachname'].'"></div>
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    99)     </div>
step2.php   100)     <div class="form-group form-group-lg row">
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

address.php 101)         <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>
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php   102)     </div>
step2.php   103)     <div class="form-group form-group-lg row">
Bernd Wurst Erste Version, die über die...

Bernd Wurst authored 4 years ago

address.php 104)         <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 105)         <div class="col-sm-8"><input class="form-control" id="city" name="city" type="text" placeholder="'.$placeholders['ort'].'" autocomplete="locality" value="'.$contents['ort'].'"></div>