$title, 'description' => $description, 'category' => $category, 'room' => $room, 'name' => $name, 'status' => 'To-Do', 'date' => $date ]; $ticketsPath = __DIR__ . '/tickets.json'; $tickets = []; if (file_exists($ticketsPath)) { $json = file_get_contents($ticketsPath); $tickets = json_decode($json, true); if (!is_array($tickets)) $tickets = []; } $tickets[] = $newTicket; file_put_contents($ticketsPath, json_encode($tickets, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE), LOCK_EX); // Redirect zurück ins Dashboard oder zur Hauptseite header('Location: ../index.html?success=1'); exit;