duplication playlist
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user