This commit is contained in:
2024-06-19 14:08:59 +02:00
parent 9436fd05cc
commit 6bfbf46dcc
21 changed files with 854 additions and 236 deletions

View File

@@ -1,3 +1,11 @@
<?php
function format_duration($seconds) {
$minutes = floor($seconds / 60);
$seconds = $seconds % 60;
return sprintf("%02d:%02d", $minutes, $seconds);
}
?>
<!DOCTYPE html>
<html>
<body>
@@ -15,11 +23,37 @@
</figure>
</div>
<div class="column">
<p><strong>Album:</strong> <?= anchor("albums/view/{$song['albumId']}", $song['albumName']) ?> (<?= $song['year'] ?>)</p>
<p><strong>Artist:</strong> <?= $song['artistName'] ?></p>
<p><strong>Disk Number:</strong> <?= $song['diskNumber'] ?></p>
<p><strong>Track Number:</strong> <?= $song['number'] ?></p>
<p><strong>Duration:</strong> <?= $song['duration'] ?> seconds</p>
<div class="table-container">
<table class="table is-striped is-fullwidth">
<tbody>
<tr>
<th>Album</th>
<td><?= anchor("albums/view/{$song['albumId']}", $song['albumName']) ?> (<?= $song['year'] ?>)</td>
</tr>
<tr>
<th>Artist</th>
<td><?= $song['artistName'] ?></td>
</tr>
<tr>
<th>Disk Number</th>
<td><?= $song['diskNumber'] ?></td>
</tr>
<tr>
<th>Track Number</th>
<td><?= $song['number'] ?></td>
</tr>
<tr>
<th>Duration</th>
<td><?= format_duration($song['duration']) ?></td>
</tr>
</tbody>
</table>
</div>
<form method="post" action="<?= site_url('playlist/selectPlaylist') ?>">
<input type="hidden" name="itemId" value="<?= $song['songId'] ?>">
<input type="hidden" name="itemType" value="song">
<button type="submit" class="button is-link">Ajouter à la playlist</button>
</form>
</div>
</div>
</div>