function action_add_song_to_playlist() { $user = $this->is_logged(); if ($user === false) { return Redirect::to_action('login'); } else { $new_song = new SongPlaylist($_POST['id_song'], $_POST['id_playlist'], $user->get_id_user_lif(), null); $new_song->add(); } }
public function action_remove_song_to_playlist() { $user = $this->is_logged(); if ($user === false) { return Redirect::to_action('login'); } else { $id_playlist = $_POST['id_playlist']; $adminPlaylist = new adminPlaylist($user->get_id_user_lif(), $id_playlist); if ($adminPlaylist->check_exists() == 1) { $song_playlist = new SongPlaylist($_POST['id_song'], $_POST['id_playlist']); $song_playlist->remove(); } else { return Redirect::to_action('home@index'); } } }