ajouter song playlist

This commit is contained in:
2024-06-05 19:36:03 +02:00
parent ef10b58bb0
commit ba57a3adc3
7 changed files with 39 additions and 14 deletions

View File

@@ -14,21 +14,21 @@
</div>
<nav class="menu">
<ul>
<li><?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/','Home'); ?></li>
<li><?= anchor('https://dwarves.iut-fbleau.fr/~brigitte/SAEWEB2.2/ci/','Home'); ?></li>
<li class="menu_déroulant"><?= anchor('albums','Albums'); ?>
<div class="menu_déroulant_content">
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/196','New Masters'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/88','Joe Cocker!'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/213','Dylan'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/142','Mothers Milk'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~brigitte/SAEWEB2.2/ci/index.php/Song/view/196','New Masters'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~brigitte/SAEWEB2.2/ci/index.php/Song/view/88','Joe Cocker!'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~brigitte/SAEWEB2.2/ci/index.php/Song/view/213','Dylan'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~brigitte/SAEWEB2.2/ci/index.php/Song/view/142','Mothers Milk'); ?>
</div>
</li>
<li class="menu_déroulant"><?= anchor('artistes','Artistes'); ?>
<div class="menu_déroulant_content">
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/artistes/view/34','Queen'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/21','Slayer'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/63','Muse'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~boutaric/SAEWEB2.2/ci/index.php/Song/view/62','Tool'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~brigitte/SAEWEB2.2/ci/index.php/artistes/view/34','Queen'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~brigitte/SAEWEB2.2/ci/index.php/Song/view/21','Slayer'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~brigitte/SAEWEB2.2/ci/index.php/Song/view/63','Muse'); ?>
<?= anchor('https://dwarves.iut-fbleau.fr/~brigitte/SAEWEB2.2/ci/index.php/Song/view/62','Tool'); ?>
</div>
</li>
<li><?= anchor('playlist','Playlist'); ?></li>

View File

@@ -3,8 +3,16 @@
foreach($songs as $song){
echo "<div><article>";
echo "<header class='short-text'>";
echo "{$song->name}";
echo " <button class='add-to-playlist' data-song='{$song->name}'>+</button>";
echo "<form action='" . base_url("index.php/playlist/addSongToPlaylist") . "' method='post'>";
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>";
echo "<br>";
echo "</header>";
echo "</article></div>";
@@ -12,3 +20,4 @@ foreach($songs as $song){
?>
</section>