diff --git a/ci/application/controllers/Playlist.php b/ci/application/controllers/Playlist.php index ffd00a4..4af69bb 100644 --- a/ci/application/controllers/Playlist.php +++ b/ci/application/controllers/Playlist.php @@ -33,4 +33,18 @@ class Playlist extends CI_Controller { $delete = $this->model_music->deletePlaylist($playlist_id); redirect('playlist'); } -} \ No newline at end of file + + public function MenuCreate() { + //$this->load->view('layout/header_album'); + $this->load->view('create_playlist'); + } + + public function createPlaylistController() { + $name_playlist = $this->input->post('name_playlist'); + $create = $this->model_music->createPlaylist($name_playlist); + redirect('playlist'); + } +} + + + diff --git a/ci/application/models/Model_music.php b/ci/application/models/Model_music.php index b53e150..832c9df 100644 --- a/ci/application/models/Model_music.php +++ b/ci/application/models/Model_music.php @@ -49,6 +49,14 @@ class Model_music extends CI_Model { ); } + public function createPlaylist($name_playlist){ + $name_playlist_escaped = $this->db->escape($name_playlist); + $query = $this->db->query( + "INSERT INTO playlist VALUES (1, $name_playlist_escaped); + " + ); + } + public function getSongOfPlaylist($playlist_id){ $query = $this->db->query( "SELECT SongPlaylist.name diff --git a/ci/application/views/create_playlist.php b/ci/application/views/create_playlist.php new file mode 100644 index 0000000..27ee44b --- /dev/null +++ b/ci/application/views/create_playlist.php @@ -0,0 +1,10 @@ +
Créer une nouvelle Playlist
+ + +
+ + + +
\ No newline at end of file diff --git a/ci/application/views/playlist_list.php b/ci/application/views/playlist_list.php index 41ec9ae..67ed953 100644 --- a/ci/application/views/playlist_list.php +++ b/ci/application/views/playlist_list.php @@ -1,5 +1,10 @@
Playlist List
"; +echo ""; +echo ""; + foreach($playlists as $playlist){ echo "
"; echo "
";