Files
SAe-PHP-S2/application/controllers/Albums.php

35 lines
871 B
PHP

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Albums 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');
$albums = $this->model_music->getAlbums($genre, $order, $artist);
$genres = $this->model_music->researchtype();
$artists = $this->model_music->nameArtist();
$is_logged_in = $this->session->userdata('logged_in');
$data = array(
'albums' => $albums,
'is_logged_in' => $is_logged_in,
'genres' => $genre,
'artistes' => $artist
);
$this->load->view('layout/header',$data);
$this->load->view('albums_list', $data);
$this->load->view('layout/footer');
}
}