From f7d8c15910a7313edd38e03a3be1662bd41a86e8 Mon Sep 17 00:00:00 2001
From: boutaric
Date: Thu, 30 May 2024 10:05:37 +0200
Subject: [PATCH] css + resolution de bug php
---
ci/application/config/config.php | 2 +-
ci/application/config/routes.php | 2 +-
ci/application/controllers/Albums.php | 41 ++-
ci/application/controllers/Artistes.php | 10 +-
ci/application/controllers/Chansons.php | 4 +-
ci/application/controllers/Song.php | 4 +-
ci/application/controllers/Welcome.php | 28 +-
ci/application/views/albums_list.php | 18 +-
ci/application/views/artistes_list.php | 2 +-
ci/application/views/layout/footer.php | 49 ++-
ci/application/views/layout/footer_album.php | 47 +++
.../views/layout/footer_artistes.php | 47 +++
ci/application/views/layout/footer_song.php | 47 +++
ci/application/views/layout/header.php | 95 ++++--
ci/application/views/layout/header_album.php | 33 ++
.../views/layout/header_artistes.php | 32 ++
ci/application/views/layout/header_song.php | 32 ++
ci/application/views/song_album_list.php | 2 +-
ci/assets/SpotiFly-removebg-preview.png | Bin 0 -> 39686 bytes
ci/assets/album.css | 42 +++
ci/assets/bouton.js | 25 ++
ci/assets/img/SpotiFly.png | Bin 0 -> 39686 bytes
ci/assets/img/Statistique.png | Bin 0 -> 2658 bytes
ci/assets/img/argent.png | Bin 0 -> 21590 bytes
ci/assets/img/fond.jpeg | Bin 0 -> 3838 bytes
ci/assets/img/logo_noir.png | Bin 0 -> 40992 bytes
ci/assets/style.css | 290 +++++++++++++++++-
27 files changed, 747 insertions(+), 105 deletions(-)
create mode 100644 ci/application/views/layout/footer_album.php
create mode 100644 ci/application/views/layout/footer_artistes.php
create mode 100644 ci/application/views/layout/footer_song.php
create mode 100644 ci/application/views/layout/header_album.php
create mode 100644 ci/application/views/layout/header_artistes.php
create mode 100644 ci/application/views/layout/header_song.php
create mode 100644 ci/assets/SpotiFly-removebg-preview.png
create mode 100644 ci/assets/album.css
create mode 100644 ci/assets/bouton.js
create mode 100644 ci/assets/img/SpotiFly.png
create mode 100644 ci/assets/img/Statistique.png
create mode 100644 ci/assets/img/argent.png
create mode 100644 ci/assets/img/fond.jpeg
create mode 100644 ci/assets/img/logo_noir.png
diff --git a/ci/application/config/config.php b/ci/application/config/config.php
index e901ca5..80d6f99 100644
--- a/ci/application/config/config.php
+++ b/ci/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'] = '/~brigitte/SAEWEB2.2/ci';
+$config['base_url'] = 'https://dwarves.iut-fbleau.fr/~boutaric/test/ci/';
/*
|--------------------------------------------------------------------------
diff --git a/ci/application/config/routes.php b/ci/application/config/routes.php
index 2785ed9..e8e2296 100644
--- a/ci/application/config/routes.php
+++ b/ci/application/config/routes.php
@@ -49,6 +49,6 @@ 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'] = 'welcome';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
diff --git a/ci/application/controllers/Albums.php b/ci/application/controllers/Albums.php
index 7b7e917..a62c2f7 100644
--- a/ci/application/controllers/Albums.php
+++ b/ci/application/controllers/Albums.php
@@ -3,22 +3,29 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Albums extends CI_Controller {
- public function __construct(){
- parent::__construct();
- $this->load->model('model_music');
- }
- public function index(){
- $albums = $this->model_music->getAlbums();
- $this->load->view('layout/header');
- $this->load->view('albums_list',['albums'=>$albums]);
- $this->load->view('layout/footer');
- }
+ public function __construct(){
+ parent::__construct();
+ $this->load->model('model_music');
+ }
- public function view($album_id){
- $songs = $this->model_music->getSongOfAlbum($album_id);
- $this->load->view('layout/header');
- $this->load->view('song_album_list',['songs'=>$songs]);
- $this->load->view('layout/footer');
- }
+ public function index(){
+ $albums = $this->model_music->getAlbums();
+ $this->load->view('layout/header_album');
+ $this->load->view('albums_list', ['albums' => $albums]);
+ $this->load->view('layout/footer_album');
+ }
+
+ public function view($album_id){
+ $songs = $this->model_music->getSongsByAlbum($album_id);
+ if (empty($songs)) {
+ $songs = []; // Assurez-vous que $songs est un tableau vide si aucune chanson n'est trouvée
+ }
+ // Debugging: Log the $songs variable to see its content
+ log_message('debug', 'Songs: ' . print_r($songs, true));
+
+ $this->load->view('layout/header_album');
+ $this->load->view('song_album_list', ['songs' => $songs]);
+ $this->load->view('layout/footer_album');
+ }
}
-
+?>
diff --git a/ci/application/controllers/Artistes.php b/ci/application/controllers/Artistes.php
index cfb25dc..61a5960 100644
--- a/ci/application/controllers/Artistes.php
+++ b/ci/application/controllers/Artistes.php
@@ -9,15 +9,9 @@ class artistes extends CI_Controller {
}
public function index(){
$artistes = $this->model_music->getArtists();
- $this->load->view('layout/header');
+ $this->load->view('layout/header_artistes');
$this->load->view('artistes_list',['artistes'=>$artistes]);
- $this->load->view('layout/footer');
- }
- public function view($AlbumsOfArtistId){
- $AlbumsOfArtist = $this->model_music->getAlbumsOfArtist($AlbumsOfArtistId);
- $this->load->view('layout/header');
- $this->load->view('albums_artist_list',['AlbumsOfArtist'=>$AlbumsOfArtist]);
- $this->load->view('layout/footer');
+ $this->load->view('layout/footer_artistes');
}
}
\ No newline at end of file
diff --git a/ci/application/controllers/Chansons.php b/ci/application/controllers/Chansons.php
index 894234c..992e9d6 100644
--- a/ci/application/controllers/Chansons.php
+++ b/ci/application/controllers/Chansons.php
@@ -9,9 +9,9 @@ class Albums extends CI_Controller {
}
public function index(){
$albums = $this->model_music->getAlbums();
- $this->load->view('layout/header');
+ $this->load->view('layout/header_chanson');
$this->load->view('albums_list',['albums'=>$albums]);
- $this->load->view('layout/footer');
+ $this->load->view('layout/footer_chanson');
}
}
diff --git a/ci/application/controllers/Song.php b/ci/application/controllers/Song.php
index 77b552a..0161f08 100644
--- a/ci/application/controllers/Song.php
+++ b/ci/application/controllers/Song.php
@@ -10,8 +10,8 @@ class Song extends CI_Controller {
public function view($album_id){
$songs = $this->model_music->getSongOfAlbum($album_id);
- $this->load->view('layout/header');
+ $this->load->view('layout/header_song');
$this->load->view('song_album_list',['songs'=>$songs]);
- $this->load->view('layout/footer');
+ $this->load->view('layout/footer_song');
}
}
\ No newline at end of file
diff --git a/ci/application/controllers/Welcome.php b/ci/application/controllers/Welcome.php
index 5f82771..edd94e8 100644
--- a/ci/application/controllers/Welcome.php
+++ b/ci/application/controllers/Welcome.php
@@ -1,25 +1,15 @@
- * @see https://codeigniter.com/userguide3/general/urls.html
- */
- public function index()
- {
- $this->load->view('welcome_message');
+ public function __construct(){
+ parent::__construct();
+ $this->load->model('model_music');
}
+ public function index(){
+ $this->load->view('layout/header');
+ $this->load->view('layout/footer');
+ }
+
}
diff --git a/ci/application/views/albums_list.php b/ci/application/views/albums_list.php
index 45d0462..ad8709b 100644
--- a/ci/application/views/albums_list.php
+++ b/ci/application/views/albums_list.php
@@ -1,14 +1,14 @@
-Albums list
-
+Liste des albums
+
";
- echo "";
- echo anchor("Song/view/{$album->id}","{$album->name}");
- echo "";
- echo '';
- echo "
- ";
+ echo "";
+ echo "";
+ echo anchor("Song/view/{$album->id}", "{$album->name}");
+ echo "";
+ echo '';
+ echo "";
+ echo " ";
}
?>
diff --git a/ci/application/views/artistes_list.php b/ci/application/views/artistes_list.php
index b193ed5..906ebc5 100644
--- a/ci/application/views/artistes_list.php
+++ b/ci/application/views/artistes_list.php
@@ -11,4 +11,4 @@ foreach($artistes as $artistes){
//";
}
?>
-
+
\ No newline at end of file
diff --git a/ci/application/views/layout/footer.php b/ci/application/views/layout/footer.php
index 63bbae9..41babbe 100644
--- a/ci/application/views/layout/footer.php
+++ b/ci/application/views/layout/footer.php
@@ -1,3 +1,48 @@
-
-
+
+