50 lines
1.5 KiB
PHP
Raw Normal View History

2024-06-03 16:51:37 +02:00
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Music extends CI_Controller {
2024-06-04 21:08:14 +02:00
public function __construct(){
parent::__construct();
$this->load->model('model_music');
2024-06-05 08:08:12 +02:00
$this->load->library('session');
2024-06-04 21:08:14 +02:00
}
2024-06-03 16:51:37 +02:00
2024-06-04 21:08:14 +02:00
public function index(){
$genre = $this->input->get('genre');
$order = $this->input->get('order');
$artist = $this->input->get('artist');
2024-06-04 23:26:09 +02:00
$query = $this->input->get('query');
2024-06-04 21:29:47 +02:00
$musics = $this->model_music->getMusics($genre, $order, $artist, $query);
2024-06-04 21:08:14 +02:00
$genres = $this->model_music->researchtype();
$artists = $this->model_music->nameArtist();
2024-06-03 16:51:37 +02:00
2024-06-04 21:08:14 +02:00
$is_logged_in = $this->session->userdata('logged_in');
$data = array(
'musics' => $musics,
'genres' => $genres,
'artists' => $artists,
'is_logged_in' => $is_logged_in
);
2024-06-03 16:51:37 +02:00
2024-06-04 21:08:14 +02:00
$this->load->view('layout/header', $data);
$this->load->view('layout/getter', $data);
2024-06-04 22:09:23 +02:00
$this->load->view('musiques_list', $data);
2024-06-04 21:08:14 +02:00
$this->load->view('layout/footer');
}
2024-06-04 23:26:09 +02:00
2024-06-05 08:08:12 +02:00
public function view($trackId) {
$songData = $this->model_music->getSongDetails($trackId);
$is_logged_in = $this->session->userdata('logged_in');
$data = array(
'song' => $songData,
'is_logged_in' => $is_logged_in
);
2024-06-04 23:26:09 +02:00
2024-06-05 08:08:12 +02:00
$this->load->view('layout/header', $data);
$this->load->view('song_details', $data);
$this->load->view('layout/footer');
}
}