Skip to content
Snippets Groups Projects
Commit 096cfcd2 authored by ammar's avatar ammar
Browse files

Redirect to album if clicked in music info

parent b9fec7cc
Branches
Tags
No related merge requests found
......@@ -8,9 +8,10 @@ $artist = 'Artist';
$album = 'Album';
$genre = 'Genre';
$year = 'Year';
$album_id = null;
function populateFields($id): void {
global $title, $artist, $album, $genre, $year;
global $title, $artist, $album, $genre, $year, $album_id;
$result = execSelect("SELECT * FROM music WHERE music_id = :id", ['id' => $id]);
......@@ -23,6 +24,7 @@ function populateFields($id): void {
$album = getAlbumName($result[0]['album_id']);
$genre = $result[0]['genre'] ?? 'Unknown';
$year = $result[0]['year'] ?? 'Unknown';
$album_id = $result[0]['album_id'];
}
$id = $_GET['id'] ?? null;
......@@ -55,7 +57,7 @@ if (is_numeric($id)) {
</div>
<div id="music-info">
<p id="artist-title"><?php echo $artist.' - '.$title ?></p>
<a href="#" id="album"><?php echo $album ?></a>
<a href="<?php echo '/album?id='.$album_id ?>" id="album"><?php echo $album ?></a>
<div id="more-info-container">
<div class="more-info">
<p id="genre"><?php echo $genre ?></p>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment