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

71 lines
3.3 KiB
PHP
Raw Normal View History

2024-05-25 15:44:57 +02:00
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
2024-05-27 22:40:16 +02:00
<title>Détails de la Playlist - Onzeur</title>
2024-05-25 19:13:36 +02:00
<link rel="stylesheet" href="<?php echo base_url('assets/css/playlist_view.css'); ?>">
2024-05-25 15:44:57 +02:00
</head>
<body>
<div class="container">
2024-05-25 19:13:36 +02:00
<!-- Messages Flash -->
<?php if($this->session->flashdata('success')): ?>
<div class="alert alert-success mt-3">
<?php echo $this->session->flashdata('success'); ?>
</div>
<?php endif; ?>
<?php if($this->session->flashdata('error')): ?>
<div class="alert alert-danger mt-3">
<?php echo $this->session->flashdata('error'); ?>
</div>
<?php endif; ?>
2024-05-25 15:44:57 +02:00
<h1><?php echo htmlspecialchars($playlist->name, ENT_QUOTES, 'UTF-8'); ?></h1>
<form action="<?php echo site_url('playlists/update/' . $playlist->id); ?>" method="post">
<div class="form-group">
<label for="name">Nom de la Playlist:</label>
<input type="text" name="name" value="<?php echo htmlspecialchars($playlist->name, ENT_QUOTES, 'UTF-8'); ?>" class="form-control" required>
</div>
<div class="form-group">
<label for="description">Description de la Playlist:</label>
<textarea name="description" class="form-control" required><?php echo htmlspecialchars($playlist->description, ENT_QUOTES, 'UTF-8'); ?></textarea>
</div>
<button type="submit" class="btn btn-primary">Enregistrer</button>
</form>
<h2>Chansons</h2>
<table class="table">
<thead>
2024-05-27 22:40:16 +02:00
<tr>
<th>Titre</th>
<th>Artiste</th>
<th>Actions</th>
</tr>
2024-05-25 15:44:57 +02:00
<tbody>
<?php if (!empty($songs)) : ?>
<?php foreach ($songs as $song) : ?>
<tr>
<td><?php echo htmlspecialchars($song->name, ENT_QUOTES, 'UTF-8'); ?></td>
2024-05-27 22:40:16 +02:00
<td><?php echo htmlspecialchars($song->artist_name, ENT_QUOTES, 'UTF-8'); ?></td> <!-- Affichage du nom de l'artiste -->
2024-05-25 15:44:57 +02:00
<td>
<a href="<?php echo site_url('playlists/remove_song/' . $playlist->id . '/' . $song->id); ?>" class="btn btn-danger" onclick="return confirm('Êtes-vous sûr de vouloir supprimer cette chanson de la playlist ?');">Supprimer</a>
</td>
</tr>
<?php endforeach; ?>
<?php else : ?>
<tr>
2024-05-27 22:40:16 +02:00
<td colspan="3">Aucune chanson trouvée dans cette playlist.</td>
2024-05-25 15:44:57 +02:00
</tr>
<?php endif; ?>
</tbody>
2024-05-27 22:40:16 +02:00
2024-05-25 15:44:57 +02:00
</table>
<a href="<?php echo site_url('playlists/add_song/' . $playlist->id); ?>" class="btn btn-primary">Ajouter une musique</a>
<a href="<?php echo site_url('playlists/add_album/' . $playlist->id); ?>" class="btn btn-primary">Ajouter un album</a>
2024-05-25 19:13:36 +02:00
<a href="<?php echo site_url('playlists/add_artist/' . $playlist->id); ?>" class="btn btn-primary">Ajouter les musiques d'un artiste</a>
2024-05-25 16:18:50 +02:00
<a href="<?php echo site_url('playlists'); ?>" class="btn btn-secondary">Retour</a>
2024-05-25 15:44:57 +02:00
</div>
</body>
</html>