duplication playlist
This commit is contained in:
25
CodeIgniter-3.1.13/application/views/addAlbumtoplaylist.php
Normal file
25
CodeIgniter-3.1.13/application/views/addAlbumtoplaylist.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<title>Ajouter un album à une playlist</title>
|
||||
|
||||
<div class="trie">
|
||||
<h5>Playlists</h5>
|
||||
</div>
|
||||
|
||||
<section class="list">
|
||||
|
||||
<form method="post">
|
||||
<?php foreach ($playlists as $playlist): ?>
|
||||
<div class="playlist-option">
|
||||
<label>
|
||||
<input type="radio" name="playlist_id" value="<?= $playlist->playlistid ?>">
|
||||
<?= $playlist->name ?>
|
||||
</label>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<div class="submit-button">
|
||||
<button type="submit" class="btn btn-primary">Ajouter à la playlist</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<title>Ajouter toutes les musique d'un artiste à une playlist</title>
|
||||
|
||||
<div class="trie">
|
||||
<h5>Playlists</h5>
|
||||
</div>
|
||||
|
||||
<section class="list">
|
||||
|
||||
<form method="post">
|
||||
<?php foreach ($playlists as $playlist): ?>
|
||||
<div class="playlist-option">
|
||||
<label>
|
||||
<input type="radio" name="playlist_id" value="<?= $playlist->playlistid ?>">
|
||||
<?= $playlist->name ?>
|
||||
</label>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<div class="submit-button">
|
||||
<button type="submit" class="btn btn-primary">Ajouter à la playlist</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -10,8 +10,10 @@
|
||||
<?php foreach ($playlists as $playlist): ?>
|
||||
<div class="playlist-option">
|
||||
<label>
|
||||
<?php if($this->model_music->SongInPlaylist($id) == false){ ?>
|
||||
<input type="radio" name="playlist_id" value="<?= $playlist->playlistid ?>">
|
||||
<?= $playlist->name ?>
|
||||
<?php } ?>
|
||||
</label>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
<style>
|
||||
.filter-options {
|
||||
display: none;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.filter-buttons {
|
||||
display: none;
|
||||
}
|
||||
.filter-buttons.show {
|
||||
display: inline-block;
|
||||
}
|
||||
.filter-checkboxes {
|
||||
display: none;
|
||||
}
|
||||
.filter-checkboxes.show {
|
||||
display: block;
|
||||
}
|
||||
.sort-buttons {
|
||||
display: none;
|
||||
}
|
||||
.show-buttons .sort-buttons {
|
||||
display: block; / Afficher les boutons de tri lorsque la classe show-buttons est appliquée */
|
||||
}
|
||||
</style>
|
||||
.filter-options {
|
||||
display: none;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.filter-buttons {
|
||||
display: none;
|
||||
}
|
||||
.filter-buttons.show {
|
||||
display: inline-block;
|
||||
}
|
||||
.filter-checkboxes {
|
||||
display: none;
|
||||
}
|
||||
.filter-checkboxes.show {
|
||||
display: block;
|
||||
}
|
||||
.sort-buttons {
|
||||
display: none;
|
||||
}
|
||||
.show-buttons .sort-buttons {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
var filterOptionsVisible = false;
|
||||
|
||||
@@ -133,13 +133,22 @@ if($page[count($page)-2] != 'viewAlbum'){ ?>
|
||||
<h5>Albums list</h5>
|
||||
<section class="list">
|
||||
<?php
|
||||
|
||||
$page = preg_split('/[\/]/',$_SERVER['REQUEST_URI']);
|
||||
$long_page = count($page)-1;
|
||||
$url = $page[$long_page];
|
||||
while ($page[$long_page] != 'albums'){
|
||||
$long_page = $long_page - 1;
|
||||
$url = $page[$long_page] . '/' . $url;
|
||||
}
|
||||
|
||||
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>";
|
||||
|
||||
@@ -6,6 +6,15 @@
|
||||
?>
|
||||
<br>
|
||||
<br>
|
||||
<?php
|
||||
$page = preg_split('/[\/]/',$_SERVER['REQUEST_URI']);
|
||||
$long_page = count($page)-1;
|
||||
$url = $page[$long_page];
|
||||
while ($page[$long_page] != 'albums'){
|
||||
$long_page = $long_page - 1;
|
||||
$url = $page[$long_page];
|
||||
}
|
||||
?>
|
||||
<h4><?php echo $albums->name; ?></h4>
|
||||
|
||||
<h8> <?php echo " - Artiste : " . $albums->artist->name; ?></h8>
|
||||
@@ -44,12 +53,12 @@
|
||||
if ($this->session->userdata('logged_in')){
|
||||
if($this->model_music->SongInPlaylist($albums->tracks[$index]->trackId)){
|
||||
echo "<td>";
|
||||
echo anchor("chansons/deleteSongtoPlaylist/{$albums->tracks[$index]->trackId}","<i class='fa-solid fa-trash'></i>");
|
||||
echo anchor("chansons/deleteSongtoPlaylist/{$albums->tracks[$index]->trackId}?page={$url}","<i class='fa fa-trash'></i>");
|
||||
echo "</td>";
|
||||
}
|
||||
}
|
||||
echo "<td>";
|
||||
echo anchor("chansons/addSongtoPlaylist/{$albums->tracks[$index]->trackId}","<i class='fa fa-plus'></i>");
|
||||
echo "</td>";
|
||||
echo anchor("chansons/addSongtoPlaylist/{$albums->tracks[$index]->trackId}?page={$url}","<i class='fa fa-plus'></i>");
|
||||
echo "</td>";
|
||||
}
|
||||
echo "<th></th>";
|
||||
echo "<th></th>";
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
<style>
|
||||
.filter-options {
|
||||
display: none;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.filter-buttons {
|
||||
display: none;
|
||||
}
|
||||
.filter-buttons.show {
|
||||
display: inline-block;
|
||||
}
|
||||
.filter-checkboxes {
|
||||
display: none;
|
||||
}
|
||||
.filter-checkboxes.show {
|
||||
display: block;
|
||||
}
|
||||
.sort-buttons {
|
||||
display: none;
|
||||
}
|
||||
.show-buttons .sort-buttons {
|
||||
display: block; / Afficher les boutons de tri lorsque la classe show-buttons est appliquée */
|
||||
}
|
||||
</style>
|
||||
.filter-options {
|
||||
display: none;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.filter-buttons {
|
||||
display: none;
|
||||
}
|
||||
.filter-buttons.show {
|
||||
display: inline-block;
|
||||
}
|
||||
.filter-checkboxes {
|
||||
display: none;
|
||||
}
|
||||
.filter-checkboxes.show {
|
||||
display: block;
|
||||
}
|
||||
.sort-buttons {
|
||||
display: none;
|
||||
}
|
||||
.show-buttons .sort-buttons {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
var filterOptionsVisible = false;
|
||||
|
||||
@@ -109,6 +109,9 @@ foreach($artistes as $artistes){
|
||||
echo "<div><article>";
|
||||
echo "<header class='short-text'>";
|
||||
echo anchor("albums/viewAlbum/{$artistes->Id}","{$artistes->name}");
|
||||
if($this->session->userdata('logged_in')){
|
||||
echo anchor("artistes/addArtistestoPlaylist/{$artistes->Id}","<i class='fa fa-plus'></i>");
|
||||
}
|
||||
echo "</header>";
|
||||
echo "</article></div>";
|
||||
}
|
||||
|
||||
@@ -1,77 +1,5 @@
|
||||
<style>
|
||||
.filter-options {
|
||||
display: none;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.filter-buttons {
|
||||
display: none;
|
||||
}
|
||||
.filter-buttons.show {
|
||||
display: inline-block;
|
||||
}
|
||||
.filter-checkboxes {
|
||||
display: none;
|
||||
}
|
||||
.filter-checkboxes.show {
|
||||
display: block;
|
||||
}
|
||||
.sort-buttons {
|
||||
display: none;
|
||||
}
|
||||
.show-buttons .sort-buttons {
|
||||
display: block; / Afficher les boutons de tri lorsque la classe show-buttons est appliquée */
|
||||
}
|
||||
</style>
|
||||
<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('chansons/index'); ?>";
|
||||
url += "?sort=" + column + "&order=" + order;
|
||||
window.location.href = url;
|
||||
}
|
||||
</script>
|
||||
<link rel="stylesheet" type="text/css" href="<?= base_url('assets/styles.css'); ?>">
|
||||
<script src="<?= base_url('assets/scripts.js'); ?>"></script>
|
||||
|
||||
<h5>Filter Chansons</h5>
|
||||
<button type="button" onclick="toggleFilterOptions()">Filter</button>
|
||||
@@ -143,15 +71,25 @@
|
||||
<h5>Chansons list</h5>
|
||||
<section class="list">
|
||||
<?php
|
||||
ini_set('memory_limit', '512M');
|
||||
|
||||
$page = preg_split('/[\/]/',$_SERVER['REQUEST_URI']);
|
||||
$long_page = count($page)-1;
|
||||
$url = $page[$long_page];
|
||||
while ($page[$long_page] != 'albums' && $page[$long_page] != 'chansons'){
|
||||
$long_page = $long_page - 1;
|
||||
$url = $page[$long_page];
|
||||
}
|
||||
|
||||
foreach($chansons as $chanson){
|
||||
echo "<div><article>";
|
||||
echo "<header class='short-text'>";
|
||||
echo anchor("chansons/view/{$chanson->id}","{$chanson->name}");
|
||||
if($this->session->userdata('logged_in')){
|
||||
if($this->model_music->SongInPlaylist($chanson->trackId)){
|
||||
echo anchor("chansons/deleteSongtoPlaylist/{$chanson->trackId}","<i class='fa-solid fa-trash'></i>");
|
||||
echo anchor("chansons/deleteSongtoPlaylist/{$chanson->trackId}?page={$url}","<i class='fa fa-trash'></i>");
|
||||
}
|
||||
echo anchor("chansons/addSongtoPlaylist/{$chanson->trackId}","<i class='fa fa-plus'></i>");
|
||||
echo anchor("chansons/addSongtoPlaylist/{$chanson->trackId}?page={$url}","<i class='fa fa-plus'></i>");
|
||||
}
|
||||
echo "</header>";
|
||||
echo "<nav class='short-text'>Nom album: {$chanson->albumName}</nav>";
|
||||
@@ -159,5 +97,9 @@ foreach($chansons as $chanson){
|
||||
echo "<footer class='short-text'>{$chanson->year} - {$chanson->artistName}</footer>
|
||||
</article></div>";
|
||||
}
|
||||
|
||||
echo "<div class='pagination-links'>";
|
||||
echo "<?= $pagination; ?>";
|
||||
echo "</div>";
|
||||
?>
|
||||
</section>
|
||||
@@ -8,6 +8,10 @@ foreach($playlists as $playlist){
|
||||
echo "<div><article>";
|
||||
echo "<header class='short-text'>";
|
||||
echo anchor("chansons/view/{$playlist->playlistid}","{$playlist->name}");
|
||||
if($this->session->userdata('logged_in')){
|
||||
echo anchor("playlist/deletePlaylist/{$playlist->playlistid}","<i class='fa fa-trash'></i>");
|
||||
echo anchor("playlist/duplicatePlaylist/{$playlist->playlistid}","<i class='fa fa-clone'></i>");
|
||||
}
|
||||
echo "</header>";
|
||||
echo "</article></div>";
|
||||
}
|
||||
|
||||
4
CodeIgniter-3.1.13/application/views/toto.php
Normal file
4
CodeIgniter-3.1.13/application/views/toto.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
var_dump($toto);
|
||||
var_dump($id);
|
||||
Reference in New Issue
Block a user