From 686aaaa8be93a59f21ee2e1d1eaecb9741d960db Mon Sep 17 00:00:00 2001 From: gallego Date: Mon, 10 Jun 2024 13:41:07 +0200 Subject: [PATCH] login 2 --- ci/application/controllers/Albums.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ci/application/controllers/Albums.php b/ci/application/controllers/Albums.php index 03e505f..60da313 100644 --- a/ci/application/controllers/Albums.php +++ b/ci/application/controllers/Albums.php @@ -9,8 +9,13 @@ class Albums extends CI_Controller { } public function index(){ - $genre = $this->model_music->getGenre(); - $albums = $this->model_music->getAlbums($genre); + $selectedGenre = '0'; // Valeur par défaut pour le genre si aucun n'est sélectionné + if ($_SERVER["REQUEST_METHOD"] == "POST") { + if(isset($_POST['Genre'])){ + $selectedGenre = $_POST['Genre']; + } + } + $albums = $this->model_music->getAlbums($selectedGenre); $playlists = $this->model_music->getPlaylist(); $this->load->view('layout/header'); $this->load->view('albums_list', ['albums' => $albums, 'playlists' => $playlists]);