git.schokokeks.org
Repositories
Help
Report an Issue
bibweb.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
cea9724
Branches
Tags
master
bibweb.git
notification.php
biete "Anruf" als option, wenn keine Handynummer
Bernd Wurst
commited
cea9724
at 2026-10-03 18:06:29
notification.php
Blame
History
Raw
<?php require_once "lib/api.php"; require_once "lib/auftrag.php"; session_start(); if (!isset($_SESSION['phone']) || (!isset($_SESSION['name']) && !isset($_SESSION['firma']) && !isset($_SESSION['lname']))) { header('Location: index.php?error&num='.urlencode($_SESSION['phone']).'&name='.urlencode($_SESSION['name'])); die(); } // Hier ist der Kunde erstellt und mit Kundennummer bekannt. $headline = 'Benachrichtigung wählen'; $content = '<p>Wie möchten Sie bevorzugt kontaktiert werden, wenn Ihr Auftrag erledigt ist?</p> <form class="form" action="save.php" method="post"> <input type="hidden" name="form" value="notification"> <div class="row mb-1 g-3">'; $num = 0; $mobilenumbers = array_unique(array_filter($_SESSION['phonenumbers'], function($v) { return str_starts_with($v, '+491'); })); $emailaddrs = array_unique($_SESSION['emailaddrs']); $num = count($mobilenumbers) * 2 + count($emailaddrs); /* * Wenn es keine handynummer gibt, biete trotzdem an eine einzutragen if ($num < 2) { $_SESSION['notification_done'] = true; // Nichts zum aussuchen! header('Location: obstart.php'); } */ foreach ($mobilenumbers as $index => $phone) { $phone = format_number_national($phone); $content .= ' <div class="col-sm-6"><a href="#" class="btn btn-lg btn-light w-100 btn-whatsapp" id="btn-whatsapp_'.$index.'">Whatsapp an<br> '.$phone.'</a></div>'; $content .= ' <div class="col-sm-6"><a href="#" class="btn btn-lg btn-light w-100 btn-sms" id="btn-sms_'.$index.'">SMS an<br> '.$phone.'</a></div>'; } foreach ($emailaddrs as $index => $email) { if (!isset($_SESSION['email']) || !$_SESSION['email']) { $_SESSION['email'] = $email; } $content .= ' </div> <div class="row"> <div class="col-sm-12"><a href="#" class="btn btn-lg btn-light w-100 btn-email" id="btn-email_'.$index.'">E-Mail an<br> '.$email.'</a></div>'; } if (!$mobilenumbers) { $phone = format_number_national($_SESSION['phone']); $content .= ' <div class="col-sm-12"><a href="#" class="btn btn-lg btn-light w-100 btn-anruf" id="btn-anruf">Anrufen unter <br> '.$phone.'</a></div>'; } $content .= ' </div> <div class="row"> <div class="col-sm-12"><a href="newcontact.php" class="btn btn-lg btn-light w-100" id="btn-newcontact">Neue Kontaktdaten angeben</a></div>'; $content .= '<input type="hidden" name="notification" id="notification" value=""> </div>'; $content .= '</form>'; include("template.php");