2024-05-20 21:59:37 +02:00
|
|
|
<?php
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
|
|
|
|
class Musiques extends CI_Controller {
|
|
|
|
|
|
|
|
public function __construct(){
|
|
|
|
parent::__construct();
|
|
|
|
$this->load->model('Model_music');
|
|
|
|
$this->load->library('pagination');
|
|
|
|
$this->load->helper('url');
|
2024-05-23 11:52:41 +02:00
|
|
|
$this->load->helper('html');
|
2024-05-20 21:59:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function index($page = 1){
|
2024-05-30 14:38:38 +02:00
|
|
|
$this->load->model('Model_music');
|
|
|
|
$this->load->library('pagination');
|
|
|
|
$this->load->helper('url');
|
|
|
|
$this->load->helper('html');
|
|
|
|
|
|
|
|
$limit = 30;
|
2024-05-20 21:59:37 +02:00
|
|
|
$offset = ($page - 1) * $limit;
|
2024-05-22 22:05:48 +02:00
|
|
|
$sort = $this->input->get('sort');
|
2024-05-30 14:38:38 +02:00
|
|
|
$genre_id = $this->input->get('genre_id');
|
|
|
|
$artist_id = $this->input->get('artist_id');
|
2024-05-22 22:05:48 +02:00
|
|
|
|
2024-05-30 14:38:38 +02:00
|
|
|
$musiques = $this->Model_music->getMusiques($limit, $offset, $sort, 'ASC', $genre_id, $artist_id);
|
2024-05-20 21:59:37 +02:00
|
|
|
$total_musiques = $this->Model_music->get_total_musiques();
|
2024-05-22 22:05:48 +02:00
|
|
|
$total_pages = ceil($total_musiques / $limit);
|
2024-05-30 14:38:38 +02:00
|
|
|
|
2024-05-22 22:05:48 +02:00
|
|
|
$current_page = $page;
|
2024-05-30 14:38:38 +02:00
|
|
|
$genres = $this->Model_music->getGenres();
|
|
|
|
$artists = $this->Model_music->getArtists();
|
|
|
|
|
2024-05-20 21:59:37 +02:00
|
|
|
$data['musiques'] = $musiques;
|
2024-05-22 22:05:48 +02:00
|
|
|
$data['total_pages'] = $total_pages;
|
|
|
|
$data['current_page'] = $current_page;
|
2024-05-30 14:38:38 +02:00
|
|
|
$data['sort'] = $sort;
|
|
|
|
$data['genres'] = $genres;
|
|
|
|
$data['artists'] = $artists;
|
|
|
|
$data['genre_id'] = $genre_id;
|
|
|
|
$data['artist_id'] = $artist_id;
|
|
|
|
|
|
|
|
$data['title'] = "Musiques - Onzeur";
|
|
|
|
$data['css'] = "assets/css/musiques_list";
|
2024-05-20 22:42:38 +02:00
|
|
|
|
2024-05-30 13:49:35 +02:00
|
|
|
$this->load->view('layout/header_dark', $data);
|
2024-05-30 14:38:38 +02:00
|
|
|
$this->load->view('musiques_list', $data);
|
2024-05-25 01:13:18 +02:00
|
|
|
$this->load->view('layout/footer_dark');
|
2024-05-30 14:38:38 +02:00
|
|
|
}
|
2024-05-20 22:42:38 +02:00
|
|
|
|
2024-05-20 21:59:37 +02:00
|
|
|
}
|