début albums + son

This commit is contained in:
Wilfried BRIGITTE 2024-05-27 13:08:39 +02:00
parent d04b8c19e2
commit 1e2735d5ba
4 changed files with 25 additions and 1 deletions

View File

@ -13,6 +13,12 @@ class Albums extends CI_Controller {
$this->load->view('albums_list',['albums'=>$albums]); $this->load->view('albums_list',['albums'=>$albums]);
$this->load->view('layout/footer'); $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');
}
} }

View File

@ -27,4 +27,14 @@ class Model_music extends CI_Model {
); );
return $query->result(); return $query->result();
} }
public function getSongOfAlbum(){
$query = $this->db->query(
"SELECT artist.id, artist.name
FROM artist
Group by artist.id
"
);
return $query->result();
}
} }

View File

@ -4,7 +4,7 @@
foreach($albums as $album){ foreach($albums as $album){
echo "<div><article>"; echo "<div><article>";
echo "<header class='short-text'>"; echo "<header class='short-text'>";
echo anchor("albums/view/{$album->id}","{$album->name}"); echo anchor("albums/view/song_album_list.php","{$album->name}");
echo "</header>"; echo "</header>";
echo '<img src="data:image/jpeg;base64,'.base64_encode($album->jpeg).'" />'; echo '<img src="data:image/jpeg;base64,'.base64_encode($album->jpeg).'" />';
echo "<footer class='short-text'>{$album->year} - {$album->artistName}</footer> echo "<footer class='short-text'>{$album->year} - {$album->artistName}</footer>

View File

@ -0,0 +1,8 @@
<h5>Song of the album</h5>
<section class="list">
<?php
?>
</section>