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:
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/config.php';
|
||||
requireLogin();
|
||||
$user = currentUser();
|
||||
|
||||
// Neue Reise erstellen
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['neue_reise'])) {
|
||||
$name = trim($_POST['name'] ?? '');
|
||||
$ziel = trim($_POST['ziel'] ?? '');
|
||||
$start = $_POST['start_datum'] ?? '';
|
||||
$end = $_POST['end_datum'] ?? '';
|
||||
$emoji = trim($_POST['cover_emoji'] ?? '✈️');
|
||||
if ($name) {
|
||||
$id = newUuid();
|
||||
dbInsert('reisen', ['id' => $id, 'name' => $name, 'ziel' => $ziel, 'start_datum' => $start, 'end_datum' => $end, 'cover_emoji' => $emoji ?: '✈️', 'created_by' => $user['id']]);
|
||||
dbInsert('reise_zugriff', ['trip_id' => $id, 'user_id' => $user['id'], 'access' => 'admin']);
|
||||
header('Location: /Develop/PlanerGoogel/ablauf.php?trip=' . $id); exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Reisen des Users laden
|
||||
$reisen = dbAll(
|
||||
'SELECT r.*, rz.access FROM reisen r
|
||||
JOIN reise_zugriff rz ON rz.trip_id = r.id
|
||||
WHERE rz.user_id = ?
|
||||
ORDER BY r.start_datum DESC, r.created_at DESC',
|
||||
[$user['id']]
|
||||
);
|
||||
|
||||
$pageTitle = 'Meine Reisen';
|
||||
$trip = null;
|
||||
include __DIR__ . '/includes/header.php';
|
||||
?>
|
||||
|
||||
<main class="main">
|
||||
<div class="page-header">
|
||||
<h1 class="section-head">Meine Reisen</h1>
|
||||
<button class="btn btn-primary" onclick="document.getElementById('neue-reise-form').classList.toggle('hidden')">+ Neue Reise</button>
|
||||
</div>
|
||||
|
||||
<!-- Neue Reise Form -->
|
||||
<div id="neue-reise-form" class="add-form hidden" style="margin-bottom:28px;">
|
||||
<form method="POST" style="display:contents;">
|
||||
<input type="text" name="name" placeholder="Reisename *" required style="min-width:160px;">
|
||||
<input type="text" name="ziel" placeholder="Ziel / Ort">
|
||||
<input type="date" name="start_datum" title="Startdatum">
|
||||
<input type="date" name="end_datum" title="Enddatum">
|
||||
<input type="text" name="cover_emoji" placeholder="Emoji" value="✈️" style="max-width:80px;text-align:center;">
|
||||
<button type="submit" name="neue_reise" class="btn btn-primary">Erstellen</button>
|
||||
<button type="button" class="btn-secondary" onclick="document.getElementById('neue-reise-form').classList.add('hidden')">Abbrechen</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if (empty($reisen)): ?>
|
||||
<div class="empty">
|
||||
<div class="empty-icon">🗺️</div>
|
||||
<p>Noch keine Reisen geplant.</p>
|
||||
<p>Klick auf <strong>+ Neue Reise</strong> um loszulegen!</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="trip-grid">
|
||||
<?php foreach ($reisen as $r):
|
||||
$members = getTripMembers($r['id']);
|
||||
$days = $r['start_datum'] ? daysUntil($r['start_datum']) : null;
|
||||
?>
|
||||
<a href="/Develop/PlanerGoogel/ablauf.php?trip=<?= h($r['id']) ?>" class="trip-card">
|
||||
<div class="trip-card-emoji"><?= h($r['cover_emoji']) ?></div>
|
||||
<div class="trip-card-body">
|
||||
<div class="trip-card-name"><?= h($r['name']) ?></div>
|
||||
<?php if ($r['ziel']): ?>
|
||||
<div class="trip-card-ziel">📍 <?= h($r['ziel']) ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($r['start_datum']): ?>
|
||||
<div class="trip-card-date">
|
||||
<?= germanDate($r['start_datum']) ?>
|
||||
<?php if ($r['end_datum']): ?> – <?= germanDate($r['end_datum']) ?><?php endif; ?>
|
||||
<?php if ($days !== null && $days > 0): ?>
|
||||
<span class="countdown-badge">in <?= $days ?> Tagen</span>
|
||||
<?php elseif ($days !== null && $days <= 0 && $days > -30): ?>
|
||||
<span class="countdown-badge active">Läuft!</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="trip-card-members">
|
||||
<?php foreach (array_slice($members, 0, 5) as $m): ?>
|
||||
<?= avatarHtml($m, '24px') ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if (count($members) > 5): ?>
|
||||
<span class="members-more">+<?= count($members) - 5 ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($r['access'] === 'admin'): ?>
|
||||
<span class="trip-card-badge">Admin</span>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</main>
|
||||
|
||||
<?php include __DIR__ . '/includes/footer.php'; ?>
|
||||
Reference in New Issue
Block a user