diff --git a/CodeIgniter-3.1.13/application/controllers/Artiste.php b/CodeIgniter-3.1.13/application/controllers/Artiste.php index af91596..8b32f3f 100644 --- a/CodeIgniter-3.1.13/application/controllers/Artiste.php +++ b/CodeIgniter-3.1.13/application/controllers/Artiste.php @@ -26,7 +26,7 @@ class Artiste extends CI_Controller { $user_id = $this->session->userdata('user_id'); $data['user_playlists'] = $this->Model_playlist->get_user_playlists($user_id); } - + // Charger la vue avec les détails de l'artiste et ses albums $data['artiste'] = $artiste; $data['albums'] = $albums; @@ -35,6 +35,7 @@ class Artiste extends CI_Controller { $data['title']="Détails de l'artiste - Onzeur ".$artiste->name; $data['css'] = 'assets/css/artiste_details'; + $this->load->view('layout/header_dark', $data); $this->load->view('artiste_details', $data); $this->load->view('layout/footer_dark'); diff --git a/CodeIgniter-3.1.13/application/models/Model_music.php b/CodeIgniter-3.1.13/application/models/Model_music.php index 70c5e67..d872f86 100644 --- a/CodeIgniter-3.1.13/application/models/Model_music.php +++ b/CodeIgniter-3.1.13/application/models/Model_music.php @@ -237,7 +237,7 @@ class Model_music extends CI_Model { public function getAlbumsByArtiste($artiste_id){ $query = $this->db->query(" SELECT album.id, album.name, album.year, artist.name as artistName, genre.name as genreName, cover.jpeg, - track.id as track_id, track.diskNumber, track.number, track.duration, song.name as songName + track.id as track_id, track.diskNumber, track.number, track.duration, song.id as song_id, song.name as songName FROM album JOIN artist ON album.artistid = artist.id JOIN genre ON album.genreid = genre.id @@ -270,13 +270,13 @@ class Model_music extends CI_Model { 'diskNumber' => $row->diskNumber, 'number' => $row->number, 'duration' => $row->duration, + 'song_id' => $row->song_id, // Ajouter l'ID de la chanson 'songName' => $row->songName ); } return array_values($albums); // Réorganiser les albums en utilisant des index numériques - } - + } public function getMostUsedGenreByArtist($artist_id) { $query = $this->db->query(" @@ -293,7 +293,7 @@ class Model_music extends CI_Model { } public function get_songs_by_artist($artist_id) { - $this->db->select('song.*'); + $this->db->select('song.id as song_id'); $this->db->from('track'); $this->db->join('song', 'track.songid = song.id'); $this->db->join('album', 'track.albumid = album.id'); diff --git a/CodeIgniter-3.1.13/application/views/artiste_details.php b/CodeIgniter-3.1.13/application/views/artiste_details.php index 12151bd..c416690 100644 --- a/CodeIgniter-3.1.13/application/views/artiste_details.php +++ b/CodeIgniter-3.1.13/application/views/artiste_details.php @@ -30,13 +30,11 @@ - -

Ajouter une chanson à la playlist :

-