ajout recherche
This commit is contained in:
@@ -10,8 +10,18 @@ class Albums extends CI_Controller {
|
||||
$this->load->helper('url');
|
||||
}
|
||||
public function index(){
|
||||
$albums = $this->model_music->getAlbums();
|
||||
if ($recherche=filter_input(INPUT_GET,'recherche') == false or $recherche=filter_input(INPUT_GET,'recherche') == null){
|
||||
$albums = $this->model_music->getAlbums();
|
||||
}else{
|
||||
$recherche=filter_input(INPUT_GET,'recherche');
|
||||
$albums = $this->model_music->getSearchAlbums($recherche);
|
||||
}
|
||||
$this->load->view('layout/header');
|
||||
if ($albums == false){
|
||||
$page = preg_split('/[\/]/',$_SERVER['HTTP_REFERER']);
|
||||
$this->load->view('error',['page'=>$page[count($page)-1]]);
|
||||
$albums = $this->model_music->getAlbums();
|
||||
}
|
||||
$this->load->view('albums_list',['albums'=>$albums]);
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user