40e4230b9af8c7d533f1a922d50a001de307b9ba
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)     }
address.php  46) }
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

step2.php    47) $headline = 'Adresse eingeben';
step2.php    48) if ($kunde) {
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 4 years ago

address.php  51)         <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    52)     ';
step2.php    53) } else { 
step2.php    54)     $content .= '
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 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)     ';
step2.php    57) }
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

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

Bernd Wurst authored 4 years 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] = '';
Bernd Wurst bestehende Kunden über die...

Bernd Wurst authored 4 years ago

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

Bernd Wurst authored 4 years ago

address.php  74) 
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 4 years ago

address.php  77) 
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 4 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 4 years ago

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="'.$contents['vorname'].'"></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="'.$contents['nachname'].'"></div>
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 4 years ago

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>
Bernd Wurst Initial commit

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 4 years ago

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>