base_object = $base_object; $this->layout_object = $layout_object; $this->revocation = new Revocation($base_object); } public function run() { // Action: als bearbeitet markieren if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'mark_processed' && !empty($_POST['id']) ) { $this->revocation->mark_processed( (int)$_POST['id'], (string)($_POST['note'] ?? '') ); // PRG header('Location: /index.php?admin_modul=admin_revocation_list&done=1'); exit; } $filter_status = isset($_GET['status']) ? (string)$_GET['status'] : ''; $rows = $this->revocation->list_all($filter_status ?: null, 500); return $this->render($rows, $filter_status, !empty($_GET['done'])); } private function render($rows, $filter, $just_done) { $h = function($s) { return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); }; $html = '
Elektronische Widerrufe nach EU-RL 2026/2673. ' . 'Alle B2C-Bestellungen seit Aktivierung des Features.
'; if ($just_done) { $html .= 'Keine Einträge gefunden.
| ID | ' . 'Bestellnr. | ' . 'Kunde (E-Mail) | ' . 'Status | ' . 'Bestelldatum | ' . 'Widerruf am | ' . 'Owner-Mail | ' . 'Aktion | ' . '
|---|---|---|---|---|---|---|---|
| '.(int)$r->id.' | ' . ''.$h($r->order_number ?: '#'.$r->order_id).' | ' . ''.$h($r->customer_email).' | ' . '' . $h($r->status).' | ' . ''.$h($r->order_date).' | ' . ''.$h($r->submitted_at ?? '–').' | ' . ''.$h($r->owner_notified_at ? '✓' : '–').' | ' . ''; if ($r->status === 'submitted') { $html .= ''; } elseif ($r->status === 'processed') { $html .= 'abgeschlossen'; } else { $html .= '–'; } $html .= ' |