2024-05-25 00:33:32 +02:00
|
|
|
<h5>Albums list</h5>
|
2024-06-17 13:37:47 +02:00
|
|
|
<div class="sorting-search">
|
|
|
|
<form action="<?= site_url('Albums/tri'); ?>" method="get" class="tri-form">
|
|
|
|
<button type="submit" name="Ctri" value="ASC" class="tri-button">Tri A-Z</button>
|
|
|
|
<button type="submit" name="Ctri" value="DESC" class="tri-button">Tri Z-A</button>
|
|
|
|
</form>
|
2024-06-16 02:41:12 +02:00
|
|
|
</ul>
|
2024-06-17 13:37:47 +02:00
|
|
|
<form action="<?= site_url('Albums/search'); ?>" method="get" class="search-form">
|
|
|
|
<input type="text" name="query" placeholder="Chercher des albums" class="search-input">
|
|
|
|
<button type="submit" class="search-button">Rechercher</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<?php if(isset($is_search) && $is_search): ?>
|
|
|
|
<form action="<?= site_url('Albums'); ?>" method="get" class="back-form">
|
|
|
|
<button type="submit" class="back-button">Retour à la liste complète</button>
|
|
|
|
</form>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<?php if(isset($is_search) && $is_search): ?>
|
|
|
|
<p>Nombre de résultats : <?php echo $num_results; ?></p>
|
|
|
|
<?php endif; ?>
|
2024-06-16 02:41:12 +02:00
|
|
|
|
2024-05-25 00:33:32 +02:00
|
|
|
<section class="list">
|
|
|
|
<?php
|
|
|
|
foreach($albums as $album){
|
2024-06-17 15:10:10 +02:00
|
|
|
echo "<div><article>";
|
|
|
|
echo "<header class='short-text'>";
|
|
|
|
echo anchor("music/view/{$album->id}", "{$album->name}");
|
|
|
|
echo "</header>";
|
|
|
|
echo '<img src="data:image/jpeg;base64,'.base64_encode($album->jpeg).'" />';
|
|
|
|
echo "<footer class='short-text'>{$album->year} - {$album->artistName}</footer>
|
|
|
|
</article></div>";
|
2024-05-25 00:33:32 +02:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</section>
|