ajout css pour rendre plus beau et ajout des virgules pour les prix :D

This commit is contained in:
2026-06-12 21:40:50 +02:00
parent dbbc0c9401
commit d70dd93baa
5 changed files with 259 additions and 110 deletions
@@ -3,28 +3,53 @@
<head>
<meta charset="UTF-8">
<title>Résultats de recherche pour "<?= html_escape($search_keyword) ?>"</title>
<style>
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f4f7f6; color: #333; margin: 0; padding: 20px; }
.container { max-width: 900px; margin: 0 auto; background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
h1 { color: #2c3e50; border-bottom: 2px solid #ecf0f1; padding-bottom: 10px; margin-bottom: 20px; }
a { color: #3498db; text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; padding: 0; }
li { background: #f9f9f9; margin-bottom: 10px; padding: 15px; border-radius: 5px; border-left: 4px solid #9b59b6; transition: transform 0.2s; display: flex; justify-content: space-between; align-items: center; }
li:hover { transform: translateX(5px); background: #f1f1f1; }
li a { text-decoration: none; color: #2c3e50; }
li a:hover { color: #9b59b6; }
.price-tag { background: #9b59b6; color: white; padding: 4px 10px; border-radius: 4px; font-weight: bold; font-size: 14px; }
.empty-msg { padding: 15px; background: #ffeaa7; color: #d35400; border-radius: 5px; font-weight: bold; }
.result-count { display: inline-block; background: #ecf0f1; padding: 5px 10px; border-radius: 4px; margin-bottom: 15px; }
</style>
</head>
<body>
<div class="container">
<p><a href="<?= site_url('home') ?>">⬅ Retour à l'accueil</a></p>
<h1>Résultats pour : "<?= html_escape($search_keyword) ?>"</h1>
<?php if (empty($games)): ?>
<p>Aucun jeu vidéo ne correspond à votre recherche.</p>
<p class="empty-msg">Aucun jeu vidéo ne correspond à votre recherche.</p>
<?php else: ?>
<p><strong><?= count($games) ?></strong> jeu(x) trouvé(s) :</p>
<p class="result-count"><strong><?= count($games) ?></strong> jeu(x) trouvé(s) :</p>
<ul>
<?php foreach ($games as $game): ?>
<li>
<a href="<?= site_url('game/detail/' . $game['id']) ?>">
<strong><?= html_escape($game['name']) ?></strong>
</a>
(<?= html_escape($game['releaseYear']) ?>)
<div>
<a href="<?= site_url('game/detail/' . $game['id']) ?>">
<strong><?= html_escape($game['name']) ?></strong>
</a>
<span style="color: #7f8c8d;"> - (<?= html_escape($game['releaseYear']) ?>)</span>
</div>
<?php if (isset($game['prix'])): ?>
<span class="price-tag"><?= number_format($game['prix'] / 100, 2, ',', ' ') ?> €</span>
<?php elseif (isset($game['price'])): ?>
<span class="price-tag"><?= number_format($game['price'] / 100, 2, ',', ' ') ?> €</span>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
</body>
</html>
</html>