Ajout des playlists
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
<a href="<?php echo site_url('albums'); ?>" class="btn-albums">Albums</a>
|
||||
<a href="<?php echo site_url('artiste/list_artists'); ?>" class="btn-artistes">Artistes</a>
|
||||
<a href="<?php echo site_url('musiques'); ?>" class="btn-musiques">Musiques</a>
|
||||
<a href="#PlaylistBIENTOT" class="btn-playlist">Mes Playlists</a>
|
||||
<a href="<?php echo site_url('playlists'); ?>" class="btn-playlist">Mes Playlists</a>
|
||||
<a href="<?php echo site_url('utilisateur/dashboard'); ?>" class="btn-MonCompte">Mon compte</a>
|
||||
<a href="<?php echo site_url('utilisateur/deconnexion'); ?>" class="btn-deconnexion">Déconnexion</a>
|
||||
</div>
|
||||
|
24
CodeIgniter-3.1.13/application/views/playlist_add_album.php
Normal file
24
CodeIgniter-3.1.13/application/views/playlist_add_album.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Ajouter un Album à la Playlist</title>
|
||||
<link rel="stylesheet" href="<?php echo base_url('assets/css/style.css'); ?>">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Ajouter un Album à la Playlist</h1>
|
||||
<?php echo form_open('playlists/add_album/'.$playlist_id); ?>
|
||||
<div class="form-group">
|
||||
<label for="album_id">Sélectionner un Album :</label>
|
||||
<select name="album_id" class="form-control" required>
|
||||
<?php foreach ($albums as $album): ?>
|
||||
<option value="<?php echo $album->id; ?>"><?php echo $album->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Ajouter</button>
|
||||
<?php echo form_close(); ?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
24
CodeIgniter-3.1.13/application/views/playlist_add_song.php
Normal file
24
CodeIgniter-3.1.13/application/views/playlist_add_song.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Ajouter une Chanson à la Playlist</title>
|
||||
<link rel="stylesheet" href="<?php echo base_url('assets/css/playlist_add_song'); ?>">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Ajouter une Chanson à la Playlist</h1>
|
||||
<?php echo form_open('playlists/add_song/'.$playlist_id); ?>
|
||||
<div class="form-group">
|
||||
<label for="song_id">Sélectionner une Chanson :</label>
|
||||
<select name="song_id" class="form-control" required>
|
||||
<?php foreach ($songs as $song): ?>
|
||||
<option value="<?php echo $song->id; ?>"><?php echo $song->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Ajouter</button>
|
||||
<?php echo form_close(); ?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
24
CodeIgniter-3.1.13/application/views/playlist_create.php
Normal file
24
CodeIgniter-3.1.13/application/views/playlist_create.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Créer une Nouvelle Playlist</title>
|
||||
<link rel="stylesheet" href="<?php echo base_url('assets/css/playlist_create'); ?>">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Créer une Nouvelle Playlist</h1>
|
||||
<?php echo form_open('playlists/create'); ?>
|
||||
<div class="form-group">
|
||||
<label for="name">Nom de la Playlist :</label>
|
||||
<input type="text" name="name" class="form-control" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="description">Description :</label>
|
||||
<textarea name="description" class="form-control" rows="4" required></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Créer</button>
|
||||
<?php echo form_close(); ?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
54
CodeIgniter-3.1.13/application/views/playlist_view.php
Normal file
54
CodeIgniter-3.1.13/application/views/playlist_view.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Détails de la Playlist</title>
|
||||
<link rel="stylesheet" href="<?php echo base_url('assets/css/playlist_view.css'); ?>">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<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>
|
||||
<tr>
|
||||
<th>Titre</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (!empty($songs)) : ?>
|
||||
<?php foreach ($songs as $song) : ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($song->name, ENT_QUOTES, 'UTF-8'); ?></td>
|
||||
<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>
|
||||
<td colspan="2">Aucune chanson trouvée dans cette playlist.</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</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>
|
||||
<a href="<?php echo site_url('playlists'); ?>" class="btn btn-secondary">Retour à la Liste des Playlists</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
43
CodeIgniter-3.1.13/application/views/playlists_list.php
Normal file
43
CodeIgniter-3.1.13/application/views/playlists_list.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Liste des Playlists</title>
|
||||
<link rel="stylesheet" href="<?php echo base_url('assets/css/playlists_list'); ?>">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Liste des Playlists</h1>
|
||||
<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>
|
||||
<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">Dupliquer</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else : ?>
|
||||
<tr>
|
||||
<td colspan="3">Aucune playlist trouvée.</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user