mirror of
https://grond.iut-fbleau.fr/stiti/SAE_2.02
synced 2024-11-09 21:11:40 +01:00
Commit de louay : modifs
This commit is contained in:
parent
a3bcef8683
commit
73f0cb1377
@ -87,9 +87,11 @@ class Model_music extends CI_Model {
|
|||||||
);
|
);
|
||||||
$album = $query->row();
|
$album = $query->row();
|
||||||
|
|
||||||
|
$tracks = []; // Initialiser le tableau des pistes
|
||||||
|
|
||||||
if ($album) {
|
if ($album) {
|
||||||
$query = $this->db->query(
|
$query = $this->db->query(
|
||||||
"SELECT track.id, track.diskNumber, track.number, track.duration, song.name as songName
|
"SELECT track.id, track.diskNumber, track.number, track.duration, song.id as song_id, song.name as songName
|
||||||
FROM track
|
FROM track
|
||||||
JOIN song ON track.songid = song.id
|
JOIN song ON track.songid = song.id
|
||||||
WHERE track.albumid = ?
|
WHERE track.albumid = ?
|
||||||
|
@ -25,7 +25,9 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($tracks as $track): ?>
|
<?php foreach ($tracks as $track): ?>
|
||||||
<li>
|
<li>
|
||||||
<strong><?php echo $track->diskNumber . '.' . $track->number; ?>:</strong> <?php echo $track->songName; ?> (<?php echo gmdate("i:s", $track->duration); ?>)
|
<strong><?php echo $track->diskNumber . '.' . $track->number; ?>:</strong>
|
||||||
|
<a href="<?php echo site_url('musiques/view/' . $track->song_id); ?>"><?php echo $track->songName; ?></a>
|
||||||
|
(<?php echo gmdate("i:s", $track->duration); ?>)
|
||||||
<?php if ($this->session->userdata('user_id')): ?>
|
<?php if ($this->session->userdata('user_id')): ?>
|
||||||
<button onclick="addSongToPlaylist(<?php echo $track->id; ?>, <?php echo $album->id; ?>)" class="btn-add-music-to-playlist">Ajouter la musique à la playlist</button>
|
<button onclick="addSongToPlaylist(<?php echo $track->id; ?>, <?php echo $album->id; ?>)" class="btn-add-music-to-playlist">Ajouter la musique à la playlist</button>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
Loading…
Reference in New Issue
Block a user