Finalisation des vues de consultation et integration des liens entre jeux categories et genres
This commit is contained in:
@@ -2,38 +2,63 @@
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><?php echo html_escape($game['title']); ?> - Détails</title>
|
||||
<title>Détails du jeu - <?= html_escape($game['name']) ?></title>
|
||||
<style>
|
||||
.game-detail { display: flex; gap: 20px; margin-top: 20px; }
|
||||
.game-info { max-width: 600px; }
|
||||
.poster { max-width: 300px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<a href="<?= site_url('home') ?>">⬅ Retour à l'accueil</a>
|
||||
|
||||
<p><a href="<?php echo site_url('home'); ?>">← Retour à l'accueil</a></p>
|
||||
|
||||
<main style="display: flex; gap: 40px; margin-top: 20px;">
|
||||
|
||||
<section style="max-width: 300px;">
|
||||
<div class="game-detail">
|
||||
<div>
|
||||
<?php if (!empty($game['poster_url'])): ?>
|
||||
<img src="<?php echo html_escape($game['poster_url']); ?>" alt="Jaquette de <?php echo html_escape($game['title']); ?>" style="width: 100%; height: auto; border-radius: 8px;">
|
||||
<img src="<?= base_url('assets/uploads/' . html_escape($game['poster_url'])) ?>" alt="Poster de <?= html_escape($game['name']) ?>" class="poster">
|
||||
<?php else: ?>
|
||||
<div style="width: 200px; height: 300px; background: #ccc; display: flex; align-items: center; justify-content: center; text-align: center; border-radius: 8px;">
|
||||
<span>Aucune image<br>disponible</span>
|
||||
<div class="poster" style="background:#eee; padding:50px; text-align:center;">
|
||||
Aucun poster disponible
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<section>
|
||||
<h1><?php echo html_escape($game['title']); ?></h1>
|
||||
<ul>
|
||||
<li><strong>Année de sortie :</strong> <?php echo html_escape($game['year']); ?></li>
|
||||
<li><strong>Développeur :</strong>
|
||||
<?php echo !empty($game['developer_name']) ? html_escape($game['developer_name']) : 'Inconnu'; ?>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<p style="font-style: italic; color: #666;">Espace administration (Éditer / Supprimer)</p>
|
||||
</section>
|
||||
|
||||
</main>
|
||||
<div class="game-info">
|
||||
<h1><?= html_escape($game['name']) ?> (<?= html_escape($game['releaseYear']) ?>)</h1>
|
||||
|
||||
<p><strong>Développeur :</strong> <?= !empty($game['developer_name']) ? html_escape($game['developer_name']) : 'Inconnu' ?></p>
|
||||
|
||||
<p><strong>Prix :</strong> <?= !empty($game['price']) ? html_escape($game['price']) . ' €' : 'Non renseigné' ?></p>
|
||||
|
||||
<h3>Description :</h3>
|
||||
<p><?= nl2br(html_escape($game['shortDescription'])) ?></p>
|
||||
|
||||
<h3>Catégories associées :</h3>
|
||||
<p>
|
||||
<?php if (!empty($categories)): ?>
|
||||
<?php foreach ($categories as $cat): ?>
|
||||
<a href="<?= site_url('category/view/' . $cat['categoryId']) ?>" style="margin-right: 10px; background: #e0e0e0; padding: 5px 10px; border-radius: 3px; text-decoration: none; color: #333;">
|
||||
<?= html_escape($cat['name']) ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
Aucune catégorie pour ce jeu.
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
<h3>Genres associés :</h3>
|
||||
<p>
|
||||
<?php if (!empty($genres)): ?>
|
||||
<?php foreach ($genres as $gen): ?>
|
||||
<a href="<?= site_url('genre/view/' . $gen['genreId']) ?>" style="margin-right: 10px; background: #d0e0fc; padding: 5px 10px; border-radius: 3px; text-decoration: none; color: #1a4ba8;">
|
||||
<?= html_escape($gen['name']) ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
Aucun genre pour ce jeu.
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
</div> </div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user