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>
|
||||
@@ -2,28 +2,31 @@
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Jeux de la catégorie <?php echo html_escape($category['name']); ?></title>
|
||||
<title>Liste des jeux</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="<?= site_url('home') ?>">Retour à l'accueil</a>
|
||||
|
||||
<p><a href="<?php echo site_url('home'); ?>">← Retour à l'accueil</a></p>
|
||||
|
||||
<h1>Jeux dans la catégorie : "<?php echo html_escape($category['name']); ?>"</h1>
|
||||
|
||||
<?php if (empty($games)): ?>
|
||||
<p>Aucun jeu trouvé dans cette catégorie pour le moment.</p>
|
||||
<?php if (isset($category)): ?>
|
||||
<h1>Jeux de la catégorie : <?= html_escape($category['name']) ?></h1>
|
||||
<?php elseif (isset($genre)): ?>
|
||||
<h1>Jeux du genre : <?= html_escape($genre['name']) ?></h1>
|
||||
<?php else: ?>
|
||||
<ul>
|
||||
<?php foreach ($games as $game): ?>
|
||||
<li>
|
||||
<a href="<?php echo site_url('game/detail/' . $game['gameId']); ?>">
|
||||
<strong><?php echo html_escape($game['title']); ?></strong>
|
||||
</a>
|
||||
(<?php echo html_escape($game['year']); ?>)
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<h1>Liste des jeux</h1>
|
||||
<?php endif; ?>
|
||||
|
||||
<ul>
|
||||
<?php if (!empty($games)): ?>
|
||||
<?php foreach ($games as $game): ?>
|
||||
<li>
|
||||
<a href="<?= site_url('game/detail/' . $game['gameId']) ?>">
|
||||
<?= html_escape($game['name']) ?> (<?= html_escape($game['releaseYear']) ?>)
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<p>Aucun jeu trouvé pour cette sélection.</p>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
@@ -9,14 +9,22 @@
|
||||
<h1>Bienvenue sur l'application Jeux Vidéo</h1>
|
||||
|
||||
<main style="display: flex; gap: 50px;">
|
||||
<section style="margin-bottom: 30px; background: #f4f4f4; padding: 15px; border-radius: 5px;">
|
||||
<h2>Rechercher un jeu vidéo</h2>
|
||||
<form action="<?php echo site_url('home/search'); ?>" method="GET">
|
||||
<input type="text" name="keyword" placeholder="Ex: Zelda, Mario..." required style="padding: 8px; width: 250px;">
|
||||
<button type="submit" style="padding: 8px 15px;">Rechercher</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Nos Catégories</h2>
|
||||
<ul>
|
||||
<?php foreach ($categories as $category): ?>
|
||||
<li>
|
||||
<a href="<?php echo site_url('category/view/' . $category['id']); ?>">
|
||||
<?php echo html_escape($category['name']); ?>
|
||||
</a>
|
||||
<a href="<?php echo site_url('category/view/' . $category['categoryId']); ?>">
|
||||
<?php echo html_escape($category['name']); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
@@ -27,12 +35,12 @@
|
||||
<ul>
|
||||
<?php foreach ($genres as $genre): ?>
|
||||
<li>
|
||||
<a href="<?php echo site_url('genre/view/' . $genre['id']); ?>">
|
||||
<a href="<?php echo site_url('genre/view/' . $genre['genreId']); ?>">
|
||||
<?php echo html_escape($genre['name']); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Résultats de recherche pour "<?php echo html_escape($search_keyword); ?>"</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p><a href="<?php echo site_url('home'); ?>">← Retour à l'accueil</a></p>
|
||||
|
||||
<h1>Résultats pour : "<?php echo html_escape($search_keyword); ?>"</h1>
|
||||
|
||||
<?php if (empty($games)): ?>
|
||||
<p>Aucun jeu vidéo ne correspond à votre recherche.</p>
|
||||
<?php else: ?>
|
||||
<p><strong><?php echo count($games); ?></strong> jeu(x) trouvé(s) :</p>
|
||||
<ul>
|
||||
<?php foreach ($games as $game): ?>
|
||||
<li>
|
||||
<a href="<?php echo site_url('game/detail/' . $game['gameId']); ?>">
|
||||
<strong><?php echo html_escape($game['title']); ?></strong>
|
||||
</a>
|
||||
(<?php echo html_escape($game['year']); ?>)
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user