2024-05-22 10:37:19 +02:00
|
|
|
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
|
|
|
|
|
|
class Model_music extends CI_Model {
|
|
|
|
|
public function __construct(){
|
|
|
|
|
$this->load->database();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getAlbums(){
|
|
|
|
|
$query = $this->db->query(
|
|
|
|
|
"SELECT album.name,album.id,year,artist.name as artistName, genre.name as genreName,jpeg
|
|
|
|
|
FROM album
|
|
|
|
|
JOIN artist ON album.artistid = artist.id
|
|
|
|
|
JOIN genre ON genre.id = album.genreid
|
|
|
|
|
JOIN cover ON cover.id = album.coverid
|
|
|
|
|
ORDER BY year
|
|
|
|
|
"
|
|
|
|
|
);
|
|
|
|
|
return $query->result();
|
|
|
|
|
}
|
2024-05-22 12:04:00 +02:00
|
|
|
|
|
|
|
|
public function getArtistes(){
|
|
|
|
|
$query = $this->db->query(
|
|
|
|
|
"SELECT artist.name, artist.id
|
|
|
|
|
FROM artist
|
|
|
|
|
ORDER BY artist.name
|
|
|
|
|
"
|
|
|
|
|
);
|
|
|
|
|
return $query->result();
|
|
|
|
|
}
|
2024-05-22 10:37:19 +02:00
|
|
|
}
|