"; echo "
Playlist List
+"; + echo "
diff --git a/ci/application/config/config.php b/ci/application/config/config.php index bfc3804..3efe38d 100644 --- a/ci/application/config/config.php +++ b/ci/application/config/config.php @@ -23,7 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); | a PHP script and you can easily do that on your own. | */ -$config['base_url'] = '/~boutaric/SAEWEB2.2/ci/'; +$config['base_url'] = '/~brigitte/SAEWEB2.2/ci/'; /* |-------------------------------------------------------------------------- diff --git a/ci/application/controllers/Albums.php b/ci/application/controllers/Albums.php index 5afc1b1..8ef84c9 100644 --- a/ci/application/controllers/Albums.php +++ b/ci/application/controllers/Albums.php @@ -18,9 +18,9 @@ class Albums extends CI_Controller { public function view($album_id){ $songs = $this->model_music->getSongOfAlbum($album_id); if (empty($songs)) { - $songs = []; // Assurez-vous que $songs est un tableau vide si aucune chanson n'est trouvée + $songs = []; } - // Debugging: Log the $songs variable to see its content + log_message('debug', 'Songs: ' . print_r($songs, true)); $this->load->view('layout/header_album'); diff --git a/ci/application/controllers/Artistes.php b/ci/application/controllers/Artistes.php index 2814e7b..1c0b024 100644 --- a/ci/application/controllers/Artistes.php +++ b/ci/application/controllers/Artistes.php @@ -18,7 +18,7 @@ class artistes extends CI_Controller { $AlbumsOfArtist = $this->model_music->getAlbumsOfArtist($AlbumsOfArtistId); $this->load->view('layout/header_artistes'); $this->load->view('albums_artist_list',['AlbumsOfArtist'=>$AlbumsOfArtist]); - $this->load->view('layout/footer'); + $this->load->view('layout/footer_artistes'); } } \ No newline at end of file diff --git a/ci/application/controllers/Playlist.php b/ci/application/controllers/Playlist.php index e69de29..8625daa 100644 --- a/ci/application/controllers/Playlist.php +++ b/ci/application/controllers/Playlist.php @@ -0,0 +1,17 @@ +load->model('model_music'); + } + + public function index(){ + $playlists = $this->model_music->getPlaylist(); + //$this->load->view('layout/header_album'); + $this->load->view('playlist_list', ['playlists' => $playlists]); + //$this->load->view('layout/footer_album'); + } +} \ No newline at end of file diff --git a/ci/application/models/Model_music.php b/ci/application/models/Model_music.php index 4d68449..3b070f8 100644 --- a/ci/application/models/Model_music.php +++ b/ci/application/models/Model_music.php @@ -28,6 +28,16 @@ class Model_music extends CI_Model { return $query->result(); } + public function getPlaylist(){ + $query = $this->db->query( + "SELECT playlist.id, playlist.name + FROM playlist + Group by playlist.id + " + ); + return $query->result(); + } + public function getSongOfAlbum($album_id){ $query = $this->db->query( "SELECT song.id, song.name diff --git a/ci/application/views/artistes_list.php b/ci/application/views/artistes_list.php index 906ebc5..4b263ad 100644 --- a/ci/application/views/artistes_list.php +++ b/ci/application/views/artistes_list.php @@ -1,10 +1,10 @@