Sortierung, Fehlerbehebung mit S
This commit is contained in:
parent
9da209d0d2
commit
1d9ba5d0ae
3 changed files with 18 additions and 5 deletions
|
|
@ -223,6 +223,10 @@ th, td {
|
||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
td.align-right {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
th {
|
th {
|
||||||
background: var(--primary-color);
|
background: var(--primary-color);
|
||||||
color: white;
|
color: white;
|
||||||
|
|
@ -251,8 +255,8 @@ tr:hover {
|
||||||
/* Button */
|
/* Button */
|
||||||
.btn-xr {
|
.btn-xr {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 20px;
|
bottom: 30px;
|
||||||
right: 20px;
|
right: 30px;
|
||||||
background: var(--primary-color);
|
background: var(--primary-color);
|
||||||
color: white;
|
color: white;
|
||||||
padding: 12px 20px;
|
padding: 12px 20px;
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ function hideDataNotice(delay = 5000) {
|
||||||
const dataNotice = document.getElementById('data-notice');
|
const dataNotice = document.getElementById('data-notice');
|
||||||
if (!dataNotice) return; // Wenn das Element nicht existiert, abbrechen
|
if (!dataNotice) return; // Wenn das Element nicht existiert, abbrechen
|
||||||
|
|
||||||
alert(dataNotice);
|
// alert(dataNotice);
|
||||||
// Timer starten
|
// Timer starten
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
dataNotice.classList.add('hidden'); // Klasse für Ausblenden hinzufügen
|
dataNotice.classList.add('hidden'); // Klasse für Ausblenden hinzufügen
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Daten abrufen
|
// Daten abrufen
|
||||||
$sql="WITH user_names AS (SELECT p.id,b_single.username AS zahler,GROUP_CONCAT(b_array.username) AS personen FROM entries p LEFT JOIN users b_single ON p.user_id = b_single.id JOIN JSON_TABLE(p.person,'$[*]' COLUMNS(id INT PATH '$')) AS jt LEFT JOIN users b_array ON jt.id = b_array.id GROUP BY p.id, b_single.username) SELECT e.*, un.zahler, un.personen FROM entries e JOIN user_names un ON e.id = un.id;";
|
$sql="WITH user_names AS (SELECT p.id,b_single.username AS zahler,GROUP_CONCAT(b_array.username) AS personen FROM entries p LEFT JOIN users b_single ON p.user_id = b_single.id JOIN JSON_TABLE(p.person,'$[*]' COLUMNS(id INT PATH '$')) AS jt LEFT JOIN users b_array ON jt.id = b_array.id GROUP BY p.id, b_single.username) SELECT e.*, un.zahler, un.personen FROM entries e JOIN user_names un ON e.id = un.id order by date desc;";
|
||||||
$stmt = $pdo->prepare($sql);
|
$stmt = $pdo->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$entries = $stmt->fetchAll();
|
$entries = $stmt->fetchAll();
|
||||||
|
|
@ -35,6 +35,15 @@ $entries = $stmt->fetchAll();
|
||||||
<link rel="stylesheet" href="assets/css/style.css">
|
<link rel="stylesheet" href="assets/css/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<script>
|
||||||
|
// JavaScript: Aktuelle Fensterbreite an PHP übergeben
|
||||||
|
function updateWidth() {
|
||||||
|
var width = window.innerWidth;
|
||||||
|
document.getElementById('width').textContent = width + 'px';
|
||||||
|
}
|
||||||
|
window.onload = updateWidth;
|
||||||
|
</script>
|
||||||
|
<p id="width" class="hide-on-mobile"></p>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<!-- Navigation -->
|
<!-- Navigation -->
|
||||||
<nav class="nav">
|
<nav class="nav">
|
||||||
|
|
@ -71,7 +80,7 @@ $entries = $stmt->fetchAll();
|
||||||
<td class="hide-on-mobile"><?= htmlspecialchars($entry['category'] ?? '') ?></td>
|
<td class="hide-on-mobile"><?= htmlspecialchars($entry['category'] ?? '') ?></td>
|
||||||
<td><?= htmlspecialchars($entry['payment_method'] ?? '') ?></td>
|
<td><?= htmlspecialchars($entry['payment_method'] ?? '') ?></td>
|
||||||
<td><?= htmlspecialchars($entry['subject']) ?></td>
|
<td><?= htmlspecialchars($entry['subject']) ?></td>
|
||||||
<td><?= htmlspecialchars($entry['amount']) ?></td>
|
<td class="align-right"><?= htmlspecialchars( number_format($entry['amount'], 2, ',', '.')) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue