ajout dans les playlist seulement si connecté
This commit is contained in:
parent
04968758d1
commit
a1b797a1c5
@ -4,21 +4,24 @@
|
||||
foreach ($AlbumsOfArtists as $AlbumsOfArtist) {
|
||||
echo "<div class='album'><article>";
|
||||
echo "<header class='album-title'>";
|
||||
echo anchor("albums/view/{$AlbumsOfArtist->id}", "{$AlbumsOfArtist->name}");
|
||||
echo "<br>";
|
||||
echo "</header>";
|
||||
echo '<img src="data:image/jpeg;base64,' . base64_encode($AlbumsOfArtist->jpeg) . '" alt="' . $AlbumsOfArtist->name . '" />';
|
||||
echo "<footer class='short-text'>$AlbumsOfArtist->year</footer>";
|
||||
|
||||
// Ajout du formulaire pour ajouter toutes les chansons de l'album à une playlist
|
||||
echo "<form action='" . base_url('index.php/albums/addAllSongsToPlaylist') . "' method='post'>";
|
||||
echo "<input type='hidden' name='album_id' value='{$AlbumsOfArtist->id}'>";
|
||||
echo "<select name='playlist'>";
|
||||
foreach($playlists as $playlist){
|
||||
echo "<option value='{$playlist->id}'>{$playlist->name}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "<button type='submit'>Ajouter toutes les chansons</button>";
|
||||
echo "</form>";
|
||||
if ($this->session->userdata('logged')):
|
||||
echo "<form action='" . base_url('index.php/albums/addAllSongsToPlaylist') . "' method='post'>";
|
||||
echo "<input type='hidden' name='album_id' value='{$AlbumsOfArtist->id}'>";
|
||||
echo "<select name='playlist'>";
|
||||
foreach($playlists as $playlist){
|
||||
echo "<option value='{$playlist->id}'>{$playlist->name}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "<button type='submit'>Ajouter toutes les chansons</button>";
|
||||
echo "</form>";
|
||||
endif;
|
||||
echo "</article></div>";
|
||||
|
||||
}
|
||||
|
@ -4,18 +4,22 @@
|
||||
foreach($albums as $album){
|
||||
echo "<div class='album'><article>";
|
||||
echo "<header class='album-title'>";
|
||||
echo anchor("albums/view/{$album->id}", "{$album->name}");
|
||||
echo "</header>";
|
||||
echo '<img src="data:image/jpeg;base64,' . base64_encode($album->jpeg) . '" alt="' . $album->name . '" />';
|
||||
echo "<footer class='short-text'>{$album->year} - {$album->artistName}</footer>";
|
||||
echo "<form action='" . base_url('index.php/albums/addAllSongsToPlaylist') . "' method='post'>";
|
||||
echo "<input type='hidden' name='album_id' value='{$album->id}'>";
|
||||
echo "<select name='playlist'>";
|
||||
foreach($playlists as $playlist){
|
||||
echo "<option value='{$playlist->id}'>{$playlist->name}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "<button type='submit'>Ajouter toutes les chansons</button>";
|
||||
echo "</form>";
|
||||
|
||||
if ($this->session->userdata('logged')):
|
||||
echo "<form action='" . base_url('index.php/albums/addAllSongsToPlaylist') . "' method='post'>";
|
||||
echo "<input type='hidden' name='album_id' value='{$album->id}'>";
|
||||
echo "<select name='playlist'>";
|
||||
foreach($playlists as $playlist){
|
||||
echo "<option value='{$playlist->id}'>{$playlist->name}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "<button type='submit'>Ajouter toutes les chansons</button>";
|
||||
echo "</form>";
|
||||
endif;
|
||||
echo "</article></div>";
|
||||
}
|
||||
?>
|
||||
|
@ -3,14 +3,17 @@
|
||||
foreach($artistes as $artiste){
|
||||
echo "<form action='" . base_url("index.php/artistes/addSongOfArtistToPlaylist") . "' method='post'>";
|
||||
echo anchor("artistes/view/{$artiste->id}", "{$artiste->name}");
|
||||
echo "<select name='playlist'>";
|
||||
foreach ($playlists as $playlist) {
|
||||
echo "<option value='{$playlist->id}'>{$playlist->name}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "<input type='hidden' name='artistId' value='{$artiste->id}' />"; // Utilisez l'identifiant de l'artiste ici
|
||||
echo "<button type='submit' class='add-to-playlist'>+</button>";
|
||||
echo "</form>";
|
||||
|
||||
if ($this->session->userdata('logged')):
|
||||
echo "<select name='playlist'>";
|
||||
foreach ($playlists as $playlist) {
|
||||
echo "<option value='{$playlist->id}'>{$playlist->name}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "<input type='hidden' name='artistId' value='{$artiste->id}' />"; // Utilisez l'identifiant de l'artiste ici
|
||||
echo "<button type='submit' class='add-to-playlist'>+</button>";
|
||||
echo "</form>";
|
||||
endif;
|
||||
echo "<br>";
|
||||
}
|
||||
?>
|
||||
|
@ -2,17 +2,20 @@
|
||||
<?php
|
||||
foreach($songs as $song){
|
||||
echo "<div><article>";
|
||||
echo "<header class='short-text'>";
|
||||
echo "<form action='" . base_url("index.php/playlist/addSongToPlaylist") . "' method='post'>";
|
||||
echo "<header class='short-text'>";
|
||||
echo "{$song->name} ";
|
||||
echo "<select name='playlist'>";
|
||||
foreach ($playlists as $playlist) {
|
||||
echo "<option value='{$playlist->id}'>{$playlist->name}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "<input type='hidden' name='song' value='{$song->name}' />";
|
||||
echo "<button type='submit' class='add-to-playlist'>+</button>";
|
||||
echo "</form>";
|
||||
|
||||
if ($this->session->userdata('logged')):
|
||||
echo "<form action='" . base_url("index.php/playlist/addSongToPlaylist") . "' method='post'>";
|
||||
echo "<select name='playlist'>";
|
||||
foreach ($playlists as $playlist) {
|
||||
echo "<option value='{$playlist->id}'>{$playlist->name}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "<input type='hidden' name='song' value='{$song->name}' />";
|
||||
echo "<button type='submit' class='add-to-playlist'>+</button>";
|
||||
echo "</form>";
|
||||
endif;
|
||||
echo "<br>";
|
||||
echo "</header>";
|
||||
echo "</article></div>";
|
||||
|
Loading…
Reference in New Issue
Block a user