SAEWEB2.2/ci/application/controllers/Playlist.php

53 lines
1.6 KiB
PHP
Raw Normal View History

2024-05-30 16:14:38 +02:00
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Playlist extends CI_Controller {
public function __construct(){
parent::__construct();
$this->load->model('model_music');
}
public function index(){
$playlists = $this->model_music->getPlaylist();
2024-06-05 13:51:23 +02:00
// $this->load->view('layout/header');
2024-05-30 16:14:38 +02:00
$this->load->view('playlist_list', ['playlists' => $playlists]);
2024-06-05 13:51:23 +02:00
$this->load->view('layout/footer');
2024-05-30 16:14:38 +02:00
}
2024-06-03 15:02:52 +02:00
public function view(){
$playlists = $this->model_music->deletePlaylist();
//$this->load->view('layout/header_album');
$this->load->view('playlist_list', ['playlists' => $playlists]);
2024-06-05 13:51:23 +02:00
$this->load->view('layout/footer');
2024-06-03 15:02:52 +02:00
}
2024-06-03 17:52:42 +02:00
public function SongPlaylist($playlist_id){
2024-06-03 15:02:52 +02:00
$songPlaylists = $this->model_music->getSongOfPlaylist($playlist_id);
//$this->load->view('layout/header_album');
$this->load->view('song_playlist', ['songPlaylists' => $songPlaylists]);
//$this->load->view('layout/footer_album');
}
2024-06-03 16:10:43 +02:00
2024-06-03 17:52:42 +02:00
public function delete($playlist_id) {
$delete = $this->model_music->deletePlaylist($playlist_id);
redirect('playlist');
2024-06-03 16:10:43 +02:00
}
2024-06-03 18:44:18 +02:00
public function MenuCreate() {
//$this->load->view('layout/header_album');
$this->load->view('create_playlist');
2024-06-05 13:51:23 +02:00
$this->load->view('layout/footer');
2024-06-03 18:44:18 +02:00
}
public function createPlaylistController() {
$name_playlist = $this->input->post('name_playlist');
$create = $this->model_music->createPlaylist($name_playlist);
redirect('playlist');
}
}