validateur validé
This commit is contained in:
@@ -68,7 +68,7 @@ class Albums extends CI_Controller {
|
|||||||
$playlistId = $this->input->post('playlist_id');
|
$playlistId = $this->input->post('playlist_id');
|
||||||
$page = $this->input->get('page');
|
$page = $this->input->get('page');
|
||||||
$this->model_music->AddAlbumtoPlaylist($playlistId,$id);
|
$this->model_music->AddAlbumtoPlaylist($playlistId,$id);
|
||||||
redirect($page);
|
redirect(echo $page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class Chansons extends CI_Controller {
|
|||||||
|
|
||||||
if ($this->form_validation->run() == FALSE){
|
if ($this->form_validation->run() == FALSE){
|
||||||
$this->load->view('layout/header');
|
$this->load->view('layout/header');
|
||||||
$this->load->view('addSongtoplaylist', ["playlists" => $playlists]);
|
$this->load->view('addSongtoplaylist', ["id" => $id, "playlists" => $playlists]);
|
||||||
$this->load->view('layout/footer');
|
$this->load->view('layout/footer');
|
||||||
}else{
|
}else{
|
||||||
$playlistId = $this->input->post('playlist_id');
|
$playlistId = $this->input->post('playlist_id');
|
||||||
@@ -62,7 +62,7 @@ class Chansons extends CI_Controller {
|
|||||||
|
|
||||||
if ($this->form_validation->run() == FALSE){
|
if ($this->form_validation->run() == FALSE){
|
||||||
$this->load->view('layout/header');
|
$this->load->view('layout/header');
|
||||||
$this->load->view('deleteSongtoplaylist', ["playlists" => $playlists]);
|
$this->load->view('deleteSongtoplaylist', ["id" => $id, "playlists" => $playlists]);
|
||||||
$this->load->view('layout/footer');
|
$this->load->view('layout/footer');
|
||||||
}else{
|
}else{
|
||||||
$playlistId = $this->input->post('playlist_id');
|
$playlistId = $this->input->post('playlist_id');
|
||||||
|
|||||||
@@ -118,7 +118,8 @@ class Model_music extends CI_Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function get_filtered_sorted_chansons($genres = [], $artists = [], $years = [], $albums = [], $sort_column = 'id', $sort_order = 'asc', $limit = 100, $offset = 0) {
|
public function get_filtered_sorted_chansons($genres = [], $artists = [], $years = [], $albums = [], $sort_column = 'id', $sort_order = 'asc', $limit = 100, $offset = 0) {
|
||||||
$this->db->select('track.id as trackId, song.name,song.id,album.year,album.name as albumName, artist.name as artistName, genre.name as genreName');
|
$this->db->distinct('song.id');
|
||||||
|
$this->db->select('track.id as trackId, song.name,album.year,album.name as albumName, artist.name as artistName, genre.name as genreName');
|
||||||
$this->db->from('song');
|
$this->db->from('song');
|
||||||
$this->db->join('track', 'track.songId = song.id');
|
$this->db->join('track', 'track.songId = song.id');
|
||||||
$this->db->join('album', 'album.id = track.albumId');
|
$this->db->join('album', 'album.id = track.albumId');
|
||||||
@@ -400,7 +401,52 @@ class Model_music extends CI_Model {
|
|||||||
if ($result->num_rows() > 0) {
|
if ($result->num_rows() > 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return $query = false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SongInThisPlaylist($idtrack,$idplaylist){
|
||||||
|
if (!is_array($idtrack)) {
|
||||||
|
$idtrack = array($idtrack);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Étape 1: Récupérer l'ID de la chanson à partir de l'un des IDs de piste fournis
|
||||||
|
$this->db->select('song.id as songId');
|
||||||
|
$this->db->from('track');
|
||||||
|
$this->db->join('song', 'song.id = track.songId');
|
||||||
|
$this->db->where_in('track.id', $idtrack);
|
||||||
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
// Vérifier si des résultats ont été trouvés
|
||||||
|
if ($query->num_rows() == 0) {
|
||||||
|
return false; // Si aucun résultat trouvé, retourner false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Récupérer le premier songId correspondant
|
||||||
|
$result = $query->row();
|
||||||
|
$songId = $result->songId;
|
||||||
|
|
||||||
|
// Étape 2: Récupérer tous les IDs de pistes associés à cette chanson
|
||||||
|
$this->db->select('track.id as trackId');
|
||||||
|
$this->db->from('track');
|
||||||
|
$this->db->where('track.songId', $songId);
|
||||||
|
$query = $this->db->get();
|
||||||
|
$trackIds = array();
|
||||||
|
foreach ($query->result() as $track) {
|
||||||
|
$trackIds[] = $track->trackId;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Étape 3: Vérifier si l'une des pistes de cette chanson est dans la playlist
|
||||||
|
$this->db->select('PlaylistSong.trackid as trackId');
|
||||||
|
$this->db->from('PlaylistSong');
|
||||||
|
$this->db->where_in('PlaylistSong.trackid', $trackIds);
|
||||||
|
$this->db->where('PlaylistSong.playlistId',$idplaylist);
|
||||||
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
// Si on trouve au moins une piste de cette chanson dans la playlist, retourner true
|
||||||
|
if ($query->num_rows() > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function TrackidSonginPlaylist($id) {
|
public function TrackidSonginPlaylist($id) {
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
<title>Ajouter un album à une playlist</title>
|
<h6>Ajouter un album à une playlist</h6>
|
||||||
|
|
||||||
|
|
||||||
<div class="trie">
|
<div class="trie">
|
||||||
<h5>Playlists</h5>
|
<h5>Playlists</h5>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section class="list">
|
<section class="list">
|
||||||
|
<form method="post" action="your_form_action_url.php">
|
||||||
<form method="post">
|
|
||||||
<?php foreach ($playlists as $playlist): ?>
|
<?php foreach ($playlists as $playlist): ?>
|
||||||
<div class="playlist-option">
|
<div class="playlist-option">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="playlist_id" value="<?= $playlist->playlistid ?>">
|
<input type="radio" name="playlist_id" value="<?=$playlist->playlistid ?>">
|
||||||
<?= $playlist->name ?>
|
<?= $playlist->name ?>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -21,5 +21,3 @@
|
|||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
<title>Ajouter toutes les musique d'un artiste à une playlist</title>
|
<h6>Ajouter toutes les musique d'un artiste à une playlist</h6>
|
||||||
|
|
||||||
<div class="trie">
|
<div class="trie">
|
||||||
<h5>Playlists</h5>
|
<h5>Playlists</h5>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section class="list">
|
<section class="list">
|
||||||
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<?php foreach ($playlists as $playlist): ?>
|
<?php foreach ($playlists as $playlist): ?>
|
||||||
<div class="playlist-option">
|
<div class="playlist-option">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="playlist_id" value="<?= $playlist->playlistid ?>">
|
<input type="radio" name="playlist_id" value="<?=$playlist->playlistid ?>">
|
||||||
<?= $playlist->name ?>
|
<?= $playlist->name ?>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -20,6 +19,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<title>Ajouter une chanson à une playlist</title>
|
<h6>Ajouter une chanson à une playlist</h6>
|
||||||
|
|
||||||
<div class="trie">
|
<div class="trie">
|
||||||
<h5>Playlists</h5>
|
<h5>Playlists</h5>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<?php foreach ($playlists as $playlist): ?>
|
<?php foreach ($playlists as $playlist): ?>
|
||||||
<div class="playlist-option">
|
<div class="playlist-option">
|
||||||
<label>
|
<label>
|
||||||
<?php if($this->model_music->SongInPlaylist($id) == false){ ?>
|
<?php if($this->model_music->SongInThisPlaylist($id,$playlist->playlistid) == false){ ?>
|
||||||
<input type="radio" name="playlist_id" value="<?= $playlist->playlistid ?>">
|
<input type="radio" name="playlist_id" value="<?= $playlist->playlistid ?>">
|
||||||
<?= $playlist->name ?>
|
<?= $playlist->name ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@@ -23,5 +23,3 @@
|
|||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
$page = preg_split('/[\/]/', $_SERVER['REQUEST_URI']);
|
||||||
|
if ($page[count($page)-2] != 'viewAlbum'): ?>
|
||||||
|
<h5>Filter Albums</h5>
|
||||||
|
<button type="button" onclick="toggleFilterOptions()">Filter</button>
|
||||||
|
|
||||||
|
<div id="filter-options" class="filter-options">
|
||||||
<?php $page = preg_split('/[\/]/',$_SERVER['REQUEST_URI']);
|
|
||||||
if($page[count($page)-2] != 'viewAlbum'){ ?>
|
|
||||||
<h5>Filter Albums</h5>
|
|
||||||
<button type="button" onclick="toggleFilterOptions()">Filter</button>
|
|
||||||
|
|
||||||
<div id="filter-options" class="filter-options">
|
|
||||||
<form method="get">
|
<form method="get">
|
||||||
<div id="filter-buttons" class="filter-buttons">
|
<div id="filter-buttons" class="filter-buttons">
|
||||||
<button type="button" onclick="toggleCheckboxes('genre')">Genres</button>
|
<button type="button" onclick="toggleCheckboxes('genre')">Genres</button>
|
||||||
@@ -42,11 +41,11 @@ if($page[count($page)-2] != 'viewAlbum'){ ?>
|
|||||||
|
|
||||||
<button type="submit">Apply Filters</button>
|
<button type="submit">Apply Filters</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h5>Sort Albums</h5>
|
<h5>Sort Albums</h5>
|
||||||
<button type="button" onclick="toggleSortButtons()">Sort</button>
|
<button type="button" onclick="toggleSortButtons()">Sort</button>
|
||||||
<div id="sort-buttons" class="sort-buttons">
|
<div id="sort-buttons" class="sort-buttons">
|
||||||
<button onclick="sortAlbums('year', 'asc')">Sort by Year Asc</button>
|
<button onclick="sortAlbums('year', 'asc')">Sort by Year Asc</button>
|
||||||
<button onclick="sortAlbums('year', 'desc')">Sort by Year Desc</button>
|
<button onclick="sortAlbums('year', 'desc')">Sort by Year Desc</button>
|
||||||
<button onclick="sortAlbums('artistName', 'asc')">Sort by Artist Asc</button>
|
<button onclick="sortAlbums('artistName', 'asc')">Sort by Artist Asc</button>
|
||||||
@@ -55,37 +54,35 @@ if($page[count($page)-2] != 'viewAlbum'){ ?>
|
|||||||
<button onclick="sortAlbums('name', 'desc')">Sort by Album Name Desc</button>
|
<button onclick="sortAlbums('name', 'desc')">Sort by Album Name Desc</button>
|
||||||
<button onclick="sortAlbums('genreName', 'asc')">Sort by Genre Asc</button>
|
<button onclick="sortAlbums('genreName', 'asc')">Sort by Genre Asc</button>
|
||||||
<button onclick="sortAlbums('genreName', 'desc')">Sort by Genre Desc</button>
|
<button onclick="sortAlbums('genreName', 'desc')">Sort by Genre Desc</button>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<h5>Albums list</h5>
|
<h5>Albums list</h5>
|
||||||
<section class="list">
|
<section class="list">
|
||||||
<?php
|
<?php
|
||||||
$page = preg_split('/[\/]/', $_SERVER['REQUEST_URI']);
|
$page = preg_split('/[\/]/',$_SERVER['REQUEST_URI']);
|
||||||
$long_page = count($page) - 1;
|
$long_page = count($page)-1;
|
||||||
$valid_segments = ['albums', 'chansons'];
|
$url = $page[$long_page];
|
||||||
$url = '';
|
while ($page[$long_page] != 'albums'){
|
||||||
|
$long_page = $long_page - 1;
|
||||||
for ($i = $long_page; $i >= 0; $i--) {
|
$url = $page[$long_page].'/'.$url;
|
||||||
if (in_array($page[$i], $valid_segments)) {
|
|
||||||
$url = implode('/', array_slice($page, $i));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
print_r($url);
|
||||||
|
|
||||||
foreach($albums as $album){
|
foreach ($albums as $album):
|
||||||
|
|
||||||
echo "<div><article>";
|
|
||||||
echo "<header class='short-text'>";
|
|
||||||
echo anchor("albums/viewMusique/{$album->albumId}","{$album->name}");
|
|
||||||
if($this->session->userdata('logged_in')){
|
|
||||||
echo anchor("albums/addAlbumtoPlaylist/{$album->albumId}?page={$url}","<i class='fa fa-plus'></i>");
|
|
||||||
}
|
|
||||||
echo "</header>";
|
|
||||||
echo '<img src="data:image/jpeg;base64,'.base64_encode($album->jpeg).'" />';
|
|
||||||
echo "<nav class='short-text'>Genre: {$album->genreName}</nav>";
|
|
||||||
echo "<footer class='short-text'>{$album->year} - {$album->artistName}</footer>
|
|
||||||
</article></div>";
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
<div>
|
||||||
|
<article>
|
||||||
|
<header class="short-text">
|
||||||
|
<?= anchor("albums/viewMusique/{$album->albumId}", $album->name); ?>
|
||||||
|
<?php if ($this->session->userdata('logged_in')): ?>
|
||||||
|
<?= anchor("albums/addAlbumtoPlaylist/{$album->albumId}?page={$url}", "<i class='fa fa-plus'></i>"); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</header>
|
||||||
|
<img src="data:image/jpeg;base64,<?= base64_encode($album->jpeg); ?>" alt="cover de l'album" />
|
||||||
|
<nav class="short-text">Genre: <?= $album->genreName; ?></nav>
|
||||||
|
<footer class="short-text"><?= $album->year; ?> - <?= $album->artistName; ?></footer>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -4,46 +4,50 @@
|
|||||||
$url = $page[$long_page];
|
$url = $page[$long_page];
|
||||||
while ($page[$long_page] != 'albums'){
|
while ($page[$long_page] != 'albums'){
|
||||||
$long_page = $long_page - 1;
|
$long_page = $long_page - 1;
|
||||||
$url = $page[$long_page];
|
$url = $page[$long_page].'/'.$url;
|
||||||
}
|
}
|
||||||
|
print_r($url);
|
||||||
?>
|
?>
|
||||||
<section class="album-details">
|
<section class="album-details">
|
||||||
<div class="album-content">
|
<div class="album-content">
|
||||||
<div class="album-image">
|
<div class="album-image">
|
||||||
<?php
|
<?php
|
||||||
echo '<img src="data:image/jpeg;base64,' . base64_encode($albums->coverImage) . '" style="width: 300px; height: 300px;" />';
|
echo '<img src="data:image/jpeg;base64,' . base64_encode($albums->coverImage) . '" style="width: 300px; height: 300px;" alt="Album cover"/>';
|
||||||
?>
|
?>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<h4><?php echo $albums->name; ?></h4>
|
<h4><?php echo $albums->name; ?></h4>
|
||||||
<h8><?php echo " - Artiste : " . $albums->artist->name; ?></h8>
|
<p><?php echo "Artiste : " . $albums->artist->name; ?></p>
|
||||||
<p><?php echo " - Année : " . $albums->year; ?></p>
|
<p><?php echo "Année : " . $albums->year; ?></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="album-songs">
|
<div class="album-songs">
|
||||||
<?php
|
<?php
|
||||||
echo "<table>";
|
echo "<table>";
|
||||||
|
echo "<thead>";
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<th>Titre</th>";
|
echo "<th>Titre</th>";
|
||||||
echo "<th>Durée</th>";
|
echo "<th>Durée</th>";
|
||||||
echo "<th>Action</th>";
|
echo "<th>Action</th>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
|
echo "</thead>";
|
||||||
|
echo "<tbody>";
|
||||||
foreach ($albums->songs as $index => $song) {
|
foreach ($albums->songs as $index => $song) {
|
||||||
$artistName = $albums->artist->name;
|
$artistName = $albums->artist->name;
|
||||||
$duration = isset($albums->tracks[$index]->duration) ? convertirSecondesEnMinutes($albums->tracks[$index]->duration) : '';
|
$duration = isset($albums->tracks[$index]->duration) ? convertirSecondesEnMinutes($albums->tracks[$index]->duration) : '';
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<td>{$song}</td>";
|
echo "<td>" . $song . "</td>";
|
||||||
echo "<td>{$duration}</td>";
|
echo "<td>" . $duration . "</td>";
|
||||||
echo "<td>";
|
echo "<td>";
|
||||||
if ($this->session->userdata('logged_in')){
|
if ($this->session->userdata('logged_in')){
|
||||||
if($this->model_music->SongInPlaylist($albums->tracks[$index]->trackId)){
|
if($this->model_music->SongInPlaylist($albums->tracks[$index]->trackId)){
|
||||||
echo anchor("chansons/deleteSongtoPlaylist/{$albums->tracks[$index]->trackId}","<i class='fa fa-trash'></i>");
|
echo anchor("chansons/deleteSongtoPlaylist/{$albums->tracks[$index]->trackId}", "<i class='fa fa-trash'></i>", ['title' => 'Supprimer de la playlist']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo anchor("chansons/addSongtoPlaylist/{$albums->tracks[$index]->trackId}","<i class='fa fa-plus'></i>");
|
echo anchor("chansons/addSongtoPlaylist/{$albums->tracks[$index]->trackId}", "<i class='fa fa-plus'></i>", ['title' => 'Ajouter à la playlist']);
|
||||||
//echo "<a href='" . site_url('albums/select_playlist?track_id=' . $albums->tracks[$index]->trackId) . "' class='btn-plus'>+</a>";
|
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
}
|
}
|
||||||
|
echo "</tbody>";
|
||||||
echo "</table>";
|
echo "</table>";
|
||||||
|
|
||||||
function convertirSecondesEnMinutes($secondes) {
|
function convertirSecondesEnMinutes($secondes) {
|
||||||
|
|||||||
@@ -1,55 +1,3 @@
|
|||||||
|
|
||||||
<script>
|
|
||||||
var filterOptionsVisible = false;
|
|
||||||
|
|
||||||
function toggleFilterOptions() {
|
|
||||||
var filterOptions = document.getElementById('filter-options');
|
|
||||||
var filterButtons = document.getElementById('filter-buttons');
|
|
||||||
|
|
||||||
if (!filterOptionsVisible) {
|
|
||||||
filterOptions.style.display = 'block';
|
|
||||||
filterButtons.classList.add('show');
|
|
||||||
filterOptionsVisible = true;
|
|
||||||
} else {
|
|
||||||
filterOptions.style.display = 'none';
|
|
||||||
filterButtons.classList.remove('show');
|
|
||||||
hideCheckboxes();
|
|
||||||
filterOptionsVisible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCheckboxes(filterType) {
|
|
||||||
var checkboxes = document.getElementById(filterType + '-checkboxes');
|
|
||||||
if (checkboxes.style.display === 'none' || checkboxes.style.display === '') {
|
|
||||||
checkboxes.style.display = 'block';
|
|
||||||
} else {
|
|
||||||
checkboxes.style.display = 'none';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideCheckboxes() {
|
|
||||||
var checkboxes = document.querySelectorAll('.filter-checkboxes');
|
|
||||||
checkboxes.forEach(function(checkbox) {
|
|
||||||
checkbox.classList.remove('show');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleSortButtons() {
|
|
||||||
var sortButtons = document.getElementById('sort-buttons');
|
|
||||||
if (sortButtons.style.display === 'none' || sortButtons.style.display === '') {
|
|
||||||
sortButtons.style.display = 'block';
|
|
||||||
} else {
|
|
||||||
sortButtons.style.display = 'none';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function sortAlbums(column, order) {
|
|
||||||
var url = "<?= site_url('artistes/index'); ?>";
|
|
||||||
url += "?sort=" + column + "&order=" + order;
|
|
||||||
window.location.href = url;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<h5>Filter Artiste</h5>
|
<h5>Filter Artiste</h5>
|
||||||
<button type="button" onclick="toggleFilterOptions()">Filter</button>
|
<button type="button" onclick="toggleFilterOptions()">Filter</button>
|
||||||
|
|
||||||
@@ -62,8 +10,8 @@
|
|||||||
<div id="genre-checkboxes" style="display:none;">
|
<div id="genre-checkboxes" style="display:none;">
|
||||||
<?php foreach ($genres as $genre): ?>
|
<?php foreach ($genres as $genre): ?>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="genre[]" value="<?= $genre->genreName; ?>">
|
<input type="checkbox" name="genre[]" value="<?= htmlspecialchars($genre->genreName); ?>">
|
||||||
<?= $genre->genreName; ?>
|
<?= htmlspecialchars($genre->genreName); ?>
|
||||||
</label><br>
|
</label><br>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
@@ -75,19 +23,19 @@
|
|||||||
<h5>Sort Artiste</h5>
|
<h5>Sort Artiste</h5>
|
||||||
<button type="button" onclick="toggleSortButtons()">Sort</button>
|
<button type="button" onclick="toggleSortButtons()">Sort</button>
|
||||||
<div id="sort-buttons" class="sort-buttons">
|
<div id="sort-buttons" class="sort-buttons">
|
||||||
<button onclick="sortAlbums('name', 'asc')">Sort by Artist Asc</button>
|
<button type="button" onclick="sortAlbums('name', 'asc')">Sort by Artist Asc</button>
|
||||||
<button onclick="sortAlbums('name', 'desc')">Sort by Artist Desc</button>
|
<button type="button" onclick="sortAlbums('name', 'desc')">Sort by Artist Desc</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h5>Artiste list</h5>
|
<h5>Artiste list</h5>
|
||||||
<section class="list">
|
<section class="list">
|
||||||
<?php
|
<?php
|
||||||
foreach($artistes as $artistes){
|
foreach($artistes as $artiste){
|
||||||
echo "<div><article>";
|
echo "<div><article>";
|
||||||
echo "<header class='short-text'>";
|
echo "<header class='short-text'>";
|
||||||
echo anchor("albums/viewAlbum/{$artistes->Id}","{$artistes->name}");
|
echo anchor("albums/viewAlbum/{$artiste->Id}", $artiste->name);
|
||||||
if($this->session->userdata('logged_in')){
|
if($this->session->userdata('logged_in')){
|
||||||
echo anchor("artistes/addArtistestoPlaylist/{$artistes->Id}","<i class='fa fa-plus'></i>");
|
echo anchor("artistes/addArtistestoPlaylist/{$artiste->Id}", "<i class='fa fa-plus'></i>");
|
||||||
}
|
}
|
||||||
echo "</header>";
|
echo "</header>";
|
||||||
echo "</article></div>";
|
echo "</article></div>";
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="<?= base_url('assets/styles.css'); ?>">
|
|
||||||
<script src="<?= base_url('assets/scripts.js'); ?>"></script>
|
|
||||||
|
|
||||||
<h5>Filter Chansons</h5>
|
<h5>Filter Chansons</h5>
|
||||||
<button type="button" onclick="toggleFilterOptions()">Filter</button>
|
<button type="button" onclick="toggleFilterOptions()">Filter</button>
|
||||||
|
|
||||||
<div id="filter-options" class="filter-options">
|
<div id="filter-options" class="filter-options" style="display:none;">
|
||||||
<form method="get">
|
<form method="get">
|
||||||
<div id="filter-buttons" class="filter-buttons">
|
<div id="filter-buttons" class="filter-buttons">
|
||||||
<button type="button" onclick="toggleCheckboxes('genre')">Genres</button>
|
<button type="button" onclick="toggleCheckboxes('genre')">Genres</button>
|
||||||
@@ -14,39 +11,39 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="genre-checkboxes" style="display:none;">
|
<div id="genre-checkboxes" style="display:none;">
|
||||||
<?php foreach ($genres as $genre): ?>
|
<?php foreach ($genres as $genre){ ?>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="genre[]" value="<?= $genre->genreName; ?>">
|
<input type="checkbox" name="genre[]" value="<?= $genre->genreName; ?>">
|
||||||
<?= $genre->genreName; ?>
|
<?= $genre->genreName; ?>
|
||||||
</label><br>
|
</label><br>
|
||||||
<?php endforeach; ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="artist-checkboxes" style="display:none;">
|
<div id="artist-checkboxes" style="display:none;">
|
||||||
<?php foreach ($artists as $artist): ?>
|
<?php foreach ($artists as $artist){ ?>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="artist[]" value="<?= $artist->artistName; ?>">
|
<input type="checkbox" name="artist[]" value="<?= $artist->artistName; ?>">
|
||||||
<?= $artist->artistName; ?>
|
<?= $artist->artistName; ?>
|
||||||
</label><br>
|
</label><br>
|
||||||
<?php endforeach; ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="year-checkboxes" style="display:none;">
|
<div id="year-checkboxes" style="display:none;">
|
||||||
<?php foreach ($years as $year): ?>
|
<?php foreach ($years as $year){ ?>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="year[]" value="<?= $year->year; ?>">
|
<input type="checkbox" name="year[]" value="<?= $year->year; ?>">
|
||||||
<?= $year->year; ?>
|
<?= $year->year; ?>
|
||||||
</label><br>
|
</label><br>
|
||||||
<?php endforeach; ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="album-checkboxes" style="display:none;">
|
<div id="album-checkboxes" style="display:none;">
|
||||||
<?php foreach ($albums as $album): ?>
|
<?php foreach ($albums as $album){ ?>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="albums[]" value="<?= $album->albumName; ?>">
|
<input type="checkbox" name="albums[]" value="<?= $album->albumName; ?>">
|
||||||
<?= $album->albumName; ?>
|
<?= $album->albumName; ?>
|
||||||
</label><br>
|
</label><br>
|
||||||
<?php endforeach; ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="submit">Apply Filters</button>
|
<button type="submit">Apply Filters</button>
|
||||||
@@ -55,23 +52,37 @@
|
|||||||
|
|
||||||
<h5>Sort Chansons</h5>
|
<h5>Sort Chansons</h5>
|
||||||
<button type="button" onclick="toggleSortButtons()">Sort</button>
|
<button type="button" onclick="toggleSortButtons()">Sort</button>
|
||||||
<div id="sort-buttons" class="sort-buttons">
|
<div id="sort-buttons" class="sort-buttons" style="display:none;">
|
||||||
<button onclick="sortAlbums('year', 'asc')">Sort by Year Asc</button>
|
<button type="button" onclick="sortAlbums('year', 'asc')">Sort by Year Asc</button>
|
||||||
<button onclick="sortAlbums('year', 'desc')">Sort by Year Desc</button>
|
<button type="button" onclick="sortAlbums('year', 'desc')">Sort by Year Desc</button>
|
||||||
<button onclick="sortAlbums('artistName', 'asc')">Sort by Artist Asc</button>
|
<button type="button" onclick="sortAlbums('artistName', 'asc')">Sort by Artist Asc</button>
|
||||||
<button onclick="sortAlbums('artistName', 'desc')">Sort by Artist Desc</button>
|
<button type="button" onclick="sortAlbums('artistName', 'desc')">Sort by Artist Desc</button>
|
||||||
<button onclick="sortAlbums('name', 'asc')">Sort by Chanson Name Asc</button>
|
<button type="button" onclick="sortAlbums('name', 'asc')">Sort by Chanson Name Asc</button>
|
||||||
<button onclick="sortAlbums('name', 'desc')">Sort by Chanson Name Desc</button>
|
<button type="button" onclick="sortAlbums('name', 'desc')">Sort by Chanson Name Desc</button>
|
||||||
<button onclick="sortAlbums('albumName', 'asc')">Sort by Album Name Asc</button>
|
<button type="button" onclick="sortAlbums('albumName', 'asc')">Sort by Album Name Asc</button>
|
||||||
<button onclick="sortAlbums('albumName', 'desc')">Sort by Album Name Desc</button>
|
<button type="button" onclick="sortAlbums('albumName', 'desc')">Sort by Album Name Desc</button>
|
||||||
<button onclick="sortAlbums('genreName', 'asc')">Sort by Genre Asc</button>
|
<button type="button" onclick="sortAlbums('genreName', 'asc')">Sort by Genre Asc</button>
|
||||||
<button onclick="sortAlbums('genreName', 'desc')">Sort by Genre Desc</button>
|
<button type="button" onclick="sortAlbums('genreName', 'desc')">Sort by Genre Desc</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h5>Chansons list</h5>
|
<h5>Chansons list</h5>
|
||||||
<section class="list">
|
<section class="list">
|
||||||
<?php
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Pagination setup
|
||||||
|
$items_per_page = 51; // Number of items to display per page
|
||||||
|
$total_chansons = count($chansons); // Total number of chansons
|
||||||
|
$total_pages = ceil($total_chansons / $items_per_page); // Total number of pages
|
||||||
|
|
||||||
|
// Get current page from URL, default is page 1
|
||||||
|
$current_page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
|
||||||
|
$current_page = max(1, min($total_pages, $current_page)); // Ensure the current page is within valid range
|
||||||
|
|
||||||
|
// Calculate the offset for the SQL query
|
||||||
|
$offset = ($current_page - 1) * $items_per_page;
|
||||||
|
|
||||||
|
// Fetch chansons for the current page
|
||||||
|
$chansons_for_current_page = array_slice($chansons, $offset, $items_per_page);
|
||||||
|
|
||||||
$page = preg_split('/[\/]/', $_SERVER['REQUEST_URI']);
|
$page = preg_split('/[\/]/', $_SERVER['REQUEST_URI']);
|
||||||
$long_page = count($page) - 1;
|
$long_page = count($page) - 1;
|
||||||
@@ -85,22 +96,55 @@ for ($i = $long_page; $i >= 0; $i--) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($chansons as $chanson){
|
foreach($chansons_for_current_page as $chanson): ?>
|
||||||
echo "<div><article>";
|
<div>
|
||||||
echo "<header class='short-text'>";
|
<article>
|
||||||
echo anchor("chansons/view/{$chanson->id}","{$chanson->name}");
|
<header class='short-text'>
|
||||||
if($this->session->userdata('logged_in')){
|
<h6> <?php echo $chanson->name; ?> </h6>
|
||||||
if($this->model_music->SongInPlaylist($chanson->trackId)){
|
<?php if($this->session->userdata('logged_in')): ?>
|
||||||
echo anchor("chansons/deleteSongtoPlaylist/{$chanson->trackId}?page={$url}","<i class='fa fa-trash'></i>");
|
<?php if($this->model_music->SongInPlaylist($chanson->trackId)): ?>
|
||||||
}
|
<?= anchor("chansons/deleteSongtoPlaylist/{$chanson->trackId}?page={$url}", "<i class='fa fa-trash'></i>"); ?>
|
||||||
echo anchor("chansons/addSongtoPlaylist/{$chanson->trackId}?page={$url}","<i class='fa fa-plus'></i>");
|
<?php endif; ?>
|
||||||
}
|
<?= anchor("chansons/addSongtoPlaylist/{$chanson->trackId}?page={$url}", "<i class='fa fa-plus'></i>"); ?>
|
||||||
echo "</header>";
|
<?php endif; ?>
|
||||||
echo "<nav class='short-text'>Nom album: {$chanson->albumName}</nav>";
|
</header>
|
||||||
echo "<nav class='short-text'>Genre: {$chanson->genreName}</nav>";
|
<nav class='short-text'>Nom album: <?= $chanson->albumName; ?></nav>
|
||||||
echo "<footer class='short-text'>{$chanson->year} - {$chanson->artistName}</footer>
|
<nav class='short-text'>Genre: <?= $chanson->genreName; ?></nav>
|
||||||
</article></div>";
|
<footer class='short-text'><?= $chanson->year; ?> - <?= $chanson->artistName; ?></footer>
|
||||||
}
|
</article>
|
||||||
|
</div>
|
||||||
?>
|
<?php endforeach; ?>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Pagination Controls -->
|
||||||
|
<div class="pagination">
|
||||||
|
<?php if ($current_page > 1): ?>
|
||||||
|
<a href="?page=<?= $current_page - 1 ?>">« Previous</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Determine the start and end page numbers
|
||||||
|
$start_page = max(1, $current_page - 2);
|
||||||
|
$end_page = min($total_pages, $current_page + 2);
|
||||||
|
|
||||||
|
// Adjust the start and end page if at the boundaries
|
||||||
|
if ($start_page === 1) {
|
||||||
|
$end_page = min(5, $total_pages);
|
||||||
|
}
|
||||||
|
if ($end_page === $total_pages) {
|
||||||
|
$start_page = max(1, $total_pages - 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
for ($i = $start_page; $i <= $end_page; $i++): ?>
|
||||||
|
<?php if ($i == $current_page): ?>
|
||||||
|
<span><?= $i ?></span>
|
||||||
|
<?php else: ?>
|
||||||
|
<a href="?page=<?= $i ?>"><?= $i ?></a>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endfor; ?>
|
||||||
|
|
||||||
|
<?php if ($current_page < $total_pages): ?>
|
||||||
|
<a href="?page=<?= $current_page + 1 ?>">Next »</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
@@ -1,14 +1,11 @@
|
|||||||
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<!-- Markup example 2: input is after label -->
|
|
||||||
<label for="name">Nom de la playlist</label>
|
<label for="name">Nom de la playlist</label>
|
||||||
<input type="text" id="name" name="name" placeholder="name" required>
|
<input type="text" id="name" name="name" placeholder="name" required>
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<label for="text">Déscription
|
<label for="Description">Déscription
|
||||||
<input type="text" id="Description" name="Description" placeholder="Description" >
|
<input type="text" id="Description" name="Description" placeholder="Description" >
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<!-- Button -->
|
|
||||||
<button type="submit">Submit</button>
|
<button type="submit">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -6,23 +6,23 @@
|
|||||||
<!-- Markup example 1: input is inside label -->
|
<!-- Markup example 1: input is inside label -->
|
||||||
<label for="prenom">
|
<label for="prenom">
|
||||||
Prénom
|
Prénom
|
||||||
<input type="text" id="prenom" name="prenom" placeholder="Prénom" value="<?=set_value('prenom')?>"required>
|
<input type="text" id="prenom" name="prenom" placeholder="Prénom" required>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label for="nom">
|
<label for="nom">
|
||||||
Nom
|
Nom
|
||||||
<input type="text" id="nom" name="nom" placeholder="nom" value="<?=set_value('nom')?>" required>
|
<input type="text" id="nom" name="nom" placeholder="nom" required>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<!-- Markup example 2: input is after label -->
|
<!-- Markup example 2: input is after label -->
|
||||||
<label for="email">Adresse mail</label>
|
<label for="email">Adresse mail</label>
|
||||||
<input type="email" id="email" name="email" placeholder="Email" value="<?=set_value('email')?>" required>
|
<input type="email" id="email" name="email" placeholder="Email" required>
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<label for="password">Password
|
<label for="password">Password
|
||||||
<input type="password" id="password" name="password" placeholder="Password" value="<?=set_value('password')?>" required>
|
<input type="password" id="password" name="password" placeholder="Password" required>
|
||||||
</label>
|
</label>
|
||||||
<label for="password">Confirmation password
|
<label for="cpassword">Confirmation password
|
||||||
<input type="password" id="cpassword" name="cpassword" placeholder="Password" value="<?=set_value('cpassword')?>" required>
|
<input type="password" id="cpassword" name="cpassword" placeholder="Password" required>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<title>Supprimer une chanson à une playlist</title>
|
<h6>Supprimer une chanson à une playlist</h6>
|
||||||
|
|
||||||
<div class="trie">
|
<div class="trie">
|
||||||
<h5>Playlists</h5>
|
<h5>Playlists</h5>
|
||||||
@@ -7,19 +7,18 @@
|
|||||||
<section class="list">
|
<section class="list">
|
||||||
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<?php foreach ($playlists as $playlist): ?>
|
<?php foreach ($playlists as $playlist){ ?>
|
||||||
<div class="playlist-option">
|
<div class="playlist-option">
|
||||||
<label>
|
<label>
|
||||||
|
<?php if($this->model_music->SongInThisPlaylist($id,$playlist->playlistid)){ ?>
|
||||||
<input type="radio" name="playlist_id" value="<?= $playlist->playlistid ?>">
|
<input type="radio" name="playlist_id" value="<?= $playlist->playlistid ?>">
|
||||||
<?= $playlist->name ?>
|
<?= $playlist->name ?>
|
||||||
|
<?php } ?>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php } ?>
|
||||||
<div class="submit-button">
|
<div class="submit-button">
|
||||||
<button type="submit" class="btn btn-primary">Supprimer de la playlist</button>
|
<button type="submit" class="btn btn-primary">Supprimer de la playlist</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,3 +1,2 @@
|
|||||||
</main>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,40 +1,37 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en" class="has-navbar-fixed-top">
|
<html lang="en" class="has-navbar-fixed-top">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8">
|
||||||
<title>MUSIC APP</title>
|
<title>MUSIC APP</title>
|
||||||
<link
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
|
||||||
rel="stylesheet"
|
|
||||||
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||||
<?=link_tag('assets/style.css');?>
|
<?= link_tag('assets/style.css'); ?>
|
||||||
<script type="text/javascript" src="<?= base_url('assets/script.js'); ?>"></script>
|
<script type="text/javascript" src="<?= base_url('assets/script.js'); ?>"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main class='container'>
|
<main class="container">
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li ><strong class= 'apliiiiiii'>Music APP</strong></li>
|
<li><strong class="appli">Music APP</strong></li>
|
||||||
<?php $page = preg_split('/[\/]/',$_SERVER['REQUEST_URI']);
|
</ul>
|
||||||
if($page[count($page)-1]!='auth' && $page[count($page)-1]!='create'){ ?>
|
<?php
|
||||||
<form method='GET'>
|
$page = preg_split('/[\/]/', $_SERVER['REQUEST_URI']);
|
||||||
<input type='text' name='recherche' placeholder='Recherche... '>
|
if ($page[count($page) - 1] != 'auth' && $page[count($page) - 1] != 'create') { ?>
|
||||||
|
<form method="GET">
|
||||||
|
<input type="text" name="recherche" placeholder="Recherche... ">
|
||||||
</form>
|
</form>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><?=anchor('albums','Albums');?></li>
|
<li><?= anchor('albums', 'Albums'); ?></li>
|
||||||
<li><?=anchor('artistes','Artistes');?></li>
|
<li><?= anchor('artistes', 'Artistes'); ?></li>
|
||||||
<li><?=anchor('chansons','Chansons');?></li>
|
<li><?= anchor('chansons', 'Chansons'); ?></li>
|
||||||
<?php if($this->session->userdata('logged_in')){ ?>
|
<?php if ($this->session->userdata('logged_in')) { ?>
|
||||||
<li><?=anchor('playlist','Playlist');?></li>
|
<li><?= anchor('playlist', 'Playlist'); ?></li>
|
||||||
<li name='déconnexion'><?=anchor('user/logout','Déconnexion');?></li>
|
<li class="déconnexion"><?= anchor('user/logout', 'Déconnexion'); ?></li>
|
||||||
<?php }else{ ?>
|
<?php } else { ?>
|
||||||
<li name='connexion'><?=anchor('user/auth','Connexion');?></li>
|
<li class="connexion"><?= anchor('user/auth', 'Connexion'); ?></li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
|||||||
@@ -1,42 +1,13 @@
|
|||||||
|
|
||||||
<style>
|
|
||||||
.filter-buttons {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.filter-buttons.show {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
.filter-checkboxes {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.filter-checkboxes.show {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.show-buttons .sort-buttons {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script>
|
|
||||||
|
|
||||||
function toggleCheckboxes(filterType) {
|
|
||||||
var checkboxes = document.getElementById(filterType + '-checkboxes');
|
|
||||||
if (checkboxes.style.display === 'none' || checkboxes.style.display === '') {
|
|
||||||
checkboxes.style.display = 'block';
|
|
||||||
} else {
|
|
||||||
checkboxes.style.display = 'none';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<h5>Différents critères</h5>
|
<h5>Différents critères</h5>
|
||||||
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<div id="filter-buttons" class="filter-buttons">
|
<div id="filter-buttons-playlist" class="filter-buttons-playlist">
|
||||||
<button type="button" onclick="toggleCheckboxes('genre')">Genres</button>
|
<button type="button" onclick="toggleCheckboxesPlaylist('genre')">Genres</button>
|
||||||
<button type="button" onclick="toggleCheckboxes('artist')">Artists</button>
|
<button type="button" onclick="toggleCheckboxesPlaylist('artist')">Artists</button>
|
||||||
<button type="button" onclick="toggleCheckboxes('year')">Years</button>
|
<button type="button" onclick="toggleCheckboxesPlaylist('year')">Years</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="genre-checkboxes" style="display:none;">
|
<div id="genre-checkboxes-playlist" style="display:none;">
|
||||||
<?php foreach ($genres as $genre): ?>
|
<?php foreach ($genres as $genre): ?>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="genre[]" value="<?= $genre->genreName; ?>">
|
<input type="checkbox" name="genre[]" value="<?= $genre->genreName; ?>">
|
||||||
@@ -45,7 +16,7 @@
|
|||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="artist-checkboxes" style="display:none;">
|
<div id="artist-checkboxes-playlist" style="display:none;">
|
||||||
<?php foreach ($artists as $artist): ?>
|
<?php foreach ($artists as $artist): ?>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="artist[]" value="<?= $artist->artistName; ?>">
|
<input type="checkbox" name="artist[]" value="<?= $artist->artistName; ?>">
|
||||||
@@ -54,7 +25,7 @@
|
|||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="year-checkboxes" style="display:none;">
|
<div id="year-checkboxes-playlist" style="display:none;">
|
||||||
<?php foreach ($years as $year): ?>
|
<?php foreach ($years as $year): ?>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="year[]" value="<?= $year->year; ?>">
|
<input type="checkbox" name="year[]" value="<?= $year->year; ?>">
|
||||||
@@ -67,10 +38,9 @@
|
|||||||
<label for="name">Nom de la playlist</label>
|
<label for="name">Nom de la playlist</label>
|
||||||
<input type="text" id="name" name="name" placeholder="name" required>
|
<input type="text" id="name" name="name" placeholder="name" required>
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<label for="text">Déscription
|
<label for="Description">Déscription
|
||||||
<input type="text" id="Description" name="Description" placeholder="Description" >
|
<input type="text" id="Description" name="Description" placeholder="Description" >
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<!-- Button -->
|
|
||||||
<button type="submit">Submit</button>
|
<button type="submit">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
@@ -47,3 +47,12 @@ function sortAlbums(column, order) {
|
|||||||
url += "?sort=" + column + "&order=" + order;
|
url += "?sort=" + column + "&order=" + order;
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleCheckboxesPlaylist(filterType) {
|
||||||
|
var checkboxes = document.getElementById(filterType + '-checkboxes-playlist');
|
||||||
|
if (checkboxes.style.display === 'none' || checkboxes.style.display === '') {
|
||||||
|
checkboxes.style.display = 'block';
|
||||||
|
} else {
|
||||||
|
checkboxes.style.display = 'none';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@ section.list img {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
color: #2a2a2a;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recherche {
|
.recherche {
|
||||||
@@ -29,6 +30,12 @@ section.list img {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.appli{
|
||||||
|
width : 100px;
|
||||||
|
height : 75px;
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
|
||||||
.apliiiiiii{
|
.apliiiiiii{
|
||||||
width : 75px;
|
width : 75px;
|
||||||
height : 24px;
|
height : 24px;
|
||||||
@@ -39,21 +46,47 @@ section.list img {
|
|||||||
display: none;
|
display: none;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-buttons {
|
.filter-buttons {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-buttons.show {
|
.filter-buttons.show {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-checkboxes {
|
.filter-checkboxes {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-checkboxes.show {
|
.filter-checkboxes.show {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sort-buttons {
|
.sort-buttons {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.show-buttons .sort-buttons {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-buttons-playlist {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-buttons-playlist.show {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-checkboxes-playlist {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-checkboxes-playlist.show {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
.show-buttons .sort-buttons {
|
.show-buttons .sort-buttons {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
@@ -104,7 +137,7 @@ body {
|
|||||||
.album-songs {
|
.album-songs {
|
||||||
flex-grow: 2;
|
flex-grow: 2;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
background-color: #13171;
|
background-color: #13171b;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user