"; echo "
diff --git a/ci/application/config/config.php b/ci/application/config/config.php index 3efe38d..45c8d4f 100644 --- a/ci/application/config/config.php +++ b/ci/application/config/config.php @@ -23,7 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); | a PHP script and you can easily do that on your own. | */ -$config['base_url'] = '/~brigitte/SAEWEB2.2/ci/'; +$config['base_url'] = '/~gallego/SAEWEB2.2/ci/'; /* |-------------------------------------------------------------------------- diff --git a/ci/application/controllers/Playlist.php b/ci/application/controllers/Playlist.php index 6447a49..2d20ed9 100644 --- a/ci/application/controllers/Playlist.php +++ b/ci/application/controllers/Playlist.php @@ -28,4 +28,10 @@ class Playlist extends CI_Controller { $this->load->view('song_playlist', ['songPlaylists' => $songPlaylists]); //$this->load->view('layout/footer_album'); } + + public function deletePlaylist($playlist_id) { + $playlists = $this->model_music->deletePlaylist($playlist_id); + /*$this->load->view('playlist_list', ['playlists' => $playlists]);*/ + redirect('playlist/index'); + } } \ No newline at end of file diff --git a/ci/application/models/Model_music.php b/ci/application/models/Model_music.php index 8d22e5b..067789a 100644 --- a/ci/application/models/Model_music.php +++ b/ci/application/models/Model_music.php @@ -38,11 +38,10 @@ class Model_music extends CI_Model { return $query->result(); } - public function deletePlaylist(){ + public function deletePlaylist($playlist_id){ $query = $this->db->query( - "SELECT playlist.id, playlist.name - FROM playlist - Group by playlist.id + "DELETE FROM SongPlaylist + WHERE id = $playlist_id " ); return $query->result(); diff --git a/ci/application/views/playlist_list.php b/ci/application/views/playlist_list.php index cfd1997..0e9fef7 100644 --- a/ci/application/views/playlist_list.php +++ b/ci/application/views/playlist_list.php @@ -3,15 +3,10 @@ foreach($playlists as $playlist){ echo "