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');
2024-06-04 17:24:06 +02:00
class Artistes extends CI_Controller {
2024-06-03 16:51:37 +02:00
2024-06-16 17:39:26 +02:00
public function __construct() {
2024-06-04 21:08:14 +02:00
parent::__construct();
$this->load->model('model_music');
2024-06-04 23:26:09 +02:00
$this->load->library('session');
2024-06-04 21:08:14 +02:00
}
2024-06-03 16:51:37 +02:00
2024-06-16 17:39:26 +02:00
public function index() {
2024-06-04 21:08:14 +02:00
$genre = $this->input->get('genre');
$order = $this->input->get('order');
2024-06-04 22:09:23 +02:00
$query = $this->input->get('query');
2024-06-04 21:29:47 +02:00
2024-06-04 23:26:09 +02:00
$artists = $this->model_music->getArtists($genre, $order, $query);
2024-06-04 21:08:14 +02:00
$genres = $this->model_music->researchtype();
$is_logged_in = $this->session->userdata('logged_in');
$data = array(
'artists' => $artists,
'genres' => $genres,
'is_logged_in' => $is_logged_in
);
$this->load->view('layout/header', $data);
$this->load->view('layout/getter', $data);
2024-06-04 22:09:23 +02:00
$this->load->view('artists_list', $data);
2024-06-04 21:08:14 +02:00
$this->load->view('layout/footer');
}
2024-06-04 22:55:02 +02:00
public function view($artistId) {
2024-06-16 17:39:26 +02:00
$artist = $this->model_music->getArtistDetails($artistId);
$albums = $this->model_music->getAlbumsByArtist($artistId);
2024-06-04 22:09:23 +02:00
2024-06-16 17:39:26 +02:00
$is_logged_in = $this->session->userdata('logged_in');
$data = array(
'artist' => $artist,
'albums' => $albums,
'is_logged_in' => $is_logged_in
);
2024-06-04 23:30:04 +02:00
2024-06-16 17:39:26 +02:00
$this->load->view('layout/header', $data);
$this->load->view('artist_details', $data);
$this->load->view('layout/footer');
}
}
?>