corrections de toute les vue et maj du journal
This commit is contained in:
+30
-1
@@ -82,4 +82,33 @@ Comment vas-tu écrire cette fonction public function ajouter() avec ces deux li
|
|||||||
Dans notre fonction ajouter(), nous avons besoin de faire deux actions :
|
Dans notre fonction ajouter(), nous avons besoin de faire deux actions :
|
||||||
Charger un outil (helper) pour gérer les liens web. L'outil s'appelle 'url' et la commande à utiliser est helper().
|
Charger un outil (helper) pour gérer les liens web. L'outil s'appelle 'url' et la commande à utiliser est helper().
|
||||||
Charger l'interface visuelle (vue) qui contiendra le formulaire. Nous allons l'appeler 'formulaire_ajout_vue' et la commande est view().
|
Charger l'interface visuelle (vue) qui contiendra le formulaire. Nous allons l'appeler 'formulaire_ajout_vue' et la commande est view().
|
||||||
En utilisant la syntaxe $this->load->..., comment écrirais-tu ces deux lignes complètes à l'intérieur de ta fonction ajouter() ?
|
En utilisant la syntaxe $this->load->..., comment écrirais-tu ces deux lignes complètes à l'intérieur de ta fonction ajouter() ?
|
||||||
|
|
||||||
|
|
||||||
|
## Séance 4 - Finalisation et Intégration du Projet (Front & Back)
|
||||||
|
|
||||||
|
**Objectif de la séance :** Terminer l'architecture MVC, finaliser les filtres de tri (, lier le travail de nous deux et corriger les bugs de fusion (merge) pour rendre le site 100 % fonctionnel.
|
||||||
|
|
||||||
|
**Travail de Tajeddine :**
|
||||||
|
* Création des vues publiques de l'application : Accueil, listes de jeux filtrées, résultats de recherche et fiche détaillée.
|
||||||
|
* Création des contrôleurs associés (`Home`, `Category`, `Genre`, `Game`).
|
||||||
|
* Implémentation du moteur de recherche par mots-clés.
|
||||||
|
* Mise en place des modèles de base pour les catégories et les genres.
|
||||||
|
|
||||||
|
**Travail d'Ibrahim (:**
|
||||||
|
* suppression de tout le HTML dans les contrôleurs
|
||||||
|
* Tri (par Titre et Année) et création de la vue d'administration (`liste_jeux_vue.php`) incluant les boutons d'ajout, de modification et de suppression.
|
||||||
|
* **Débogage global du projet suite à la fusion :**
|
||||||
|
* Activation de la base de données dans `$autoload['libraries']` pour éviter les plantages sur les pages publiques.
|
||||||
|
* Alignement des modèles (`Game_model`, `Category_model`, `Genre_model`) et des vues avec la réalité de la base de données MariaDB (correction des clés primaires `gameId` en `id`, et des colonnes `title` en `name`, `year` en `releaseYear`).
|
||||||
|
* Résolution du problème d'affichage des images stockées au format `mediumblob` en utilisant un encodage natif PHP (`base64_encode`).
|
||||||
|
|
||||||
|
|
||||||
|
**Difficultés rencontrées :** * Énormément d'erreurs PHP ("Undefined array key") et SQL ("Erreur 1054 : Colonne inconnue") apparues après la fusion des codes, causées par des différences entre le nom des variables et le schéma réel de la base de données.
|
||||||
|
* Difficulté à afficher l'image (Poster) du jeu
|
||||||
|
|
||||||
|
|
||||||
|
**Usage de l'IA (Séance 4) :**
|
||||||
|
* **Prompts utilisés :** Envoi des logs d'erreurs CodeIgniter (`Undefined array key`, `Call to undefined method`), requêtes SQL en erreur (Erreur 1054), et questions sur l'affichage d'une image BLOB en HTML.
|
||||||
|
* **Extraits de réponse jugés utiles :** * L'IA m'a expliqué que la connexion à la BDD n'était pas persistante d'une page à l'autre sans l'Autoload.
|
||||||
|
* L'IA m'a fourni la syntaxe HTML/PHP exacte (`<img src="data:image/jpeg;base64,...">`) pour afficher notre format d'image.
|
||||||
@@ -58,7 +58,7 @@ $autoload['packages'] = array();
|
|||||||
|
|
|
|
||||||
| $autoload['libraries'] = array('user_agent' => 'ua');
|
| $autoload['libraries'] = array('user_agent' => 'ua');
|
||||||
*/
|
*/
|
||||||
$autoload['libraries'] = array();
|
$autoload['libraries'] = array('database');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
| -------------------------------------------------------------------
|
| -------------------------------------------------------------------
|
||||||
|
|||||||
@@ -8,22 +8,10 @@ class Category extends CI_Controller {
|
|||||||
redirect('home');
|
redirect('home');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1. Charger les modèles nécessaires
|
|
||||||
$this->load->model('Game_model');
|
$this->load->model('Game_model');
|
||||||
$this->load->model('Category_model');
|
|
||||||
|
|
||||||
// 2. Récupérer les infos de la catégorie pour afficher son nom
|
|
||||||
$this->db->where('categoryId', $id);
|
|
||||||
$data['category'] = $this->db->get('category')->row_array();
|
|
||||||
|
|
||||||
if (empty($data['category'])) {
|
|
||||||
show_404();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. Récupérer tous les jeux de cette catégorie
|
|
||||||
$data['games'] = $this->Game_model->get_by_category($id);
|
$data['games'] = $this->Game_model->get_by_category($id);
|
||||||
|
|
||||||
// 4. Envoyer le tout à une nouvelle vue
|
|
||||||
$this->load->view('games_list_view', $data);
|
$this->load->view('games_list_view', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,17 +9,9 @@ class Genre extends CI_Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->load->model('Game_model');
|
$this->load->model('Game_model');
|
||||||
$this->load->model('Genre_model');
|
|
||||||
|
|
||||||
$this->db->where('genreId', $id);
|
|
||||||
$data['genre'] = $this->db->get('genre')->row_array();
|
|
||||||
|
|
||||||
if (empty($data['genre'])) {
|
|
||||||
show_404();
|
|
||||||
}
|
|
||||||
|
|
||||||
$data['games'] = $this->Game_model->get_by_genre($id);
|
$data['games'] = $this->Game_model->get_by_genre($id);
|
||||||
|
|
||||||
$this->load->view('games_list_view', $data);
|
$this->load->view('genre_games_list_view', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,27 +8,20 @@ class Category_model extends CI_Model {
|
|||||||
$this->load->database();
|
$this->load->database();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Récupère toutes les catégories de la base de données
|
|
||||||
*/
|
|
||||||
public function get_all() {
|
public function get_all() {
|
||||||
$query = $this->db->get('category');
|
$query = $this->db->get('category');
|
||||||
|
|
||||||
return $query->result_array();
|
return $query->result_array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get_by_game($game_id) {
|
||||||
public function get_by_game($game_id) {
|
$this->db->select('category.*');
|
||||||
$this->db->select('category.*');
|
$this->db->from('category');
|
||||||
$this->db->from('category');
|
|
||||||
|
$this->db->join('game_category', 'game_category.categoryId = category.id');
|
||||||
$this->db->join('game_category', 'game_category.categoryId = category.categoryId');
|
|
||||||
|
$this->db->where('game_category.gameId', $game_id);
|
||||||
$this->db->where('game_category.gameId', $game_id);
|
|
||||||
|
$query = $this->db->get();
|
||||||
$query = $this->db->get();
|
return $query->result_array();
|
||||||
|
}
|
||||||
return $query->result_array();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,66 +1,52 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||||
|
|
||||||
|
|
||||||
class Game_model extends CI_Model {
|
class Game_model extends CI_Model {
|
||||||
|
|
||||||
public function search_by_title($keyword) {
|
public function search_by_title($keyword) {
|
||||||
|
$this->db->select('*');
|
||||||
|
$this->db->from('game');
|
||||||
$this->db->like('name', $keyword);
|
$this->db->like('name', $keyword);
|
||||||
$query = $this->db->get('game');
|
|
||||||
|
|
||||||
return $query->result();
|
$query = $this->db->get();
|
||||||
|
return $query->result_array();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Récupère les jeux appartenant à une catégorie spécifique
|
|
||||||
*/
|
|
||||||
public function get_by_category($category_id) {
|
public function get_by_category($category_id) {
|
||||||
$this->db->select('game.*');
|
$this->db->select('game.*');
|
||||||
$this->db->from('game');
|
$this->db->from('game');
|
||||||
|
$this->db->join('game_category', 'game_category.gameId = game.id'); // C'était ICI l'erreur !
|
||||||
$this->db->join('game_category', 'game_category.gameId = game.gameId');
|
|
||||||
|
|
||||||
$this->db->where('game_category.categoryId', $category_id);
|
$this->db->where('game_category.categoryId', $category_id);
|
||||||
|
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
return $query->result_array();
|
return $query->result_array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Récupère les jeux appartenant à un genre spécifique
|
|
||||||
*/
|
|
||||||
public function get_by_genre($genre_id) {
|
public function get_by_genre($genre_id) {
|
||||||
$this->db->select('game.*');
|
$this->db->select('game.*');
|
||||||
$this->db->from('game');
|
$this->db->from('game');
|
||||||
|
$this->db->join('game_genre', 'game_genre.gameId = game.id'); // Et ICI !
|
||||||
$this->db->join('game_genre', 'game_genre.gameId = game.gameId');
|
|
||||||
|
|
||||||
$this->db->where('game_genre.genreId', $genre_id);
|
$this->db->where('game_genre.genreId', $genre_id);
|
||||||
|
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
return $query->result_array();
|
return $query->result_array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function get_by_id($game_id) {
|
||||||
* Récupère les détails complets d'un jeu (avec développeur et poster)
|
$this->db->select('game.*, developer.name as developer_name, poster.jpeg as poster_url');
|
||||||
*/
|
$this->db->from('game');
|
||||||
public function get_by_id($game_id) {
|
|
||||||
|
$this->db->join('developer', 'developer.id = game.developerId', 'left');
|
||||||
$this->db->select('game.*, developer.name as developer_name, poster.url as poster_url');
|
$this->db->join('poster', 'poster.id = game.posterId', 'left');
|
||||||
$this->db->from('game');
|
|
||||||
|
$this->db->where('game.id', $game_id);
|
||||||
$this->db->join('developer', 'developer.developerId = game.developerId', 'left');
|
|
||||||
|
$query = $this->db->get();
|
||||||
$this->db->join('poster', 'poster.posterId = game.posterId', 'left');
|
return $query->row_array();
|
||||||
|
}
|
||||||
$this->db->where('game.gameId', $game_id);
|
|
||||||
|
|
||||||
$query = $this->db->get();
|
|
||||||
|
|
||||||
return $query->row_array();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function ajouter_jeu($titre, $annee, $description, $prix) {
|
public function ajouter_jeu($titre, $annee, $description, $prix) {
|
||||||
$donnees = array(
|
$donnees = array(
|
||||||
@@ -73,11 +59,11 @@ class Game_model extends CI_Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function supprimer_jeu($id) {
|
public function supprimer_jeu($id) {
|
||||||
return $this->db->delete('game', array('gameId' => $id));
|
return $this->db->delete('game', array('id' => $id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_jeu($id) {
|
public function get_jeu($id) {
|
||||||
$leJeu = $this->db->get_where('game', array('gameId' => $id));
|
$leJeu = $this->db->get_where('game', array('id' => $id));
|
||||||
return $leJeu->row_array();
|
return $leJeu->row_array();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,10 +75,11 @@ class Game_model extends CI_Model {
|
|||||||
'price' => empty($prix) ? NULL : $prix
|
'price' => empty($prix) ? NULL : $prix
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->db->where('gameId', $id);
|
$this->db->where('id', $id);
|
||||||
return $this->db->update('game', $donnees);
|
return $this->db->update('game', $donnees);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function get_tous_les_jeux($critere_tri = 'id') {
|
public function get_tous_les_jeux($critere_tri = 'id') {
|
||||||
$tris_autorises = array('id', 'name', 'releaseYear', 'price');
|
$tris_autorises = array('id', 'name', 'releaseYear', 'price');
|
||||||
|
|
||||||
@@ -101,23 +88,12 @@ class Game_model extends CI_Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->db->order_by($critere_tri, 'ASC');
|
$this->db->order_by($critere_tri, 'ASC');
|
||||||
|
|
||||||
$query = $this->db->get('game');
|
$query = $this->db->get('game');
|
||||||
|
|
||||||
return $query->result_array();
|
return $query->result_array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get_all_games() {
|
||||||
public function search_by_title($keyword) {
|
return $this->get_tous_les_jeux();
|
||||||
$this->db->select('*');
|
|
||||||
$this->db->from('game');
|
|
||||||
|
|
||||||
$this->db->like('title', $keyword);
|
|
||||||
|
|
||||||
$query = $this->db->get();
|
|
||||||
return $query->result_array();
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ class Genre_model extends CI_Model {
|
|||||||
$this->db->select('genre.*');
|
$this->db->select('genre.*');
|
||||||
$this->db->from('genre');
|
$this->db->from('genre');
|
||||||
|
|
||||||
$this->db->join('game_genre', 'game_genre.genreId = genre.genreId');
|
$this->db->join('game_genre', 'game_genre.genreId = genre.id');
|
||||||
|
|
||||||
$this->db->where('game_genre.gameId', $game_id);
|
$this->db->where('game_genre.gameId', $game_id);
|
||||||
|
|
||||||
|
|||||||
@@ -3,62 +3,59 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Détails du jeu - <?= html_escape($game['name']) ?></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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="<?= site_url('home') ?>">⬅ Retour à l'accueil</a>
|
<p>
|
||||||
|
<a href="<?= site_url('home') ?>">⬅ Retour à l'accueil</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="game-detail">
|
<div>
|
||||||
<div>
|
<?php if (!empty($game['poster_url'])): ?>
|
||||||
<?php if (!empty($game['poster_url'])): ?>
|
<img src="data:image/jpeg;base64,<?= base64_encode($game['poster_url']) ?>" alt="Poster de <?= html_escape($game['name']) ?>">
|
||||||
<img src="<?= base_url('assets/uploads/' . html_escape($game['poster_url'])) ?>" alt="Poster de <?= html_escape($game['name']) ?>" class="poster">
|
<?php else: ?>
|
||||||
|
<p>Aucun poster disponible pour ce jeu.</p>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<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']) . ' €' : 'Gratuit / Non renseigné' ?></p>
|
||||||
|
|
||||||
|
<h3>Description :</h3>
|
||||||
|
<p><?= nl2br(html_escape($game['shortDescription'])) ?></p>
|
||||||
|
|
||||||
|
<h3>Catégories associées :</h3>
|
||||||
|
<ul>
|
||||||
|
<?php if (!empty($categories)): ?>
|
||||||
|
<?php foreach ($categories as $cat): ?>
|
||||||
|
<li>
|
||||||
|
<a href="<?= site_url('category/view/' . $cat['id']) ?>">
|
||||||
|
<?= html_escape($cat['description']) ?>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php endforeach; ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="poster" style="background:#eee; padding:50px; text-align:center;">
|
<li><em>Aucune catégorie pour ce jeu.</em></li>
|
||||||
Aucun poster disponible
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</ul>
|
||||||
|
|
||||||
<div class="game-info">
|
<h3>Genres associés :</h3>
|
||||||
<h1><?= html_escape($game['name']) ?> (<?= html_escape($game['releaseYear']) ?>)</h1>
|
<ul>
|
||||||
|
<?php if (!empty($genres)): ?>
|
||||||
<p><strong>Développeur :</strong> <?= !empty($game['developer_name']) ? html_escape($game['developer_name']) : 'Inconnu' ?></p>
|
<?php foreach ($genres as $gen): ?>
|
||||||
|
<li>
|
||||||
<p><strong>Prix :</strong> <?= !empty($game['price']) ? html_escape($game['price']) . ' €' : 'Non renseigné' ?></p>
|
<a href="<?= site_url('genre/view/' . $gen['id']) ?>">
|
||||||
|
<?= html_escape($gen['description']) ?>
|
||||||
<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>
|
</a>
|
||||||
<?php endforeach; ?>
|
</li>
|
||||||
<?php else: ?>
|
<?php endforeach; ?>
|
||||||
Aucune catégorie pour ce jeu.
|
<?php else: ?>
|
||||||
<?php endif; ?>
|
<li><em>Aucun genre pour ce jeu.</em></li>
|
||||||
</p>
|
<?php endif; ?>
|
||||||
|
</ul>
|
||||||
<h3>Genres associés :</h3>
|
</div>
|
||||||
<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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -8,9 +8,9 @@
|
|||||||
<a href="<?= site_url('home') ?>">Retour à l'accueil</a>
|
<a href="<?= site_url('home') ?>">Retour à l'accueil</a>
|
||||||
|
|
||||||
<?php if (isset($category)): ?>
|
<?php if (isset($category)): ?>
|
||||||
<h1>Jeux de la catégorie : <?= html_escape($category['name']) ?></h1>
|
<h1>Jeux de la catégorie : <?= html_escape($category['description']) ?></h1>
|
||||||
<?php elseif (isset($genre)): ?>
|
<?php elseif (isset($genre)): ?>
|
||||||
<h1>Jeux du genre : <?= html_escape($genre['name']) ?></h1>
|
<h1>Jeux du genre : <?= html_escape($genre['description']) ?></h1>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<h1>Liste des jeux</h1>
|
<h1>Liste des jeux</h1>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<?php if (!empty($games)): ?>
|
<?php if (!empty($games)): ?>
|
||||||
<?php foreach ($games as $game): ?>
|
<?php foreach ($games as $game): ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?= site_url('game/detail/' . $game['gameId']) ?>">
|
<a href="<?= site_url('game/detail/' . $game['id']) ?>">
|
||||||
<?= html_escape($game['name']) ?> (<?= html_escape($game['releaseYear']) ?>)
|
<?= html_escape($game['name']) ?> (<?= html_escape($game['releaseYear']) ?>)
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
<html lang="fr">
|
<html lang="fr">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Jeux du genre <?php echo html_escape($genre['name']); ?></title>
|
<title>Jeux du genre</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<p><a href="<?php echo site_url('home'); ?>">← Retour à l'accueil</a></p>
|
<p><a href="<?php echo site_url('home'); ?>">← Retour à l'accueil</a></p>
|
||||||
|
|
||||||
<h1>Jeux du genre : "<?php echo html_escape($genre['name']); ?>"</h1>
|
<h1>Jeux du genre</h1>
|
||||||
|
|
||||||
<?php if (empty($games)): ?>
|
<?php if (empty($games)): ?>
|
||||||
<p>Aucun jeu trouvé pour ce genre pour le moment.</p>
|
<p>Aucun jeu trouvé pour ce genre pour le moment.</p>
|
||||||
@@ -16,10 +16,10 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($games as $game): ?>
|
<?php foreach ($games as $game): ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?php echo site_url('game/detail/' . $game['gameId']); ?>">
|
<a href="<?php echo site_url('game/detail/' . $game['id']); ?>">
|
||||||
<strong><?php echo html_escape($game['title']); ?></strong>
|
<strong><?php echo html_escape($game['name']); ?></strong>
|
||||||
</a>
|
</a>
|
||||||
(<?php echo html_escape($game['year']); ?>)
|
(<?php echo html_escape($game['releaseYear']); ?>)
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -6,6 +6,11 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<a href="<?php echo site_url('jeux/lister'); ?>">
|
||||||
|
Administration (Gestion des jeux)
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h1>Bienvenue sur l'application Jeux Vidéo</h1>
|
<h1>Bienvenue sur l'application Jeux Vidéo</h1>
|
||||||
|
|
||||||
<main style="display: flex; gap: 50px;">
|
<main style="display: flex; gap: 50px;">
|
||||||
@@ -20,26 +25,26 @@
|
|||||||
<section>
|
<section>
|
||||||
<h2>Nos Catégories</h2>
|
<h2>Nos Catégories</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($categories as $category): ?>
|
<?php foreach ($categories as $category): ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?php echo site_url('category/view/' . $category['categoryId']); ?>">
|
<a href="<?php echo site_url('category/view/' . $category['id']); ?>">
|
||||||
<?php echo html_escape($category['name']); ?>
|
<?php echo html_escape($category['description']); ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Nos Genres</h2>
|
<h2>Nos Genres</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($genres as $genre): ?>
|
<?php foreach ($genres as $genre): ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?php echo site_url('genre/view/' . $genre['genreId']); ?>">
|
<a href="<?php echo site_url('genre/view/' . $genre['id']); ?>">
|
||||||
<?php echo html_escape($genre['name']); ?>
|
<?php echo html_escape($genre['description']); ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -1,15 +1,39 @@
|
|||||||
<h2>Liste des jeux</h2>
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Administration des Jeux</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
<p>Trier par :
|
<p><a href="<?= site_url('home') ?>">⬅ Retour au site public</a></p>
|
||||||
<a href="<?php echo site_url('jeux/lister/name'); ?>">Titre (A-Z)</a> |
|
|
||||||
<a href="<?php echo site_url('jeux/lister/releaseYear'); ?>">Année de sortie</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<ul>
|
<h2>Administration - Liste des jeux</h2>
|
||||||
<?php foreach ($jeux as $jeu): ?>
|
|
||||||
<li>
|
<p>
|
||||||
<strong><?php echo html_escape($jeu['name']); ?></strong>
|
<a href="<?= site_url('jeux/ajouter') ?>"> Ajouter un nouveau jeu</a>
|
||||||
- <em>(<?php echo html_escape($jeu['releaseYear']); ?>)</em>
|
</p>
|
||||||
</li>
|
|
||||||
<?php endforeach; ?>
|
<p>
|
||||||
</ul>
|
<strong>Trier par :</strong>
|
||||||
|
<a href="<?= site_url('jeux/lister/name') ?>">Titre (A-Z)</a> |
|
||||||
|
<a href="<?= site_url('jeux/lister/releaseYear') ?>">Année de sortie</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<?php foreach ($jeux as $jeu): ?>
|
||||||
|
<li>
|
||||||
|
<strong><?= html_escape($jeu['name']) ?></strong>
|
||||||
|
- <em>(<?= html_escape($jeu['releaseYear']) ?>)</em>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
<a href="<?= site_url('jeux/modifier/' . $jeu['id']) ?>">Modifier</a>
|
||||||
|
|
|
||||||
|
<a href="<?= site_url('jeux/supprimer/' . $jeu['id']) ?>" onclick="return confirm('Es-tu sûr de vouloir supprimer définitivement ce jeu ?');"> Supprimer</a>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -2,25 +2,25 @@
|
|||||||
<html lang="fr">
|
<html lang="fr">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Résultats de recherche pour "<?php echo html_escape($search_keyword); ?>"</title>
|
<title>Résultats de recherche pour "<?= html_escape($search_keyword) ?>"</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<p><a href="<?php echo site_url('home'); ?>">← Retour à l'accueil</a></p>
|
<p><a href="<?= site_url('home') ?>">⬅ Retour à l'accueil</a></p>
|
||||||
|
|
||||||
<h1>Résultats pour : "<?php echo html_escape($search_keyword); ?>"</h1>
|
<h1>Résultats pour : "<?= html_escape($search_keyword) ?>"</h1>
|
||||||
|
|
||||||
<?php if (empty($games)): ?>
|
<?php if (empty($games)): ?>
|
||||||
<p>Aucun jeu vidéo ne correspond à votre recherche.</p>
|
<p>Aucun jeu vidéo ne correspond à votre recherche.</p>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<p><strong><?php echo count($games); ?></strong> jeu(x) trouvé(s) :</p>
|
<p><strong><?= count($games) ?></strong> jeu(x) trouvé(s) :</p>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($games as $game): ?>
|
<?php foreach ($games as $game): ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?php echo site_url('game/detail/' . $game['gameId']); ?>">
|
<a href="<?= site_url('game/detail/' . $game['id']) ?>">
|
||||||
<strong><?php echo html_escape($game['title']); ?></strong>
|
<strong><?= html_escape($game['name']) ?></strong>
|
||||||
</a>
|
</a>
|
||||||
(<?php echo html_escape($game['year']); ?>)
|
(<?= html_escape($game['releaseYear']) ?>)
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user