This commit is contained in:
Julian GALLEGO 2024-06-10 13:41:07 +02:00
parent 5089f0cd33
commit 686aaaa8be

View File

@ -9,8 +9,13 @@ class Albums extends CI_Controller {
} }
public function index(){ public function index(){
$genre = $this->model_music->getGenre(); $selectedGenre = '0'; // Valeur par défaut pour le genre si aucun n'est sélectionné
$albums = $this->model_music->getAlbums($genre); if ($_SERVER["REQUEST_METHOD"] == "POST") {
if(isset($_POST['Genre'])){
$selectedGenre = $_POST['Genre'];
}
}
$albums = $this->model_music->getAlbums($selectedGenre);
$playlists = $this->model_music->getPlaylist(); $playlists = $this->model_music->getPlaylist();
$this->load->view('layout/header'); $this->load->view('layout/header');
$this->load->view('albums_list', ['albums' => $albums, 'playlists' => $playlists]); $this->load->view('albums_list', ['albums' => $albums, 'playlists' => $playlists]);