| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- include 'db_config.php'; // Falls du die Connection auslagerst, sonst Code von oben kopieren
- $sql = "SELECT DISTINCT sp.* FROM spiele sp
- JOIN scores sc ON sp.id = sc.spiel_id
- ORDER BY sp.titel ASC";
- $stmt = $pdo->query($sql);
- $playedGames = $stmt->fetchAll();
- ?>
- <!DOCTYPE html>
- <html lang="de">
- <head>
- <meta charset="UTF-8">
- <title>Gespielte Spiele</title>
- <style>
- body { font-family: sans-serif; background: #121212; color: white; padding: 20px; }
- .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
- .item { background: #1e1e1e; padding: 10px; border-radius: 8px; text-align: center; border: 1px solid #333; }
- .item img { width: 100%; border-radius: 4px; height: 150px; object-fit: cover; }
- h1 { color: #e67e22; }
- .back { display: inline-block; margin-bottom: 20px; color: #e67e22; text-decoration: none; }
- </style>
- </head>
- <body>
- <a href="index.php" class="back">← Zurück zum Dashboard</a>
- <h1>📂 Gelöste Abenteuer</h1>
- <div class="grid">
- <?php foreach ($playedGames as $game): ?>
- <div class="item">
- <img src="<?= htmlspecialchars($game['bild_url']) ?>">
- <p><?= htmlspecialchars($game['titel']) ?></p>
- </div>
- <?php endforeach; ?>
- </div>
- </body>
- </html>
|