ajout connexion,ajout playlist, ajout chanson dans playlist, ajout filtre et tri pour chanson et album
This commit is contained in:
25
CodeIgniter-3.1.13/application/views/addSongtoplaylist.php
Normal file
25
CodeIgniter-3.1.13/application/views/addSongtoplaylist.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<title>Ajouter une chanson à 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 ?>">
|
||||
<?= htmlspecialchars($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>
|
||||
@@ -1,3 +1,134 @@
|
||||
<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('albums/index'); ?>";
|
||||
url += "?sort=" + column + "&order=" + order;
|
||||
window.location.href = url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<h5>Filter Albums</h5>
|
||||
<button type="button" onclick="toggleFilterOptions()">Filter</button>
|
||||
|
||||
<div id="filter-options" class="filter-options">
|
||||
<form method="get">
|
||||
<div id="filter-buttons" class="filter-buttons">
|
||||
<button type="button" onclick="toggleCheckboxes('genre')">Genres</button>
|
||||
<button type="button" onclick="toggleCheckboxes('artist')">Artists</button>
|
||||
<button type="button" onclick="toggleCheckboxes('year')">Years</button>
|
||||
</div>
|
||||
|
||||
<div id="genre-checkboxes" style="display:none;">
|
||||
<?php foreach ($genres as $genre): ?>
|
||||
<label>
|
||||
<input type="checkbox" name="genre[]" value="<?= $genre->genreName; ?>">
|
||||
<?= $genre->genreName; ?>
|
||||
</label><br>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<div id="artist-checkboxes" style="display:none;">
|
||||
<?php foreach ($artists as $artist): ?>
|
||||
<label>
|
||||
<input type="checkbox" name="artist[]" value="<?= $artist->artistName; ?>">
|
||||
<?= $artist->artistName; ?>
|
||||
</label><br>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<div id="year-checkboxes" style="display:none;">
|
||||
<?php foreach ($years as $year): ?>
|
||||
<label>
|
||||
<input type="checkbox" name="year[]" value="<?= $year->year; ?>">
|
||||
<?= $year->year; ?>
|
||||
</label><br>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<button type="submit">Apply Filters</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h5>Sort Albums</h5>
|
||||
<button type="button" onclick="toggleSortButtons()">Sort</button>
|
||||
<div id="sort-buttons" class="sort-buttons">
|
||||
<button onclick="sortAlbums('year', 'asc')">Sort by Year Asc</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', 'desc')">Sort by Artist Desc</button>
|
||||
<button onclick="sortAlbums('name', 'asc')">Sort by Album Name Asc</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', 'desc')">Sort by Genre Desc</button>
|
||||
</div>
|
||||
|
||||
|
||||
<h5>Albums list</h5>
|
||||
<section class="list">
|
||||
<?php
|
||||
|
||||
@@ -1,14 +1,155 @@
|
||||
<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('albums/index'); ?>";
|
||||
url += "?sort=" + column + "&order=" + order;
|
||||
window.location.href = url;
|
||||
}
|
||||
</script>
|
||||
|
||||
<h5>Filter Chansons</h5>
|
||||
<button type="button" onclick="toggleFilterOptions()">Filter</button>
|
||||
|
||||
<div id="filter-options" class="filter-options">
|
||||
<form method="get">
|
||||
<div id="filter-buttons" class="filter-buttons">
|
||||
<button type="button" onclick="toggleCheckboxes('genre')">Genres</button>
|
||||
<button type="button" onclick="toggleCheckboxes('artist')">Artists</button>
|
||||
<button type="button" onclick="toggleCheckboxes('year')">Years</button>
|
||||
<button type="button" onclick="toggleCheckboxes('album')">Albums</button>
|
||||
</div>
|
||||
|
||||
<div id="genre-checkboxes" style="display:none;">
|
||||
<?php foreach ($genres as $genre): ?>
|
||||
<label>
|
||||
<input type="checkbox" name="genre[]" value="<?= $genre->genreName; ?>">
|
||||
<?= $genre->genreName; ?>
|
||||
</label><br>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<div id="artist-checkboxes" style="display:none;">
|
||||
<?php foreach ($artists as $artist): ?>
|
||||
<label>
|
||||
<input type="checkbox" name="artist[]" value="<?= $artist->artistName; ?>">
|
||||
<?= $artist->artistName; ?>
|
||||
</label><br>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<div id="year-checkboxes" style="display:none;">
|
||||
<?php foreach ($years as $year): ?>
|
||||
<label>
|
||||
<input type="checkbox" name="year[]" value="<?= $year->year; ?>">
|
||||
<?= $year->year; ?>
|
||||
</label><br>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<div id="album-checkboxes" style="display:none;">
|
||||
<?php foreach ($albums as $album): ?>
|
||||
<label>
|
||||
<input type="checkbox" name="albums[]" value="<?= $album->albumName; ?>">
|
||||
<?= $album->albumName; ?>
|
||||
</label><br>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<button type="submit">Apply Filters</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h5>Sort Chansons</h5>
|
||||
<button type="button" onclick="toggleSortButtons()">Sort</button>
|
||||
<div id="sort-buttons" class="sort-buttons">
|
||||
<button onclick="sortAlbums('year', 'asc')">Sort by Year Asc</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', 'desc')">Sort by Artist Desc</button>
|
||||
<button onclick="sortAlbums('name', 'asc')">Sort by Album Name Asc</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', 'desc')">Sort by Genre Desc</button>
|
||||
</div>
|
||||
|
||||
<h5>Chansons list</h5>
|
||||
<section class="list">
|
||||
<?php
|
||||
foreach($chansons as $chansons){
|
||||
foreach($chansons as $chanson){
|
||||
echo "<div><article>";
|
||||
echo "<header class='short-text'>";
|
||||
echo anchor("albums/view/{$chansons->id}","{$chansons->name}");
|
||||
echo anchor("chansons/view/{$chanson->id}","{$chanson->name}");
|
||||
echo anchor("chansons/addSongtoPlaylist/{$chanson->trackId}","<i class='fa fa-plus'></i>");
|
||||
echo "</header>";
|
||||
echo "<nav class='short-text'>Nom album: {$chansons->albumName}</nav>";
|
||||
echo "<nav class='short-text'>Genre: {$chansons->genreName}</nav>";
|
||||
echo "<footer class='short-text'>{$chansons->year} - {$chansons->artistName}</footer>
|
||||
echo "<nav class='short-text'>Nom album: {$chanson->albumName}</nav>";
|
||||
echo "<nav class='short-text'>Genre: {$chanson->genreName}</nav>";
|
||||
echo "<footer class='short-text'>{$chanson->year} - {$chanson->artistName}</footer>
|
||||
</article></div>";
|
||||
}
|
||||
?>
|
||||
|
||||
16
CodeIgniter-3.1.13/application/views/connexion_user.php
Normal file
16
CodeIgniter-3.1.13/application/views/connexion_user.php
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
<form method="post">
|
||||
<!-- Markup example 2: input is after label -->
|
||||
<label for="email">Adresse mail</label>
|
||||
<input type="email" id="email" name="email" placeholder="Email" value="<?=set_value('email')?>" required>
|
||||
<div class="grid">
|
||||
<label for="password">Password
|
||||
<input type="password" id="password" name="password" placeholder="Password" value="<?=set_value('password')?>" required>
|
||||
</label>
|
||||
</div>
|
||||
<!-- Button -->
|
||||
<button type="submit">Submit</button>
|
||||
<?=anchor('user/create','Création de Compte');?>
|
||||
</form>
|
||||
|
||||
14
CodeIgniter-3.1.13/application/views/create_playlist.php
Normal file
14
CodeIgniter-3.1.13/application/views/create_playlist.php
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
<form method="post">
|
||||
<!-- Markup example 2: input is after label -->
|
||||
<label for="name">Nom de la playlist</label>
|
||||
<input type="text" id="name" name="name" placeholder="name" required>
|
||||
<div class="grid">
|
||||
<label for="text">Déscription
|
||||
<input type="text" id="Description" name="Description" placeholder="Description" >
|
||||
</label>
|
||||
</div>
|
||||
<!-- Button -->
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
|
||||
32
CodeIgniter-3.1.13/application/views/create_user.php
Normal file
32
CodeIgniter-3.1.13/application/views/create_user.php
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
<form method="post">
|
||||
<!-- Grid -->
|
||||
<div class="grid">
|
||||
|
||||
<!-- Markup example 1: input is inside label -->
|
||||
<label for="prenom">
|
||||
Prénom
|
||||
<input type="text" id="prenom" name="prenom" placeholder="Prénom" value="<?=set_value('prenom')?>"required>
|
||||
</label>
|
||||
|
||||
<label for="nom">
|
||||
Nom
|
||||
<input type="text" id="nom" name="nom" placeholder="nom" value="<?=set_value('nom')?>" required>
|
||||
</label>
|
||||
</div>
|
||||
<!-- Markup example 2: input is after label -->
|
||||
<label for="email">Adresse mail</label>
|
||||
<input type="email" id="email" name="email" placeholder="Email" value="<?=set_value('email')?>" required>
|
||||
<div class="grid">
|
||||
<label for="password">Password
|
||||
<input type="password" id="password" name="password" placeholder="Password" value="<?=set_value('password')?>" required>
|
||||
</label>
|
||||
<label for="password">Confirmation password
|
||||
<input type="password" id="cpassword" name="cpassword" placeholder="Password" value="<?=set_value('cpassword')?>" required>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
<!-- Button -->
|
||||
<button type="submit">Submit</button>
|
||||
|
||||
</form>
|
||||
@@ -16,15 +16,24 @@
|
||||
<nav>
|
||||
<ul>
|
||||
<li ><strong class= 'apliiiiiii'>Music APP</strong></li>
|
||||
<?php $page = preg_split('/[\/]/',$_SERVER['REQUEST_URI']);
|
||||
if($page[count($page)-1]!='auth' && $page[count($page)-1]!='create'){ ?>
|
||||
<form method='GET'>
|
||||
<input type='text' name='recherche' placeholder='Recherche... '>
|
||||
</form>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><?=anchor('albums','Albums');?></li>
|
||||
<li><?=anchor('artistes','Artistes');?></li>
|
||||
<li><?=anchor('chansons','Chansons');?></li>
|
||||
<li><?=anchor('playlist','Playlist');?></li>
|
||||
<li name='connexion'><?=anchor('connexion','Connexion');?></li>
|
||||
<?php if($this->session->userdata('logged_in')){ ?>
|
||||
<li><?=anchor('playlist','Playlist');?></li>
|
||||
<li name='déconnexion'><?=anchor('user/logout','Déconnexion');?></li>
|
||||
<?php }else{ ?>
|
||||
<li name='connexion'><?=anchor('user/auth','Connexion');?></li>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
15
CodeIgniter-3.1.13/application/views/playlist_list.php
Normal file
15
CodeIgniter-3.1.13/application/views/playlist_list.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<h5>Playlist list</h5>
|
||||
<section class="list">
|
||||
<?php
|
||||
echo"<div>";
|
||||
echo anchor("playlist/addplaylist","<i class='fa fa-plus'></i>");
|
||||
echo"</div>";
|
||||
foreach($playlists as $playlist){
|
||||
echo "<div><article>";
|
||||
echo "<header class='short-text'>";
|
||||
echo anchor("playlist/view/{$playlist->playlistid}","{$playlist->name}");
|
||||
echo "</header>";
|
||||
echo "</article></div>";
|
||||
}
|
||||
?>
|
||||
</section>
|
||||
Reference in New Issue
Block a user