duplication playlist
This commit is contained in:
@@ -48,4 +48,30 @@ class Playlist extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public function duplicatePlaylist($id){
|
||||
$this->form_validation->set_rules('name', 'name', 'required');
|
||||
|
||||
if ($this->form_validation->run() == FALSE){
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('create_playlist');
|
||||
$this->load->view('layout/footer');
|
||||
}else{
|
||||
$nom = $this->input->post('name');
|
||||
$description = $this->input->post('Description');
|
||||
$userId = $this->session->userdata('userId');
|
||||
$playlist = array(
|
||||
'name'=>$nom,
|
||||
'description'=>$description,
|
||||
'userId'=>$userId,
|
||||
);
|
||||
$this->model_music->addPlayliste($playlist);
|
||||
$this->model_music->DuplicatePlaylist($id, $nom);
|
||||
redirect('playlist');
|
||||
}
|
||||
}
|
||||
|
||||
public function deletePlaylist($id){
|
||||
$this->model_music->DeletePlaylist($id);
|
||||
redirect('playlist');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user