diff --git a/ci/application/controllers/Albums.php b/ci/application/controllers/Albums.php index 125b4e8..7ee8f12 100644 --- a/ci/application/controllers/Albums.php +++ b/ci/application/controllers/Albums.php @@ -13,6 +13,12 @@ class Albums extends CI_Controller { $this->load->view('albums_list',['albums'=>$albums]); $this->load->view('layout/footer'); } + public function view(){ + $albums = $this->model_music->getSongOfAlbum(); + $this->load->view('layout/header'); + $this->load->view('song_album_list',['musique'=>$albums]); + $this->load->view('layout/footer'); + } } diff --git a/ci/application/models/Model_music.php b/ci/application/models/Model_music.php index bd9f9ec..5ebda24 100644 --- a/ci/application/models/Model_music.php +++ b/ci/application/models/Model_music.php @@ -27,4 +27,14 @@ class Model_music extends CI_Model { ); return $query->result(); } + + public function getSongOfAlbum(){ + $query = $this->db->query( + "SELECT artist.id, artist.name + FROM artist + Group by artist.id + " + ); + return $query->result(); + } } diff --git a/ci/application/views/albums_list.php b/ci/application/views/albums_list.php index 0fd49bb..77ec1ee 100644 --- a/ci/application/views/albums_list.php +++ b/ci/application/views/albums_list.php @@ -4,7 +4,7 @@ foreach($albums as $album){ echo "