diff --git a/CodeIgniter-3.1.13/application/models/Model_playlist.php b/CodeIgniter-3.1.13/application/models/Model_playlist.php index 0918487..9f618a1 100644 --- a/CodeIgniter-3.1.13/application/models/Model_playlist.php +++ b/CodeIgniter-3.1.13/application/models/Model_playlist.php @@ -17,8 +17,7 @@ class Model_playlist extends CI_Model { return false; } } - - + // Récupérer une playlist par ID public function get_playlist_by_id($playlist_id) { return $this->db->get_where('playlist', array('id' => $playlist_id))->row(); @@ -44,16 +43,13 @@ class Model_playlist extends CI_Model { } public function add_song_to_playlist($data) { - // Vérifier si la combinaison playlist_id et song_id existe déjà $this->db->where($data); $existing_entry = $this->db->get('playlist_song')->row(); - // Si la combinaison existe déjà, retourner false if ($existing_entry) { return false; } - // Sinon, effectuer l'insertion return $this->db->insert('playlist_song', $data); } diff --git a/CodeIgniter-3.1.13/application/views/accueil.php b/CodeIgniter-3.1.13/application/views/accueil.php index 8d06957..a6358ba 100644 --- a/CodeIgniter-3.1.13/application/views/accueil.php +++ b/CodeIgniter-3.1.13/application/views/accueil.php @@ -1,5 +1,3 @@ - -