181 lines
8 KiB
PHP
181 lines
8 KiB
PHP
<?php
|
|
|
|
require 'includes/globals.php';
|
|
require_once 'classes/Database.php';
|
|
require_once 'classes/DJ.php';
|
|
require_once 'classes/Genre.php';
|
|
require_once 'classes/Mix.php';
|
|
|
|
// if there's a query parameter named 'dj', load the DJ class
|
|
$db = new Database($config);
|
|
$djFound = false;
|
|
if (isset($_GET['dj']) && $_GET['dj'] != "") {
|
|
$dj = new DJ($_GET['dj'], $db);
|
|
if ($dj->get_name() != "") {
|
|
$djFound = true;
|
|
}
|
|
}
|
|
$title = $dj->get_name();
|
|
require_once 'includes/header.php';
|
|
?>
|
|
<section style="background-color: #eee;">
|
|
<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"><a href="/djs.php"><?php echo $locale['djs']; ?></a></li>
|
|
<li class="breadcrumb-item active"
|
|
aria-current="page"><?php
|
|
if ($dj && $dj->get_name() != "") {
|
|
echo $dj->get_name();
|
|
} else {
|
|
echo $locale['notfound'];
|
|
}
|
|
?></li>
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if ($djFound): ?>
|
|
<div class="row">
|
|
<div class="col-lg-4">
|
|
<div class="card mb-4">
|
|
<div class="card-body text-center">
|
|
<img src="<?php echo $dj->get_img(); ?>"
|
|
alt="avatar"
|
|
class="rounded-circle img-fluid" style="width: 150px;">
|
|
<h5 class="my-3"><?php echo $dj->get_name();
|
|
?></h5>
|
|
<?php
|
|
|
|
if ($dj->get_claimed()) {
|
|
echo '<p class="text-muted mb-1">';
|
|
echo "<i class='fa fa-user-shield' style='color: gold'>Claimed</i>";
|
|
echo "</p>";
|
|
}
|
|
|
|
?>
|
|
<div class="d-flex justify-content-center mb-2">
|
|
<button type="button" data-mdb-button-init data-mdb-ripple-init class="btn btn-primary">
|
|
<?php echo $locale['follow']; ?>
|
|
</button>
|
|
<button type="button" data-mdb-button-init data-mdb-ripple-init
|
|
class="btn btn-outline-primary ms-1"><?php echo $locale['message']; ?>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
if ($dj->get_socials() != []) {
|
|
?>
|
|
<div class="card mb-4 mb-lg-0">
|
|
<div class="card-body p-0">
|
|
<ul class="list-group list-group-flush rounded-3">
|
|
<?php
|
|
$socials = $dj->get_socials();
|
|
foreach ($socials as $key => $value) {
|
|
echo social_line($key, $value);
|
|
}
|
|
?>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
</div>
|
|
<div class="col-lg-8">
|
|
<div class="card mb-4">
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<p class="mb-0"><?php echo $locale['djName']; ?></p>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
<p class="text-muted mb-0"><?php echo $dj->get_name(); ?></p>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
if ($dj->get_bio() != "") {
|
|
echo box_line($locale['bio'], $dj->get_bio());
|
|
}
|
|
echo box_line($locale['lastupdated'], $dj->get_updated());
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<div class="card mb-4">
|
|
<div class="card-body">
|
|
<?php
|
|
$mixes = $dj->get_dj_mixes();
|
|
$count = 0;
|
|
|
|
foreach ($mixes as $mix) {
|
|
$output = new Mix($mix['slug'], $db);
|
|
$genres = $output->get_genres();
|
|
$genrelist = [];
|
|
|
|
foreach ($genres as $genre) {
|
|
$genr = new Genre($genre, $db);
|
|
$genrelist[$genr->get_slug()] = $genr->get_name();
|
|
}
|
|
|
|
echo '<div class="row">'; // Start row for each mix
|
|
|
|
// Column for mix name and link
|
|
echo '<div class="col-md-4">';
|
|
echo '<p class="mb-0">';
|
|
echo '<a href="/mix.php?mix=' . $output->get_slug() . '">';
|
|
echo $output->get_name();
|
|
echo '</a>';
|
|
echo '</p>';
|
|
echo '</div>'; // End column
|
|
|
|
// Column for genres
|
|
echo '<div class="col-md-4">';
|
|
echo '<p class="mb-0">';
|
|
foreach ($genrelist as $slug => $name) {
|
|
echo ' <a href="/genre.php?genre=' . $slug . '">';
|
|
echo '<span class="">' . $name . '</span>';
|
|
echo '</a>';
|
|
}
|
|
echo '</p>';
|
|
echo '</div>'; // End column
|
|
|
|
// Column for duration
|
|
echo '<div class="col-md-4">';
|
|
echo '<p class="mb-0">';
|
|
$duration = $output->get_duration();
|
|
echo $duration['t'];
|
|
echo '</p>';
|
|
echo '</div>'; // End column
|
|
echo '</div>'; // End row
|
|
|
|
$count++;
|
|
// Add horizontal rule only if it's not the last mix
|
|
if ($count < count($mixes)) {
|
|
echo '<hr>';
|
|
}
|
|
}
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="row">
|
|
<div class="col">
|
|
<div class="alert alert-danger" role="alert">
|
|
<?php echo $locale['djNotFound']; ?>
|
|
</div>
|
|
</div>
|
|
</div><?php endif;?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<?php require 'includes/footer.php'; ?>
|