ajout filtre et tri pour artiste
This commit is contained in:
@@ -8,19 +8,30 @@ class Artistes extends CI_Controller {
|
||||
$this->load->model('model_music');
|
||||
}
|
||||
public function index(){
|
||||
$genre = $this->input->get('genre');
|
||||
$sort = $this->input->get('sort');
|
||||
$order = $this->input->get('order');
|
||||
|
||||
if ($recherche=filter_input(INPUT_GET,'recherche') == false or $recherche=filter_input(INPUT_GET,'recherche') == null){
|
||||
$artistes = $this->model_music->getArtistes();
|
||||
$artistes = $this->model_music->get_filtered_artistes($genre, $sort, $order);
|
||||
$data['artistes'] = $artistes;
|
||||
}else{
|
||||
$recherche=filter_input(INPUT_GET,'recherche');
|
||||
$artistes = $this->model_music->getSearchArtistes($recherche);
|
||||
$data['artistes'] = $artistes;
|
||||
}
|
||||
$this->load->view('layout/header');
|
||||
if ($artistes == false){
|
||||
$page = preg_split('/[\/]/',$_SERVER['REQUEST_URI']);
|
||||
$this->load->view('error',['page'=>$page[count($page)-1]]);
|
||||
$artistes = $this->model_music->getArtistes();
|
||||
$artistes = $this->model_music->get_filtered_artistes($genre, $sort, $order);
|
||||
$data['artistes'] = $artistes;
|
||||
}
|
||||
$this->load->view('artistes_list',['artistes'=>$artistes]);
|
||||
$data['genres'] = $this->model_music->get_all_genres_artistes();
|
||||
|
||||
$this->load->view('artistes_list',$data);
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user