Initial Release: Lütte Planer mit Google-Login-Vorbereitung
- Login-System (Mock für Tests, Google OAuth vorbereitet) - Reisen erstellen mit Emoji, Ziel und Datum - Ablauf (Timeline), Packliste, Ideen, Notizen, Dokumente - Team-System: Personen einladen per E-Mail + Einladungslinks - Berechtigungen: Nur lesen / Bearbeiten / Admin - E-Mail-Benachrichtigungen beim Einladen Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+132
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/config.php';
|
||||
$tripId = $_GET['trip'] ?? '';
|
||||
[$trip, $user] = requireTripAccess($tripId);
|
||||
$canEdit = userCanEdit($tripId, $user['id']);
|
||||
|
||||
// Eintrag hinzufügen
|
||||
if ($canEdit && $_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['add'])) {
|
||||
dbInsert('ablauf', [
|
||||
'trip_id' => $tripId,
|
||||
'datum' => $_POST['datum'] ?? '',
|
||||
'zeit' => $_POST['zeit'] ?? '',
|
||||
'titel' => trim($_POST['titel'] ?? ''),
|
||||
'beschreibung'=> trim($_POST['beschreibung'] ?? ''),
|
||||
'ort' => trim($_POST['ort'] ?? ''),
|
||||
'kategorie' => $_POST['kategorie'] ?? 'allgemein',
|
||||
'created_by' => $user['id'],
|
||||
]);
|
||||
header('Location: /Develop/PlanerGoogel/ablauf.php?trip=' . $tripId); exit;
|
||||
}
|
||||
|
||||
// Eintrag löschen
|
||||
if ($canEdit && $_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete'])) {
|
||||
dbExec('DELETE FROM ablauf WHERE id = ? AND trip_id = ?', [(int)$_POST['delete'], $tripId]);
|
||||
header('Location: /Develop/PlanerGoogel/ablauf.php?trip=' . $tripId); exit;
|
||||
}
|
||||
|
||||
$eintraege = dbAll(
|
||||
'SELECT a.*, u.name as user_name, u.farbe as user_farbe FROM ablauf a
|
||||
LEFT JOIN users u ON u.id = a.created_by
|
||||
WHERE a.trip_id = ?
|
||||
ORDER BY a.datum ASC, a.zeit ASC, a.sort_order ASC, a.id ASC',
|
||||
[$tripId]
|
||||
);
|
||||
|
||||
// Nach Datum gruppieren
|
||||
$grouped = [];
|
||||
foreach ($eintraege as $e) {
|
||||
$key = $e['datum'] ?: '_ohne';
|
||||
$grouped[$key][] = $e;
|
||||
}
|
||||
|
||||
$kategorien = [
|
||||
'allgemein' => ['icon' => '📌', 'label' => 'Allgemein'],
|
||||
'transport' => ['icon' => '🚗', 'label' => 'Transport'],
|
||||
'hotel' => ['icon' => '🏨', 'label' => 'Hotel'],
|
||||
'essen' => ['icon' => '🍽️', 'label' => 'Essen'],
|
||||
'aktivität' => ['icon' => '🎯', 'label' => 'Aktivität'],
|
||||
'sehenswürdigkeit' => ['icon' => '🏛️', 'label' => 'Sehenswürdigkeit'],
|
||||
'einkaufen' => ['icon' => '🛍️', 'label' => 'Einkaufen'],
|
||||
'sonstiges' => ['icon' => '📝', 'label' => 'Sonstiges'],
|
||||
];
|
||||
|
||||
$pageTitle = 'Ablauf';
|
||||
$activeTab = 'ablauf';
|
||||
include __DIR__ . '/includes/header.php';
|
||||
|
||||
$countdown = null;
|
||||
if ($trip['start_datum']) {
|
||||
$days = daysUntil($trip['start_datum']);
|
||||
if ($days > 0) $countdown = "Noch <strong>{$days}</strong> Tage bis zur Reise!";
|
||||
elseif ($days === 0) $countdown = "🎉 Heute geht's los!";
|
||||
}
|
||||
?>
|
||||
|
||||
<main class="main">
|
||||
<?php if ($countdown): ?>
|
||||
<div class="countdown-bar"><?= $countdown ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="page-header">
|
||||
<h1 class="section-head">Ablauf</h1>
|
||||
<?php if ($canEdit): ?>
|
||||
<button class="btn btn-primary" onclick="toggleForm('add-form')">+ Eintrag</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ($canEdit): ?>
|
||||
<div id="add-form" class="add-form hidden">
|
||||
<form method="POST" style="display:contents;">
|
||||
<input type="date" name="datum" style="max-width:150px;">
|
||||
<input type="time" name="zeit" style="max-width:110px;">
|
||||
<input type="text" name="titel" placeholder="Titel *" required style="min-width:180px;">
|
||||
<input type="text" name="ort" placeholder="Ort / Adresse">
|
||||
<select name="kategorie">
|
||||
<?php foreach ($kategorien as $k => $v): ?>
|
||||
<option value="<?= $k ?>"><?= $v['icon'] ?> <?= $v['label'] ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<input type="text" name="beschreibung" placeholder="Beschreibung / Notiz">
|
||||
<button type="submit" name="add" class="btn btn-primary">Hinzufügen</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (empty($eintraege)): ?>
|
||||
<div class="empty"><div class="empty-icon">🗓️</div><p>Noch keine Einträge im Ablauf.</p></div>
|
||||
<?php else: ?>
|
||||
|
||||
<div class="timeline">
|
||||
<?php foreach ($grouped as $datum => $items): ?>
|
||||
<div class="tl-group">
|
||||
<div class="tl-group-date">
|
||||
<?= $datum === '_ohne' ? 'Ohne Datum' : germanDate($datum) ?>
|
||||
</div>
|
||||
<?php foreach ($items as $e): ?>
|
||||
<div class="tl-item">
|
||||
<div class="tl-dot"></div>
|
||||
<div class="tl-item-inner">
|
||||
<div class="tl-meta">
|
||||
<?php if ($e['zeit']): ?><span class="tl-time"><?= h($e['zeit']) ?></span><?php endif; ?>
|
||||
<span class="tl-kat"><?= $kategorien[$e['kategorie']]['icon'] ?? '📌' ?></span>
|
||||
</div>
|
||||
<div class="tl-title"><?= h($e['titel']) ?></div>
|
||||
<?php if ($e['ort']): ?><div class="tl-ort">📍 <?= h($e['ort']) ?></div><?php endif; ?>
|
||||
<?php if ($e['beschreibung']): ?><div class="tl-desc"><?= h($e['beschreibung']) ?></div><?php endif; ?>
|
||||
<?php if ($canEdit): ?>
|
||||
<form method="POST" style="display:inline;" onsubmit="return confirm('Eintrag löschen?')">
|
||||
<button type="submit" name="delete" value="<?= $e['id'] ?>" class="btn-delete" style="margin-top:8px;">Löschen</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
</main>
|
||||
|
||||
<?php include __DIR__ . '/includes/footer.php'; ?>
|
||||
Reference in New Issue
Block a user