duplication playlist

This commit is contained in:
2024-06-16 19:05:37 +02:00
parent 9597b8492f
commit 4efd73e0bf
16 changed files with 428 additions and 152 deletions

View File

@@ -6,6 +6,7 @@ class Albums extends CI_Controller {
public function __construct(){
parent::__construct();
$this->load->model('model_music');
$this->load->library('form_validation');
}
public function index(){
$genre = $this->input->get('genre');
@@ -54,5 +55,21 @@ class Albums extends CI_Controller {
$this->load->view('layout/footer');
}
public function addAlbumtoPlaylist($id) {
$playlists = $this->model_music->getPlaylist();
$this->form_validation->set_rules('playlist_id', 'playlist_id', 'required');
if ($this->form_validation->run() == FALSE){
$this->load->view('layout/header');
$this->load->view('addAlbumtoplaylist', ["playlists" => $playlists]);
$this->load->view('layout/footer');
}else{
$playlistId = $this->input->post('playlist_id');
$page = $this->input->get('page');
$this->model_music->AddAlbumtoPlaylist($playlistId,$id);
redirect($page);
}
}
}