diff --git a/.gitignore b/.gitignore index b13a64d..f4296b5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ info.php config.php *.old html/.Trash-1000 +Dockerfile +docker-compose.yml diff --git a/html/assets/css/style.css b/html/assets/css/style.css index f53fce6..56574e4 100644 --- a/html/assets/css/style.css +++ b/html/assets/css/style.css @@ -326,6 +326,31 @@ tr:hover { display: inline-block; } +/* Spaltenfilter im Tabellenkopf */ +tr.filter-row th { + background: white; + padding: 6px 8px; + text-transform: none; + letter-spacing: normal; + font-weight: normal; +} + +.column-filter { + width: 100%; + box-sizing: border-box; + padding: 6px 8px; + border: 1px solid #ddd; + border-radius: 6px; + font-size: 0.85em; + color: #333; + background: white; +} + +.column-filter:focus { + outline: none; + border-color: var(--primary-color); +} + /* Button */ .btn-xr { diff --git a/html/dashboard.php b/html/dashboard.php index 9079c20..ba584cb 100644 --- a/html/dashboard.php +++ b/html/dashboard.php @@ -70,6 +70,39 @@ $stmt->execute([ 'month' => $month ]); $entries = $stmt->fetchAll(); + +// Eindeutige Werte für die Filter-Dropdowns ermitteln +$filterZahler = []; +$filterPersonen = []; +$filterKategorie = []; +$filterZahlweise = []; +foreach ($entries as $entry) { + if (!empty($entry['zahler'])) { + $filterZahler[$entry['zahler']] = true; + } + if (!empty($entry['personen'])) { + foreach (explode(',', $entry['personen']) as $person) { + $person = trim($person); + if ($person !== '') { + $filterPersonen[$person] = true; + } + } + } + if (!empty($entry['kategorie'])) { + $filterKategorie[$entry['kategorie']] = true; + } + if (!empty($entry['zahlweise'])) { + $filterZahlweise[$entry['zahlweise']] = true; + } +} +$filterZahler = array_keys($filterZahler); +$filterPersonen = array_keys($filterPersonen); +$filterKategorie = array_keys($filterKategorie); +$filterZahlweise = array_keys($filterZahlweise); +sort($filterZahler, SORT_STRING | SORT_FLAG_CASE); +sort($filterPersonen, SORT_STRING | SORT_FLAG_CASE); +sort($filterKategorie, SORT_STRING | SORT_FLAG_CASE); +sort($filterZahlweise, SORT_STRING | SORT_FLAG_CASE); ?> @@ -116,8 +149,47 @@ $entries = $stmt->fetchAll();