git.schokokeks.org
Repositories
Help
Report an Issue
bibweb.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
697776a
Branches
Tags
master
bibweb.git
notification.php
Ermögliche die Eingabe neuer Kontaktdaten
Bernd Wurst
commited
697776a
at 2026-09-30 11:07:04
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; $phonenumbers = array_unique(array_filter($_SESSION['phonenumbers'], function($v) { return str_starts_with($v, '+491'); })); $emailaddrs = array_unique($_SESSION['emailaddrs']); $num = count($phonenumbers) * 2 + count($emailaddrs); if ($num < 2) { $_SESSION['notification_done'] = true; // Nichts zum aussuchen! header('Location: obstart.php'); } foreach ($phonenumbers 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>'; } $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");