Ajout de la playlist, ajout et suppression de son dans l'onglet playlist
This commit is contained in:
53
codeigniter/application/views/playlist_view.php
Normal file
53
codeigniter/application/views/playlist_view.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<!-- En-tête de la playlist -->
|
||||
<h5>Playlist : <?= $playlistName; ?></h5>
|
||||
|
||||
<!-- Formulaire pour rechercher et ajouter une chanson -->
|
||||
<form action="<?= site_url('playlist/search_song'); ?>" method="post" class="add-song-form">
|
||||
<input type="hidden" name="playlistId" value="<?= $playlistId; ?>">
|
||||
<input type="text" name="songName" placeholder="Nom de la chanson" required>
|
||||
<button type="submit">Rechercher et Ajouter</button>
|
||||
</form>
|
||||
|
||||
<!-- Section pour afficher les résultats de la recherche -->
|
||||
<?php if (!empty($searchResults)): ?>
|
||||
<section class="search-results">
|
||||
<h5>Résultats de la recherche :</h5>
|
||||
<ul>
|
||||
<?php foreach($searchResults as $song): ?>
|
||||
<li>
|
||||
<?= $song->name; ?>
|
||||
<!-- Formulaire pour ajouter la chanson à la playlist -->
|
||||
<form action="<?= site_url('playlist/add_song'); ?>" method="post" style="display:inline;">
|
||||
<input type="hidden" name="playlistId" value="<?= $playlistId; ?>">
|
||||
<input type="hidden" name="songId" value="<?= $song->id; ?>">
|
||||
<button type="submit">Ajouter</button>
|
||||
</form>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</section>
|
||||
<p>Test</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Section pour afficher les chansons de son playlist -->
|
||||
<?php if (!empty($songs)): ?>
|
||||
<section class="current-songs">
|
||||
<h5>Chansons actuelles :</h5>
|
||||
<ul>
|
||||
<?php foreach($songs as $song): ?>
|
||||
<li>
|
||||
<?= $song->name; ?>
|
||||
<!-- Formulaire pour supprimer la chanson de la playlist -->
|
||||
<form action="<?= site_url('playlist/remove_song'); ?>" method="post" style="display:inline;">
|
||||
<input type="hidden" name="playlistId" value="<?= $playlistId; ?>">
|
||||
<input type="hidden" name="songId" value="<?= $song->id; ?>">
|
||||
<button type="submit">Supprimer</button>
|
||||
</form>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<a href="<?= site_url('playlist'); ?>" class="btn btn-secondary">Retour à toutes les playlists</a>
|
||||
|
Reference in New Issue
Block a user