playlist aléatoire
This commit is contained in:
@@ -9,6 +9,7 @@ class Deconnexion extends CI_Controller {
|
||||
|
||||
public function index() {
|
||||
$this->session->unset_userdata('logged');
|
||||
$this->session->unset_userdata('mail');
|
||||
$this->session->sess_destroy();
|
||||
redirect('welcome');
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ class Enregistrer extends CI_Controller{
|
||||
}
|
||||
$this->model_music->SignUp($pseudo,$login,$password);
|
||||
$this->session->set_userdata('logged', true);
|
||||
$this->session->set_userdata('mail', $login);
|
||||
$this->load->view('layout/header');
|
||||
redirect('albums');
|
||||
}
|
||||
|
||||
@@ -50,12 +50,6 @@ class Playlist extends CI_Controller {
|
||||
redirect("playlist/SongPlaylist/$id_playlist");
|
||||
}
|
||||
|
||||
public function MenuCreate() {
|
||||
$this->load->view('layout/header');
|
||||
$this->load->view('create_playlist');
|
||||
$this->load->view('layout/footer');
|
||||
|
||||
}
|
||||
|
||||
public function createPlaylistController() {
|
||||
$mail = $this->session->userdata('mail');
|
||||
@@ -64,6 +58,17 @@ class Playlist extends CI_Controller {
|
||||
redirect('playlist');
|
||||
}
|
||||
|
||||
public function createRandomPlaylist() {
|
||||
$mail = $this->session->userdata('mail');
|
||||
$name_playlist = $this->input->post('name_playlist_random');
|
||||
$num_songs = (int) $this->input->post('num_songs');
|
||||
if ($num_songs < 1 || $num_songs > 2000) {
|
||||
return;
|
||||
}
|
||||
$this->model_music->createPlaylistRandom($name_playlist, $num_songs, $mail);
|
||||
redirect('playlist');
|
||||
}
|
||||
|
||||
public function addSongToPlaylist(){
|
||||
$songName = $this->input->post('song');
|
||||
$playlistId = $this->input->post('playlist');
|
||||
|
||||
Reference in New Issue
Block a user