$tripId, 'titel' => trim($_POST['titel'] ?? ''), 'beschreibung'=> trim($_POST['beschreibung'] ?? ''), 'link' => trim($_POST['link'] ?? ''), 'status' => 'offen', 'created_by' => $user['id'], ]); header('Location: /Develop/PlanerGoogel/ideen.php?trip=' . $tripId); exit; } if ($canEdit && $_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['status'])) { $statuses = ['offen', 'geplant', 'erledigt']; $newStatus = $_POST['status']; if (in_array($newStatus, $statuses)) { dbExec('UPDATE ideen SET status = ? WHERE id = ? AND trip_id = ?', [$newStatus, (int)$_POST['id'], $tripId]); } header('Location: /Develop/PlanerGoogel/ideen.php?trip=' . $tripId); exit; } if ($canEdit && $_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete'])) { dbExec('DELETE FROM ideen WHERE id = ? AND trip_id = ?', [(int)$_POST['delete'], $tripId]); header('Location: /Develop/PlanerGoogel/ideen.php?trip=' . $tripId); exit; } $ideen = dbAll( 'SELECT i.*, u.name as user_name FROM ideen i LEFT JOIN users u ON u.id = i.created_by WHERE i.trip_id = ? ORDER BY CASE i.status WHEN "geplant" THEN 0 WHEN "offen" THEN 1 ELSE 2 END, i.id DESC', [$tripId] ); $statusMap = [ 'offen' => ['label' => 'Offen', 'class' => 'badge-plan', 'icon' => '💡'], 'geplant' => ['label' => 'Geplant', 'class' => 'badge-active', 'icon' => '📅'], 'erledigt' => ['label' => 'Erledigt', 'class' => 'badge-done', 'icon' => '✅'], ]; $pageTitle = 'Ideen'; $activeTab = 'ideen'; include __DIR__ . '/includes/header.php'; ?>
💡

Noch keine Ideen gesammelt.

🔗