From 2f2af28dc81765927b48bc3079e030cfa414a9e0 Mon Sep 17 00:00:00 2001 From: Borgal Date: Wed, 20 Aug 2025 17:53:55 +0200 Subject: [PATCH] meeting.php in history.php umbenannt --- history.php | 223 +++++++++++++++++++++++++++++++++++++++++++++++++++ inc/menu.php | 4 +- meeting.php | 215 ------------------------------------------------- 3 files changed, 225 insertions(+), 217 deletions(-) create mode 100755 history.php delete mode 100755 meeting.php diff --git a/history.php b/history.php new file mode 100755 index 0000000..c96179d --- /dev/null +++ b/history.php @@ -0,0 +1,223 @@ + $row['meeting_date'], + 'reason' => $row['reason'], + 'color_name' => $row['color_name'], + 'hex_code' => $row['hex_code'], + 'participants' => [] + ]; + } + + if ($row['username']) { + $meetings[$meeting_id]['participants'][] = [ + 'username' => $row['username'], + 'attended' => $row['attended'], + 'wore_color' => $row['wore_color'], + 'paid' => $row['paid'] + ]; + } + } + + return $meetings; +} + +// PHP-Logik zur Verarbeitung des Formulars +if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['submit_meeting'])) { + $meeting_date = $_POST['meeting_date']; + $reason = $_POST['reason']; + $color_id = $_POST['color_id']; + + if (!empty($meeting_date) && !empty($color_id)) { + $stmt = mysqli_prepare($conn, "INSERT INTO meetings (meeting_date, reason, color_id) VALUES (?, ?, ?)"); + mysqli_stmt_bind_param($stmt, "ssi", $meeting_date, $reason, $color_id); + + if (mysqli_stmt_execute($stmt)) { + header("Location: history.php?status=success"); + exit; + } else { + $error_message = "Fehler beim Hinzufügen des Treffens: " . mysqli_error($conn); + } + mysqli_stmt_close($stmt); + } else { + $error_message = "Datum und Farbe sind Pflichtfelder."; + } +} + +// Farben für das Formular abrufen +$colors_result = mysqli_query($conn, "SELECT id, name, hex_code FROM colors ORDER BY name"); +$colors = mysqli_fetch_all($colors_result, MYSQLI_ASSOC); + +// Hier wird die Funktion aufgerufen, nachdem sie definiert wurde +$all_meetings = get_all_meeting_details($conn); +?> + + + +
+
+
+
+ + + + + + + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+
+ +
+

Termin-History

+ +
+ + + + + $meeting): ?> +
+ +
+
+ Farbe: + Grund: +
+
Teilnehmer:
+ +

Noch keine Teilnehmer erfasst.

+ +
    + +
  • + + + + + +
  • + +
+ +
+
+ + +
+ + \ No newline at end of file diff --git a/inc/menu.php b/inc/menu.php index 410d680..a22398a 100755 --- a/inc/menu.php +++ b/inc/menu.php @@ -13,10 +13,10 @@