Finalisation des bugs
This commit is contained in:
@@ -9,14 +9,14 @@ class Playlist extends CI_Controller {
|
||||
$this->load->helper('html');
|
||||
$this->load->helper('url');
|
||||
$this->load->helper('form');
|
||||
if (!$this->session->userdata('user_id')) {
|
||||
redirect('connexion');
|
||||
}
|
||||
}
|
||||
|
||||
public function index(){
|
||||
|
||||
if (!$this->session->userdata('user_id')) {
|
||||
// Redirigez vers la page de connexion
|
||||
redirect('connexion');
|
||||
}
|
||||
|
||||
$userId = $this->session->userdata('user_id');
|
||||
$playlists = $this->model_music->getPlaylistsByUser($userId);
|
||||
$this->load->view('layout/header');
|
||||
@@ -53,23 +53,24 @@ class Playlist extends CI_Controller {
|
||||
}
|
||||
|
||||
public function view($id) {
|
||||
|
||||
if (!$this->session->userdata('user_id')) {
|
||||
// Redirigez vers la page de connexion
|
||||
redirect('connexion');
|
||||
}
|
||||
$songs = $this->model_music->getSongsByPlaylist($id);
|
||||
$playlist = $this->model_music->getPlaylistById($id);
|
||||
if ($playlist) {
|
||||
$data['playlistName'] = $playlist->name; // Passez le nom de la playlist à la vue
|
||||
$data['songs'] = $songs;
|
||||
$data['playlistId'] = $id;
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('playlist_view', $data);
|
||||
$this->load->view('layout/footer');
|
||||
} else {
|
||||
echo "Playlist non trouvée.";
|
||||
if($this->model_music->playlistOfUser($id)){
|
||||
$songs = $this->model_music->getSongsByPlaylist($id);
|
||||
$playlist = $this->model_music->getPlaylistById($id);
|
||||
if ($playlist) {
|
||||
$data['playlistName'] = $playlist->name;
|
||||
$data['songs'] = $songs;
|
||||
$data['playlistId'] = $id;
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('playlist_view', $data);
|
||||
$this->load->view('layout/footer');
|
||||
} else {
|
||||
echo "Playlist non trouvée.";
|
||||
}
|
||||
}else{
|
||||
redirect('albums');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function add_song(){
|
||||
@@ -98,10 +99,7 @@ class Playlist extends CI_Controller {
|
||||
}
|
||||
|
||||
public function choose_playlist($songId) {
|
||||
if (!$this->session->userdata('user_id')) {
|
||||
// Redirigez vers la page de connexion
|
||||
redirect('connexion');
|
||||
}
|
||||
|
||||
$playlists = $this->model_music->getPlaylistsByUser($this->session->userdata('user_id'));
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('choose_playlist', ['playlists' => $playlists, 'songId' => $songId]);
|
||||
@@ -110,10 +108,7 @@ class Playlist extends CI_Controller {
|
||||
|
||||
|
||||
public function choix_playlist($albumId) {
|
||||
if (!$this->session->userdata('user_id')) {
|
||||
// Redirigez vers la page de connexion
|
||||
redirect('connexion');
|
||||
}
|
||||
|
||||
$playlists = $this->model_music->getPlaylistsByUser($this->session->userdata('user_id'));
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('choix_playlist', ['playlists' => $playlists, 'albumId' => $albumId]);
|
||||
@@ -142,10 +137,7 @@ public function choix_playlist($albumId) {
|
||||
}
|
||||
|
||||
public function generate(){
|
||||
if (!$this->session->userdata('user_id')) {
|
||||
// Redirigez vers la page de connexion
|
||||
redirect('connexion');
|
||||
}
|
||||
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('playlist_generate');
|
||||
$this->load->view('layout/footer');
|
||||
|
Reference in New Issue
Block a user