Datum und Zeit Anzeige verbesser
This commit is contained in:
30
index.php
30
index.php
@@ -6,9 +6,9 @@ include('inc/db.php');
|
||||
$current_week = date('W');
|
||||
|
||||
// SQL-Abfrage mit JOIN zwischen meetings und colors
|
||||
$sql = "SELECT * FROM meetings
|
||||
JOIN colors ON meetings.color_id = colors.id
|
||||
WHERE WEEK(meeting_date, 1) = $current_week
|
||||
$sql = "SELECT * FROM meetings
|
||||
JOIN colors ON meetings.color_id = colors.id
|
||||
WHERE WEEK(meeting_date, 1) = $current_week
|
||||
ORDER BY meeting_date DESC LIMIT 1";
|
||||
|
||||
$result = mysqli_query($conn, $sql);
|
||||
@@ -44,6 +44,16 @@ function get_readable_text_color($hex_code)
|
||||
|
||||
include('inc/header.php');
|
||||
|
||||
// Wochentags-Übersetzung
|
||||
$german_weekdays = [
|
||||
'Mon' => 'Mo.',
|
||||
'Tue' => 'Di.',
|
||||
'Wed' => 'Mi.',
|
||||
'Thu' => 'Do.',
|
||||
'Fri' => 'Fr.',
|
||||
'Sat' => 'Sa.',
|
||||
'Sun' => 'So.',
|
||||
];
|
||||
?>
|
||||
|
||||
<div class="container py-5">
|
||||
@@ -53,7 +63,11 @@ include('inc/header.php');
|
||||
</div>
|
||||
|
||||
<?php if ($row): ?>
|
||||
<div class="card mx-auto bg-light shadow" style="max-width: 300px;">
|
||||
<?php
|
||||
$english_weekday = date('D', strtotime($row['meeting_date']));
|
||||
$german_weekday = $german_weekdays[$english_weekday] ?? '';
|
||||
?>
|
||||
<div class="card mx-auto bg-light shadow" style="max-width: 400px;">
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title mb-3">Farbe der Woche</h5>
|
||||
<div class="rounded mb-3 mx-auto d-flex justify-content-center align-items-center" style="height: min(100px, 25vw); background-color: <?= htmlspecialchars($row['hex_code']) ?>; text-shadow: 1px 1px 2px rgba(0,0,0,0.5);">
|
||||
@@ -61,9 +75,15 @@ include('inc/header.php');
|
||||
</div>
|
||||
|
||||
<p class="text-muted">nächster Termin:</p>
|
||||
<p class="text-muted"><?= date('d.m.Y', strtotime($row['meeting_date'])) ?></p>
|
||||
<p class="text-muted fw-bold"><?= $german_weekday . ' ' . date('d.m.Y H:i', strtotime($row['meeting_date'])) ?></p>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center my-3" style="max-width: 400px; margin-left: auto; margin-right: auto;">
|
||||
<a href="#" class="btn btn-sm btn-outline-danger me-4">Absagen</a>
|
||||
<a href="#" class="btn btn-sm btn-outline-secondary">Verschiebung beantragen</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php else: ?>
|
||||
<div class="alert alert-warning text-center">
|
||||
Keine Farbe für diese Woche festgelegt.
|
||||
|
||||
Reference in New Issue
Block a user