barre de recherche
This commit is contained in:
parent
a1b797a1c5
commit
ffd3f5dd39
@ -9,32 +9,30 @@ class Albums extends CI_Controller {
|
||||
}
|
||||
|
||||
public function index(){
|
||||
$selectedGenre = '0'; // Valeur par défaut pour le genre si aucun n'est sélectionné
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
if(isset($_POST['Genre'])){
|
||||
$selectedGenre = $_POST['Genre'];
|
||||
}
|
||||
}
|
||||
$albums = $this->model_music->getAlbums($selectedGenre);
|
||||
$playlists = $this->model_music->getPlaylist();
|
||||
$genre = $this->model_music->getGenre();
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('albums_list', ['albums' => $albums, 'playlists' => $playlists]);
|
||||
$this->load->view('layout/footer');
|
||||
|
||||
$this->load->view('GenreFilter',['genre'=>$genre]);
|
||||
$selectedGenre = '0';
|
||||
$search = '';
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
if(isset($_POST['Genre'])){
|
||||
$selectedGenre = $_POST['Genre'];
|
||||
}
|
||||
if(isset($_POST['Genre'])){
|
||||
$selectedGenre = $_POST['Genre'];
|
||||
}
|
||||
}
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
if(isset($_POST['recherche'])){
|
||||
$search = $_POST['recherche'];
|
||||
}
|
||||
}
|
||||
$playlists = $this->model_music->getPlaylist();
|
||||
$albums = $this->model_music->searchAlbums($search, $selectedGenre);
|
||||
$this->load->view('albums_list', ['albums' => $albums, 'playlists' => $playlists]);
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function view($album_id){
|
||||
$songs = $this->model_music->getSongOfAlbum($album_id);
|
||||
if (empty($songs)) {
|
||||
|
@ -1,12 +1,15 @@
|
||||
<form method="post" action="albums">
|
||||
<?php
|
||||
echo "<br>";
|
||||
echo "<br>";
|
||||
echo "<br>";
|
||||
echo "<select id='GenreId' name='Genre'>";
|
||||
echo "<option value='0'>Select genre</option>";
|
||||
foreach($genre as $genre) {
|
||||
echo "<option value='{$genre->id}'>{$genre->name}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo"<form class'search-bar' action='/search' method='post'>";
|
||||
echo"<form class'search-bar' action='/search' method='post'>";
|
||||
echo"<input type'search' name='recherche' placeholder='Search...'>";
|
||||
?>
|
||||
<button type="submit">Submit</button>
|
||||
|
Loading…
Reference in New Issue
Block a user