petit espaces
This commit is contained in:
commit
ccfd01ebd7
codeigniter
application
controllers
views
assets
@ -47,6 +47,5 @@ class Artistes extends CI_Controller {
|
|||||||
]);
|
]);
|
||||||
$this->load->view('layout/footer');
|
$this->load->view('layout/footer');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,5 +122,26 @@ public function choix_playlist($albumId) {
|
|||||||
}
|
}
|
||||||
redirect('playlist/view/' . $playlistId);
|
redirect('playlist/view/' . $playlistId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function generate(){
|
||||||
|
$this->load->view('layout/header');
|
||||||
|
$this->load->view('playlist_generate');
|
||||||
|
$this->load->view('layout/footer');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function generate_random(){
|
||||||
|
$numSongs = (int)$this->input->post('numSongs');
|
||||||
|
$playlistName = $this->input->post('playlistName');
|
||||||
|
$userId = $this->session->userdata('user_id');
|
||||||
|
|
||||||
|
if ($numSongs > 0 && !empty($playlistName)) {
|
||||||
|
$playlistId = $this->model_music->generate_random_playlist($numSongs, $playlistName, $userId);
|
||||||
|
redirect('playlist/view/' . $playlistId);
|
||||||
|
} else {
|
||||||
|
echo "Erreur : Veuillez entrer un nombre de chansons valide et un nom de playlist.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<?php if(isset($is_search) && $is_search): ?>
|
<?php if(isset($is_search) && $is_search): ?>
|
||||||
<form action="<?= site_url('Albums'); ?>" method="get" class="back-form">
|
<form action="<?= site_url('Artistes'); ?>" method="get" class="back-form">
|
||||||
<button type="submit" class="back-button">Retour à la liste complète</button>
|
<button type="submit" class="back-button">Retour à la liste complète</button>
|
||||||
</form>
|
</form>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
9
codeigniter/application/views/playlist_generate.php
Normal file
9
codeigniter/application/views/playlist_generate.php
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<h5>Générer une Playlist Aléatoire</h5>
|
||||||
|
|
||||||
|
<form action="<?= site_url('playlist/generate_random'); ?>" method="post" class="generate-playlist-form">
|
||||||
|
<input type="text" name="playlistName" placeholder="Nom de la playlist" required>
|
||||||
|
<input type="number" name="numSongs" placeholder="Nombre de chansons" required>
|
||||||
|
<button type="submit">Générer</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<a href="<?= site_url('playlist'); ?>" class="btn btn-secondary">Retour aux playlists</a>
|
@ -6,6 +6,10 @@
|
|||||||
<button type="submit">Créer</button>
|
<button type="submit">Créer</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<form action="<?= site_url('playlist/generate'); ?>" method="get" class="generate-playlist-form">
|
||||||
|
<button type="submit">Générer une Playlist</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
<!-- Affichez les playlist que nous avons -->
|
<!-- Affichez les playlist que nous avons -->
|
||||||
<section class="playlists">
|
<section class="playlists">
|
||||||
<?php foreach($playlists as $playlist): ?>
|
<?php foreach($playlists as $playlist): ?>
|
||||||
@ -15,7 +19,7 @@
|
|||||||
<?= anchor("playlist/view/{$playlist->id}", "{$playlist->name}"); ?>
|
<?= anchor("playlist/view/{$playlist->id}", "{$playlist->name}"); ?>
|
||||||
</header>
|
</header>
|
||||||
<!-- Bouton pour supprimer la playlist -->
|
<!-- Bouton pour supprimer la playlist -->
|
||||||
<form action="<?= site_url('playlist/delete/' . $playlist->id); ?>" method="post" style="display:inline;">
|
<form action="<?= site_url('playlist/delete/' . $playlist->id); ?>" method="post" class="btn-supp" style="display:inline;">
|
||||||
<button type="submit">Supprimer</button>
|
<button type="submit">Supprimer</button>
|
||||||
</form>
|
</form>
|
||||||
</article>
|
</article>
|
||||||
|
@ -7,34 +7,13 @@
|
|||||||
<button type="submit">Rechercher et Ajouter</button>
|
<button type="submit">Rechercher et Ajouter</button>
|
||||||
</form>
|
</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 -->
|
<!-- Section pour afficher les chansons de son playlist -->
|
||||||
<?php if (!empty($songs)): ?>
|
<?php if (!empty($songs)): ?>
|
||||||
<section class="current-songs">
|
<section class="current-songs">
|
||||||
<h5>Chansons actuelles :</h5>
|
<h5>Chansons actuelles :</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach($songs as $song): ?>
|
<?php foreach($songs as $song): ?>
|
||||||
<li>
|
<li class="play">
|
||||||
<?= $song->name; ?>
|
<?= $song->name; ?>
|
||||||
<!-- Formulaire pour supprimer la chanson de la playlist -->
|
<!-- Formulaire pour supprimer la chanson de la playlist -->
|
||||||
<form action="<?= site_url('playlist/remove_song'); ?>" method="post" style="display:inline;">
|
<form action="<?= site_url('playlist/remove_song'); ?>" method="post" style="display:inline;">
|
||||||
|
@ -18,7 +18,7 @@ section.list img {
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 200px 5px auto;
|
grid-template-columns: 200px 5px auto;
|
||||||
grid-template-rows: auto;
|
grid-template-rows: auto auto;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,8 +210,36 @@ form.search-form {
|
|||||||
margin-left: -200px;
|
margin-left: -200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
form.create-playlist-form {
|
||||||
|
width: 40%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
form.add-song-form {
|
||||||
|
width: 40%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
form.generate-playlist-form {
|
||||||
|
width: 40%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.playlists {
|
||||||
|
display: flex;
|
||||||
|
justify-content: left;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 100px;
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-supp {
|
||||||
|
width: 30%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn.btn-secondary {
|
||||||
|
margin-left: 50px;
|
||||||
|
}
|
||||||
/* bouton ajouter sur les albums et musique */
|
/* bouton ajouter sur les albums et musique */
|
||||||
|
|
||||||
.ajout {
|
.ajout {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user