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]);