dj_mix_hosting_software/genres.php
Cody Cook 70c8a87e15
All checks were successful
SonarQube Scan / SonarQube Trigger (push) Successful in 30s
Changes.
2024-05-19 20:01:13 -07:00

51 lines
1.6 KiB
PHP

<?php
require_once 'includes/globals.php';
require_once 'vendor/autoload.php';
use DJMixHosting\Database;
use DJMixHosting\Genres;
$genresFound = false;
// if there's a query parameter named 'dj', load the DJ class
$db = new Database($config);
$genres = new Genres($db);
$title = $locale['genres'];
require_once 'includes/header.php';
?>
<section>
<div class="container py-5">
<div class="row">
<div class="col">
<nav aria-label="breadcrumb" class="bg-body-tertiary rounded-3 p-3 mb-4">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="/"><?php echo $locale['home']; ?></a></li>
<li class="breadcrumb-item active"><a href="/genres"><?php echo $locale['genres']; ?></a>
</li>
</ol>
</nav>
</div>
</div>
<?php
// we have a list of genres; we need to create them as cards
// loop through $genres->get_all_genres
// create a card for each genre, 4 max per row
$genres = $genres->get_nonzero_genres();
$count = 0;
foreach ($genres as $genre) {
card_output($count, $genre, $locale);
echo '<a href="/genre/' . $genre['slug'] . '" class="btn btn-primary">' . $locale['view'] . '</a>';
echo '</div>';
echo '</div>';
echo '</div>';
if ($count % 4 == 3) {
echo '</div>';
}
$count++;
}
?>
</div>
</section>
<?php require_once 'includes/footer.php'; ?>