diff --git a/CodeIgniter-3.1.13/application/config/config.php b/CodeIgniter-3.1.13/application/config/config.php index fb1d555..155c4a8 100644 --- a/CodeIgniter-3.1.13/application/config/config.php +++ b/CodeIgniter-3.1.13/application/config/config.php @@ -23,7 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); | a PHP script and you can easily do that on your own. | */ -$config['base_url'] = '/~stiti/SAE2.02/CodeIgniter-3.1.13'; +$config['base_url'] = '/~stiti/SAE_2.02/CodeIgniter-3.1.13'; /* |-------------------------------------------------------------------------- diff --git a/CodeIgniter-3.1.13/application/config/routes.php b/CodeIgniter-3.1.13/application/config/routes.php index 2785ed9..6d796b0 100644 --- a/CodeIgniter-3.1.13/application/config/routes.php +++ b/CodeIgniter-3.1.13/application/config/routes.php @@ -49,6 +49,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); | Examples: my-controller/index -> my_controller/index | my-controller/my-method -> my_controller/my_method */ -$route['default_controller'] = 'albums'; +$route['default_controller'] = 'home'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE; +$route['albums'] = 'albums/index'; + diff --git a/CodeIgniter-3.1.13/application/controllers/Albums.php b/CodeIgniter-3.1.13/application/controllers/Albums.php index c71c0d3..7363a56 100644 --- a/CodeIgniter-3.1.13/application/controllers/Albums.php +++ b/CodeIgniter-3.1.13/application/controllers/Albums.php @@ -9,16 +9,16 @@ class Albums extends CI_Controller { // Load the URL Helper $this->load->helper('url'); } - public function index($page = 1){ + public function index(){ + $page = 1; $limit = 21; $offset = ($page - 1) * $limit; $albums = $this->model_music->getAlbums($limit, $offset); - // Pass pagination information to view $total_albums = $this->model_music->get_total_albums(); $data['total_pages'] = ceil($total_albums / $limit); $data['current_page'] = $page; - $data['albums'] = $albums; // Pass albums data to view + $data['albums'] = $albums; $this->load->view('layout/header_not_logged_dark'); $this->load->view('albums_list', $data); diff --git a/CodeIgniter-3.1.13/application/controllers/Home.php b/CodeIgniter-3.1.13/application/controllers/Home.php index 4428ded..79b69d8 100644 --- a/CodeIgniter-3.1.13/application/controllers/Home.php +++ b/CodeIgniter-3.1.13/application/controllers/Home.php @@ -5,11 +5,15 @@ public function index() { // Charger le modèle $this->load->model('Cover_model'); + $this->load->helper('url'); + // Appeler la fonction pour récupérer les couvertures d'albums $data['covers'] = $this->Cover_model->get_covers(); // Charger la vue avec les données récupérées + $this->load->view('layout/header_not_logged_dark'); $this->load->view('accueil', $data); + $this->load->view('layout/footer_dark'); } } diff --git a/CodeIgniter-3.1.13/application/views/accueil.php b/CodeIgniter-3.1.13/application/views/accueil.php index 7eabb38..29eea16 100644 --- a/CodeIgniter-3.1.13/application/views/accueil.php +++ b/CodeIgniter-3.1.13/application/views/accueil.php @@ -1,6 +1,5 @@ - @@ -11,7 +10,7 @@

Bienvenue sur Onzeur !

Le service de streaming musical numéro 1 en France.

- +
@@ -73,6 +72,5 @@
-