SAE_2.02/CodeIgniter-3.1.13/application/views/playlists_list.php

68 lines
3.0 KiB
PHP
Raw Permalink Normal View History

<div class="container">
<h1>Liste des Playlists</h1>
2024-06-10 21:36:22 +02:00
<?php if ($this->session->flashdata('message')): ?>
<div class="flash-message">
<?php echo $this->session->flashdata('message'); ?>
</div>
<?php endif; ?>
<a href="<?php echo site_url('playlists/create'); ?>" class="btn btn-primary">Créer une Nouvelle Playlist</a>
<a href="<?php echo site_url('playlists/generate_random'); ?>" class="btn btn-primary">Générer une playlist aléatoire</a>
2024-05-30 15:33:30 +02:00
<h1><br>Mes Playlists</h1>
<table class="table">
<thead>
<tr>
<th>Nom</th>
<th>Description</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php if (!empty($playlists)) : ?>
<?php foreach ($playlists as $playlist) : ?>
<tr>
<td><?php echo htmlspecialchars($playlist->name, ENT_QUOTES, 'UTF-8'); ?></td>
<td><?php echo htmlspecialchars($playlist->description, ENT_QUOTES, 'UTF-8'); ?></td>
<td>
<a href="<?php echo site_url('playlists/view/' . $playlist->id); ?>" class="btn btn-info">Voir</a>
<a href="<?php echo site_url('playlists/delete/' . $playlist->id); ?>" class="btn btn-danger" onclick="return confirm('Êtes-vous sûr de vouloir supprimer cette playlist ?');">Supprimer</a>
<a href="<?php echo site_url('playlists/duplicate/' . $playlist->id); ?>" class="btn btn-warning" onclick="return confirm('Êtes-vous sûr de vouloir dupliquer cette playlist ?');">Dupliquer</a>
</td>
</tr>
<?php endforeach; ?>
<?php else : ?>
2024-05-25 15:44:57 +02:00
<tr>
<td colspan="3">Aucune playlist trouvée.</td>
2024-05-25 15:44:57 +02:00
</tr>
<?php endif; ?>
</tbody>
</table>
<h1><br>Playlists Publiques</h1>
<table class="table">
<thead>
<tr>
<th>Nom</th>
<th>Description</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php if (!empty($public_playlists)) : ?>
<?php foreach ($public_playlists as $playlist) : ?>
2024-05-25 15:44:57 +02:00
<tr>
<td><?php echo htmlspecialchars($playlist->name, ENT_QUOTES, 'UTF-8'); ?></td>
<td><?php echo htmlspecialchars($playlist->description, ENT_QUOTES, 'UTF-8'); ?></td>
<td>
<a href="<?php echo site_url('playlists/view/' . $playlist->id); ?>" class="btn btn-info">Voir</a>
</td>
2024-05-25 15:44:57 +02:00
</tr>
<?php endforeach; ?>
<?php else : ?>
<tr>
<td colspan="3">Aucune playlist publique trouvée.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>