50 lines
1.5 KiB
PHP
50 lines
1.5 KiB
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
class Music extends CI_Controller {
|
|
|
|
public function __construct(){
|
|
parent::__construct();
|
|
$this->load->model('model_music');
|
|
$this->load->library('session');
|
|
}
|
|
|
|
public function index(){
|
|
$genre = $this->input->get('genre');
|
|
$order = $this->input->get('order');
|
|
$artist = $this->input->get('artist');
|
|
$query = $this->input->get('query');
|
|
|
|
$musics = $this->model_music->getMusics($genre, $order, $artist, $query);
|
|
$genres = $this->model_music->researchtype();
|
|
$artists = $this->model_music->nameArtist();
|
|
|
|
$is_logged_in = $this->session->userdata('logged_in');
|
|
$data = array(
|
|
'musics' => $musics,
|
|
'genres' => $genres,
|
|
'artists' => $artists,
|
|
'is_logged_in' => $is_logged_in
|
|
);
|
|
|
|
$this->load->view('layout/header', $data);
|
|
$this->load->view('layout/getter', $data);
|
|
$this->load->view('musiques_list', $data);
|
|
$this->load->view('layout/footer');
|
|
}
|
|
|
|
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
|
|
);
|
|
|
|
$this->load->view('layout/header', $data);
|
|
$this->load->view('song_details', $data);
|
|
$this->load->view('layout/footer');
|
|
}
|
|
}
|