From 4ab4576ec866952efd556888fa7b450a1fcc36a4 Mon Sep 17 00:00:00 2001 From: Borgal Date: Fri, 24 Oct 2025 21:47:28 +0200 Subject: [PATCH] Verschiebung wieder korrekt implementiert --- css/style.css | 8 +++ index.php | 140 +++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 129 insertions(+), 19 deletions(-) diff --git a/css/style.css b/css/style.css index 555afb7..d9e27b6 100755 --- a/css/style.css +++ b/css/style.css @@ -62,4 +62,12 @@ pre { /* Optional: Kleiner Abstand für bessere Lesbarkeit */ .collapse:not(.show) { display: none; +} + +.meeting-actions { + max-width: 500px; + margin-left: auto; + margin-right: auto; + flex-direction: column; + align-items: center; } \ No newline at end of file diff --git a/index.php b/index.php index 3b2be47..09690e6 100755 --- a/index.php +++ b/index.php @@ -37,12 +37,10 @@ function auto_decline_if_on_vacation($conn, $meeting_id, $user_id, $meeting_date $existing = mysqli_fetch_assoc(mysqli_stmt_get_result($check_stmt)); mysqli_stmt_close($check_stmt); - // Wenn bereits "accepted", nichts tun if ($existing && $existing['rsvp_status'] === 'accepted') { return 'accepted'; } - // Sonst: ablehnen if ($existing) { $upd = mysqli_prepare($conn, "UPDATE meeting_teilnehmer SET rsvp_status = 'declined', attended = 0 WHERE meeting_id = ? AND user_id = ?"); mysqli_stmt_bind_param($upd, "ii", $meeting_id, $user_id); @@ -72,10 +70,7 @@ function get_current_meeting($conn) $row = get_current_meeting($conn); -// 🔴 Automatisches Abschließen bei vergangenem Termin wurde ENTFERNT -// → Termin bleibt sichtbar, bis Admin in participant.php abschließt - -// --- TEILNAHME-LOGIK --- +// --- TEILNAHME-LOGIK & TERMINVERSCHIEBUNG --- if ($row) { $meeting_id = $row['id']; @@ -132,7 +127,7 @@ if ($row) { // 🔥 Automatisch ablehnen, wenn im Abwesenheitsmodus $auto_declined = auto_decline_if_on_vacation($conn, $meeting_id, $logged_in_user_id, $row['meeting_date']); - // Status abrufen (kann jetzt "declined" sein) + // Status abrufen $user_attendance_status = null; $user_status_sql = "SELECT rsvp_status FROM meeting_teilnehmer WHERE meeting_id = ? AND user_id = ?"; $user_status_stmt = mysqli_prepare($conn, $user_status_sql); @@ -215,8 +210,14 @@ if ($row) { } } - // --- TERMINVERSCHIEBUNG (ohne Änderung) --- + // --- TERMINVERSCHIEBUNG: Logik einbinden UND ausführen --- include('verschiebung.php'); + handle_reschedule_actions($conn, $meeting_id, $logged_in_user_id); + $reschedule_data = load_reschedule_data($conn, $meeting_id, $logged_in_user_id); + $active_proposals = $reschedule_data['active_proposals']; + $user_votes = $reschedule_data['user_votes']; + $yes_voters = $reschedule_data['yes_voters']; + $no_voters = $reschedule_data['no_voters']; } include('inc/header.php'); @@ -233,7 +234,6 @@ $german_weekdays = [ ?>
-
- + +
Anderen Termin vorschlagen
- +
@@ -304,8 +305,8 @@ $german_weekdays = [
-
- + +

Du hast zugesagt!

Absagen @@ -344,7 +345,7 @@ $german_weekdays = [ Teilnahme eintragen
- +
-
- - + + +
+
Aktive Verschiebungsvorschläge
+ +
+
+
+
+
+ + + (von ) + +
+

+
+ + + +
+ +
+ ✅ Ja: + + () + +
+ ❌ Nein: + + () + + +
+ +
+ +
+ + + +
+ + Bereits abgestimmt: + + + + + +
+ + + +
+ +
+
+
+ + + + +
+ + +
Keine anstehenden Termine gefunden.
- -