Add new views and styles for music application
- Created new CSS files for styling the application, including home.css and style.css. - Implemented 403 and 404 error views with appropriate messages and navigation. - Developed a dump view to display deleted elements with restoration options. - Enhanced home view to include music search functionality and display results. - Added listplay view for managing music playlists, including creation and deletion options. - Implemented loadmusic view for uploading new music with necessary fields. - Created login and register views for user authentication. - Developed sound view to display individual music tracks with playback controls and options for liking and deleting. - Updated menu view to include navigation links based on user authentication status.
This commit is contained in:
36
controller/listplayer/ListMusic.controller.php
Normal file
36
controller/listplayer/ListMusic.controller.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
class ListMusic extends Connection{
|
||||
private $table = 'listmusic';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if(!parent::tableExists($this->table)){
|
||||
parent::execNoQuery("CREATE TABLE $this->table(
|
||||
idListMusic INTEGER(10) PRIMARY KEY AUTO_INCREMENT,
|
||||
idMusic INTEGER(10) NOT NULL,
|
||||
idList INTEGER(10) NOT NULL,
|
||||
dateListMusic TIMESTAMP DEFAULT NOW(),
|
||||
deleteListMusic BOOLEAN DEFAULT FALSE
|
||||
)");
|
||||
}
|
||||
}
|
||||
|
||||
protected function newMusicToList(array $data){
|
||||
parent::execNoQuery("INSERT INTO $this->table(idMusic,idList) VALUES({$data['idMusic']}, {$data['idList']})");
|
||||
}
|
||||
|
||||
protected function existsMusicInList(int $idMusic, int $idList){
|
||||
$result = parent::getData("SELECT * FROM $this->table WHERE idMusic=$idMusic AND idList=$idList");
|
||||
return !empty($result);
|
||||
}
|
||||
|
||||
protected function getList(int $idList){
|
||||
$Music = new Music();
|
||||
$musics = parent::getData("SELECT * FROM $this->table WHERE idList=$idList AND NOT deleteListMusic");
|
||||
foreach($musics as $index => $music){
|
||||
$musics[$index]['music'] = $Music->getMusic($music['idMusic']);
|
||||
}
|
||||
return $musics;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user