possibilité de supprimer une chansons d'une playlist
This commit is contained in:
@@ -52,7 +52,33 @@ class Chansons extends CI_Controller {
|
||||
}else{
|
||||
$playlistId = $this->input->post('playlist_id');
|
||||
$this->model_music->AddSongtoPlaylist($playlistId,$id);
|
||||
redirect('chansons');
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteSongtoPlaylist($id){
|
||||
$playlists = $this->model_music->getPlaylistIdSong($id);
|
||||
|
||||
$this->form_validation->set_rules('playlist_id', 'playlist_id', 'required');
|
||||
|
||||
if ($this->form_validation->run() == FALSE){
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('deleteSongtoplaylist', ["playlists" => $playlists]);
|
||||
$this->load->view('layout/footer');
|
||||
}else{
|
||||
$playlistId = $this->input->post('playlist_id');
|
||||
$this->model_music->DeleteSongtoPlaylist($playlistId,$id);
|
||||
redirect('chansons');
|
||||
}
|
||||
}
|
||||
|
||||
public function view($id){
|
||||
$chansons = $this->model_music->get_song_playlist($id);
|
||||
$data['chansons'] = $chansons;
|
||||
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('chansons_list',$data);
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user