possibilité de supprimer une chansons d'une playlist
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<div class="playlist-option">
|
||||
<label>
|
||||
<input type="radio" name="playlist_id" value="<?= $playlist->playlistid ?>">
|
||||
<?= htmlspecialchars($playlist->name) ?>
|
||||
<?= $playlist->name ?>
|
||||
</label>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
@@ -35,12 +35,22 @@
|
||||
$artistName = $albums->artist->name;
|
||||
$duration = isset($albums->tracks[$index]->duration) ? convertirSecondesEnMinutes($albums->tracks[$index]->duration) : '';
|
||||
echo "<td>{$songName}</td>";
|
||||
|
||||
|
||||
echo "<th></th>";
|
||||
echo "<th></th>";
|
||||
echo "<th></th>";
|
||||
echo "<th></th>";
|
||||
echo "<th></th>";
|
||||
if ($this->session->userdata('logged_in')){
|
||||
if($this->model_music->SongInPlaylist($albums->tracks[$index]->trackId)){
|
||||
echo "<td>";
|
||||
echo anchor("chansons/deleteSongtoPlaylist/{$albums->tracks[$index]->trackId}","<i class='fa-solid fa-trash'></i>");
|
||||
echo "</td>";
|
||||
}
|
||||
echo "<td>";
|
||||
echo anchor("chansons/addSongtoPlaylist/{$albums->tracks[$index]->trackId}","<i class='fa fa-plus'></i>");
|
||||
echo "</td>";
|
||||
}
|
||||
echo "<th></th>";
|
||||
echo "<th></th>";
|
||||
echo "<th></th>";
|
||||
|
||||
@@ -148,7 +148,10 @@ foreach($chansons as $chanson){
|
||||
echo "<header class='short-text'>";
|
||||
echo anchor("chansons/view/{$chanson->id}","{$chanson->name}");
|
||||
if($this->session->userdata('logged_in')){
|
||||
echo anchor("chansons/addSongtoPlaylist/{$chanson->trackId}","<i class='fa fa-plus'></i>");
|
||||
if($this->model_music->SongInPlaylist($chanson->trackId)){
|
||||
echo anchor("chansons/deleteSongtoPlaylist/{$chanson->trackId}","<i class='fa-solid fa-trash'></i>");
|
||||
}
|
||||
echo anchor("chansons/addSongtoPlaylist/{$chanson->trackId}","<i class='fa fa-plus'></i>");
|
||||
}
|
||||
echo "</header>";
|
||||
echo "<nav class='short-text'>Nom album: {$chanson->albumName}</nav>";
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<title>Supprimer une chanson à une playlist</title>
|
||||
|
||||
<div class="trie">
|
||||
<h5>Playlists</h5>
|
||||
</div>
|
||||
|
||||
<section class="list">
|
||||
|
||||
<form method="post">
|
||||
<?php foreach ($playlists as $playlist): ?>
|
||||
<div class="playlist-option">
|
||||
<label>
|
||||
<input type="radio" name="playlist_id" value="<?= $playlist->playlistid ?>">
|
||||
<?= $playlist->name ?>
|
||||
</label>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<div class="submit-button">
|
||||
<button type="submit" class="btn btn-primary">Supprimer de la playlist</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -7,7 +7,7 @@ echo"</div>";
|
||||
foreach($playlists as $playlist){
|
||||
echo "<div><article>";
|
||||
echo "<header class='short-text'>";
|
||||
echo anchor("playlist/view/{$playlist->playlistid}","{$playlist->name}");
|
||||
echo anchor("chansons/view/{$playlist->playlistid}","{$playlist->name}");
|
||||
echo "</header>";
|
||||
echo "</article></div>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user