From d768ba9973f98e054d0068a5d4d900b9936b91e2 Mon Sep 17 00:00:00 2001
From: Vincent <xefal77@gmail.com>
Date: Wed, 5 Jun 2024 01:46:16 +0200
Subject: [PATCH] fix views songs 7/?

---
 application/models/Model_music.php | 7 ++++---
 application/views/song_details.php | 8 ++++----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/application/models/Model_music.php b/application/models/Model_music.php
index 0d46fd1..23151be 100644
--- a/application/models/Model_music.php
+++ b/application/models/Model_music.php
@@ -163,15 +163,15 @@ class Model_music extends CI_Model {
         // Get album details for the song
         $this->db->select('album.id as albumId, album.name as albumName, album.year');
         $this->db->from('album');
-        $this->db->join('track', 'track.albumid = album.id');
-        $this->db->where('track.songid', $songId);
+        $this->db->join('track', 'track.albumId = album.id');
+        $this->db->where('track.songId', $songId);
         $albumQuery = $this->db->get();
         $albumDetails = $albumQuery->row();
     
         // Get artist details for the album
         $this->db->select('artist.id as artistId, artist.name as artistName');
         $this->db->from('artist');
-        $this->db->join('album', 'album.artistid = artist.id');
+        $this->db->join('album', 'album.artistId = artist.id');
         $this->db->where('album.id', $albumDetails->albumId);
         $artistQuery = $this->db->get();
         $artistDetails = $artistQuery->row();
@@ -182,6 +182,7 @@ class Model_music extends CI_Model {
     
     
     
+    
 
     // Suppression de la deuxième méthode researchtype
 
diff --git a/application/views/song_details.php b/application/views/song_details.php
index ae7c2de..704454e 100644
--- a/application/views/song_details.php
+++ b/application/views/song_details.php
@@ -5,11 +5,11 @@
 </head>
 <body>
     <h1><?= $song['songName'] ?></h1>
-    <p><strong>Album:</strong> <?= anchor("albums/view/{$song['albumId']}", $song['albumName']) ?> (<?= $song['year'] ?>)</p>
-    <p><strong>Artist:</strong> <?= $song['artistName'] ?></p>
-    <p><strong>Genre:</strong> <?= $song['genreName'] ?></p>
+    <p><strong>Album:</strong> <?= anchor("music/view/{$song['albumId']}", $song['albumName']) ?> (<?= $song['album']['year'] ?>)</p>
+    <p><strong>Artist:</strong> <?= $song['artist']['artistName'] ?></p>
+    <!-- Ajoutez ici d'autres détails de la chanson si nécessaire -->
     <?php if(isset($song['jpeg']) && $song['jpeg'] != ''): ?>
-        <img src="data:image/jpeg;base64,<?= base64_encode($song['jpeg']) ?>" alt="<?= $song['albumName'] ?> Cover">
+        <img src="data:image/jpeg;base64,<?= base64_encode($song['jpeg']) ?>" alt="<?= $song['album']['albumName'] ?> Cover">
     <?php endif; ?>
 </body>
 </html>