duplication playlist
This commit is contained in:
@@ -6,6 +6,7 @@ class Artistes 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');
|
||||
@@ -35,5 +36,21 @@ class Artistes extends CI_Controller {
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
|
||||
public function addArtistestoPlaylist($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('addArtistestoplaylist', ["playlists" => $playlists]);
|
||||
$this->load->view('layout/footer');
|
||||
}else{
|
||||
$playlistId = $this->input->post('playlist_id');
|
||||
$this->model_music->AddArtistestoPlaylist($playlistId,$id);
|
||||
redirect('artistes');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user