date('Y-m-d', strtotime('2025-08-13')), 'color_name' => 'Blau', 'hex_code' => '#0000FF', 'participants' => [ ['name' => 'Max Mustermann', 'status' => 'correct'], ['name' => 'Erika Musterfrau', 'status' => 'fine'], ['name' => 'Hans Schmidt', 'status' => 'correct'] ] ]; return $details; } function hexToRgb($hex) { // Entferne das führende # $hex = ltrim($hex, '#'); // Falls 3-stellig, erweitere auf 6-stellig if (strlen($hex) === 3) { $hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2]; } // Falls nicht 6-stellig, gib einen Standardwert zurück if (strlen($hex) !== 6) { return '0, 0, 0'; // Fallback: Schwarz } // Umwandlung in RGB $r = hexdec(substr($hex, 0, 2)); $g = hexdec(substr($hex, 2, 2)); $b = hexdec(substr($hex, 4, 2)); return "$r, $g, $b"; } // Wenn die Seite per AJAX aufgerufen wird, um Details zu laden if (isset($_GET['meeting_id'])) { $details = get_meeting_details($conn, $_GET['meeting_id']); header('Content-Type: application/json'); echo json_encode($details); exit; } // Standard-Seitenansicht $current_month = isset($_GET['month']) ? $_GET['month'] : date('m'); $current_year = isset($_GET['year']) ? $_GET['year'] : date('Y'); $meetings_in_month = get_meetings_for_month($conn, $current_month, $current_year); $first_day_of_month = mktime(0, 0, 0, $current_month, 1, $current_year); $number_of_days = date('t', $first_day_of_month); $day_of_week = date('N', $first_day_of_month); // 1 = Montag, 7 = Sonntag ?>