FontAwesome should have never copied over
This commit is contained in:
parent
9a3d58fc83
commit
88467e124d
6 changed files with 932 additions and 931 deletions
356
classes/DJ.php
356
classes/DJ.php
|
@ -1,179 +1,179 @@
|
|||
<?php
|
||||
|
||||
class DJ
|
||||
{
|
||||
|
||||
private int $id = -1;
|
||||
private string $name = "";
|
||||
private string $bio = "";
|
||||
private string $slug = "";
|
||||
private string $img = "img/no-image1.png";
|
||||
private bool $active = false;
|
||||
private bool $claimed = false;
|
||||
private string $email = "";
|
||||
private array $socials = [];
|
||||
|
||||
private string $created = "";
|
||||
private string $updated = "";
|
||||
private string $claimed_by = "";
|
||||
private $db = null;
|
||||
|
||||
|
||||
public function __construct($slug, $db)
|
||||
{
|
||||
$this->slug = $slug;
|
||||
$this->db = $db;
|
||||
if (!$this->load_from_slug()) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private function load_from_slug(): bool
|
||||
{
|
||||
$socials = [];
|
||||
$dj = $this->get_dj_by_slug($this->slug);
|
||||
if ($dj) {
|
||||
if (isset($dj['id'])) {
|
||||
$this->id = $dj['id'];
|
||||
}
|
||||
if (isset($dj['name'])) {
|
||||
$this->name = $dj['name'];
|
||||
}
|
||||
if (isset($dj['bio'])) {
|
||||
$this->bio = $dj['bio'];
|
||||
}
|
||||
if (isset($dj['img'])) {
|
||||
|
||||
// is this legacy code?
|
||||
// the code is legacy if it starts with /dj/,
|
||||
// if it does, prefix with https://www.utahsdjs.com
|
||||
if (substr($dj['img'], 0, 5) == "/djs/") {
|
||||
// remove /djs/ from the string
|
||||
$dj['img'] = substr($dj['img'], 4);
|
||||
$this->img = "https://cdn.utahsdjs.com" . $dj['img'];
|
||||
} else {
|
||||
$this->img = $dj['img'];
|
||||
}
|
||||
}
|
||||
if (isset($dj['email'])) {
|
||||
$this->email = $dj['email'];
|
||||
}
|
||||
|
||||
if (isset($dj['facebook_url'])) {
|
||||
$this->socials['facebook'] = $dj['facebook_url'];
|
||||
}
|
||||
if (isset($dj['instagram_url'])) {
|
||||
$this->socials['instagram'] = $dj['instagram_url'];
|
||||
}
|
||||
if (isset($dj['twitter_url'])) {
|
||||
$this->socials['twitter'] = $dj['twitter_url'];
|
||||
}
|
||||
|
||||
if (isset($dj['myspace_url'])) {
|
||||
$this->socials['myspace'] = $dj['myspace_url'];
|
||||
}
|
||||
if (isset($dj['soundcloud_url'])) {
|
||||
$this->socials['soundcloud'] = $dj['soundcloud_url'];
|
||||
}
|
||||
if (isset($dj['mixcloud_url'])) {
|
||||
$this->socials['mixcloud'] = $dj['mixcloud_url'];
|
||||
}
|
||||
if (isset($dj['spotify_url'])) {
|
||||
$this->socials['spotify'] = $dj['spotify_url'];
|
||||
}
|
||||
|
||||
if (isset($dj['active'])) {
|
||||
$this->active = $dj['active'];
|
||||
}
|
||||
|
||||
|
||||
if (isset($dj['claimed_by']) && $dj['claimed_by'] != null) {
|
||||
// TODO: pull some quick data on the user who claimed this DJ
|
||||
$this->claimed = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (isset($dj['created'])) {
|
||||
$this->created = $dj['created'];
|
||||
}
|
||||
if (isset($dj['updated'])) {
|
||||
$this->updated = $dj['updated'];
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function get_dj_by_slug($slug)
|
||||
{
|
||||
$stmt = $this->db->prepare("SELECT * FROM djs WHERE slug = ?");
|
||||
$stmt->bind_param("s", $slug);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$dj = $result->fetch_assoc();
|
||||
$stmt->close();
|
||||
return $dj;
|
||||
}
|
||||
|
||||
public function get_slug(): string
|
||||
{
|
||||
return $this->slug;
|
||||
}
|
||||
|
||||
public function get_id(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function get_name(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function get_bio(): string
|
||||
{
|
||||
return $this->bio;
|
||||
}
|
||||
|
||||
public function get_img(): string
|
||||
{
|
||||
return $this->img;
|
||||
}
|
||||
|
||||
public function get_active(): bool
|
||||
{
|
||||
return $this->active;
|
||||
}
|
||||
|
||||
public function get_email(): string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function get_socials(): array
|
||||
{
|
||||
return $this->socials;
|
||||
}
|
||||
|
||||
public function get_created(): string
|
||||
{
|
||||
return $this->created;
|
||||
}
|
||||
|
||||
public function get_updated(): string
|
||||
{
|
||||
return $this->updated;
|
||||
}
|
||||
|
||||
public function get_claimed(): bool
|
||||
{
|
||||
return $this->claimed;
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
class DJ
|
||||
{
|
||||
|
||||
private int $id = -1;
|
||||
private string $name = "";
|
||||
private string $bio = "";
|
||||
private string $slug = "";
|
||||
private string $img = "img/no-image1.png";
|
||||
private bool $active = false;
|
||||
private bool $claimed = false;
|
||||
private string $email = "";
|
||||
private array $socials = [];
|
||||
|
||||
private string $created = "";
|
||||
private string $updated = "";
|
||||
private string $claimed_by = "";
|
||||
private $db = null;
|
||||
|
||||
|
||||
public function __construct($slug, $db)
|
||||
{
|
||||
$this->slug = $slug;
|
||||
$this->db = $db;
|
||||
if (!$this->load_from_slug()) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private function load_from_slug(): bool
|
||||
{
|
||||
$socials = [];
|
||||
$dj = $this->get_dj_by_slug($this->slug);
|
||||
if ($dj) {
|
||||
if (isset($dj['id'])) {
|
||||
$this->id = $dj['id'];
|
||||
}
|
||||
if (isset($dj['name'])) {
|
||||
$this->name = $dj['name'];
|
||||
}
|
||||
if (isset($dj['bio'])) {
|
||||
$this->bio = $dj['bio'];
|
||||
}
|
||||
if (isset($dj['img'])) {
|
||||
|
||||
// is this legacy code?
|
||||
// the code is legacy if it starts with /dj/,
|
||||
// if it does, prefix with https://www.utahsdjs.com
|
||||
if (substr($dj['img'], 0, 5) == "/djs/") {
|
||||
// remove /djs/ from the string
|
||||
$dj['img'] = substr($dj['img'], 4);
|
||||
$this->img = "https://cdn.utahsdjs.com" . $dj['img'];
|
||||
} else {
|
||||
$this->img = $dj['img'];
|
||||
}
|
||||
}
|
||||
if (isset($dj['email'])) {
|
||||
$this->email = $dj['email'];
|
||||
}
|
||||
|
||||
if (isset($dj['facebook_url'])) {
|
||||
$this->socials['facebook'] = $dj['facebook_url'];
|
||||
}
|
||||
if (isset($dj['instagram_url'])) {
|
||||
$this->socials['instagram'] = $dj['instagram_url'];
|
||||
}
|
||||
if (isset($dj['twitter_url'])) {
|
||||
$this->socials['twitter'] = $dj['twitter_url'];
|
||||
}
|
||||
|
||||
if (isset($dj['myspace_url'])) {
|
||||
$this->socials['myspace'] = $dj['myspace_url'];
|
||||
}
|
||||
if (isset($dj['soundcloud_url'])) {
|
||||
$this->socials['soundcloud'] = $dj['soundcloud_url'];
|
||||
}
|
||||
if (isset($dj['mixcloud_url'])) {
|
||||
$this->socials['mixcloud'] = $dj['mixcloud_url'];
|
||||
}
|
||||
if (isset($dj['spotify_url'])) {
|
||||
$this->socials['spotify'] = $dj['spotify_url'];
|
||||
}
|
||||
|
||||
if (isset($dj['active'])) {
|
||||
$this->active = $dj['active'];
|
||||
}
|
||||
|
||||
|
||||
if (isset($dj['claimed_by']) && $dj['claimed_by'] != null) {
|
||||
// TODO: pull some quick data on the user who claimed this DJ
|
||||
$this->claimed = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (isset($dj['created'])) {
|
||||
$this->created = $dj['created'];
|
||||
}
|
||||
if (isset($dj['updated'])) {
|
||||
$this->updated = $dj['updated'];
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function get_dj_by_slug($slug)
|
||||
{
|
||||
$stmt = $this->db->prepare("SELECT * FROM djs WHERE slug = ?");
|
||||
$stmt->bind_param("s", $slug);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$dj = $result->fetch_assoc();
|
||||
$stmt->close();
|
||||
return $dj;
|
||||
}
|
||||
|
||||
public function get_slug(): string
|
||||
{
|
||||
return $this->slug;
|
||||
}
|
||||
|
||||
public function get_id(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function get_name(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function get_bio(): string
|
||||
{
|
||||
return $this->bio;
|
||||
}
|
||||
|
||||
public function get_img(): string
|
||||
{
|
||||
return $this->img;
|
||||
}
|
||||
|
||||
public function get_active(): bool
|
||||
{
|
||||
return $this->active;
|
||||
}
|
||||
|
||||
public function get_email(): string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function get_socials(): array
|
||||
{
|
||||
return $this->socials;
|
||||
}
|
||||
|
||||
public function get_created(): string
|
||||
{
|
||||
return $this->created;
|
||||
}
|
||||
|
||||
public function get_updated(): string
|
||||
{
|
||||
return $this->updated;
|
||||
}
|
||||
|
||||
public function get_claimed(): bool
|
||||
{
|
||||
return $this->claimed;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,102 +1,102 @@
|
|||
<?php
|
||||
|
||||
class Genre
|
||||
{
|
||||
|
||||
private $id = "" ;
|
||||
private $enabled = "";
|
||||
private $count = "";
|
||||
private $name = "";
|
||||
private $slug = "";
|
||||
private $db = "";
|
||||
|
||||
public function __construct($value, $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
if (intval($value)) {
|
||||
$this->id = $value;
|
||||
if ($this->load_by_id()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$this->slug = $value;
|
||||
if ($this->load_by_slug()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function load_by_id(): bool
|
||||
{
|
||||
$genre = $this->get_genre_by_id();
|
||||
if ($genre && $genre['name'] != "") {
|
||||
$this->enabled = $genre['enabled'];
|
||||
$this->count = $genre['count'];
|
||||
$this->name = $genre['name'];
|
||||
$this->slug = $genre['slug'];
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function get_genre_by_id()
|
||||
{
|
||||
$stmt = $this->db->prepare("SELECT * FROM genres WHERE id = ?");
|
||||
$stmt->bind_param("i", $this->id);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$dj = $result->fetch_assoc();
|
||||
$stmt->close();
|
||||
return $dj;
|
||||
}
|
||||
|
||||
private function load_by_slug(): bool
|
||||
{
|
||||
$genre = $this->get_genre_by_slug();
|
||||
|
||||
if ($genre && $genre['name'] != "") {
|
||||
$this->id = $genre['id'];
|
||||
$this->enabled = $genre['enabled'];
|
||||
$this->count = $genre['count'];
|
||||
$this->name = $genre['name'];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
private function get_genre_by_slug()
|
||||
{
|
||||
$stmt = $this->db->prepare("SELECT * FROM genres WHERE slug = ?");
|
||||
$stmt->bind_param("s", $this->slug);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$dj = $result->fetch_assoc();
|
||||
$stmt->close();
|
||||
return $dj;
|
||||
}
|
||||
|
||||
public function get_slug(): string
|
||||
{
|
||||
return $this->slug;
|
||||
}
|
||||
|
||||
public function get_id(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function get_name(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
class Genre
|
||||
{
|
||||
|
||||
private $id = "" ;
|
||||
private $enabled = "";
|
||||
private $count = "";
|
||||
private $name = "";
|
||||
private $slug = "";
|
||||
private $db = "";
|
||||
|
||||
public function __construct($value, $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
if (intval($value)) {
|
||||
$this->id = $value;
|
||||
if ($this->load_by_id()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$this->slug = $value;
|
||||
if ($this->load_by_slug()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function load_by_id(): bool
|
||||
{
|
||||
$genre = $this->get_genre_by_id();
|
||||
if ($genre && $genre['name'] != "") {
|
||||
$this->enabled = $genre['enabled'];
|
||||
$this->count = $genre['count'];
|
||||
$this->name = $genre['name'];
|
||||
$this->slug = $genre['slug'];
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function get_genre_by_id()
|
||||
{
|
||||
$stmt = $this->db->prepare("SELECT * FROM genres WHERE id = ?");
|
||||
$stmt->bind_param("i", $this->id);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$dj = $result->fetch_assoc();
|
||||
$stmt->close();
|
||||
return $dj;
|
||||
}
|
||||
|
||||
private function load_by_slug(): bool
|
||||
{
|
||||
$genre = $this->get_genre_by_slug();
|
||||
|
||||
if ($genre && $genre['name'] != "") {
|
||||
$this->id = $genre['id'];
|
||||
$this->enabled = $genre['enabled'];
|
||||
$this->count = $genre['count'];
|
||||
$this->name = $genre['name'];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
private function get_genre_by_slug()
|
||||
{
|
||||
$stmt = $this->db->prepare("SELECT * FROM genres WHERE slug = ?");
|
||||
$stmt->bind_param("s", $this->slug);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$dj = $result->fetch_assoc();
|
||||
$stmt->close();
|
||||
return $dj;
|
||||
}
|
||||
|
||||
public function get_slug(): string
|
||||
{
|
||||
return $this->slug;
|
||||
}
|
||||
|
||||
public function get_id(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function get_name(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
|
||||
}
|
624
dj.php
624
dj.php
|
@ -1,313 +1,313 @@
|
|||
<?php
|
||||
|
||||
// read toml config file
|
||||
require_once 'vendor/autoload.php';
|
||||
require_once 'functions/i18n.php';
|
||||
require_once 'classes/Database.php';
|
||||
require_once 'classes/DJ.php';
|
||||
|
||||
use Yosymfony\Toml\Toml;
|
||||
|
||||
$config = Toml::ParseFile('includes/config.toml');
|
||||
$lang = $_SESSION['lang'] ?? $config['app']['locale'];
|
||||
$locale = loadLocale($lang);
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<!doctype html >
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?php echo $config['app']['name']; ?></title>
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="fontawesome/css/all.css" rel="stylesheet" />
|
||||
|
||||
|
||||
</head>
|
||||
<body style="background-color: #eee;">
|
||||
<?php require 'navbar.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="#"><?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>";
|
||||
}
|
||||
|
||||
?>
|
||||
</p>
|
||||
<p class="text-muted mb-4">$location1</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>
|
||||
<div class="card mb-4 mb-lg-0">
|
||||
<div class="card-body p-0">
|
||||
<ul class="list-group list-group-flush rounded-3">
|
||||
<?php
|
||||
function social_line($social, $value): string
|
||||
{
|
||||
$icon = "";
|
||||
$url = "";
|
||||
$color = "#000000";
|
||||
|
||||
switch ($social) {
|
||||
case "facebook":
|
||||
$icon = "fa-brands fa-facebook";
|
||||
$url = "https://www.facebook.com/$value";
|
||||
$color = "#3b5998";
|
||||
$name = "Facebook";
|
||||
break;
|
||||
case "instagram":
|
||||
$icon = "fa-brands fa-instagram";
|
||||
$url = "https://www.instagram.com/$value";
|
||||
$color = "#ac2bac";
|
||||
$name = "Instagram";
|
||||
break;
|
||||
case "twitter":
|
||||
$icon = "fa-brands fa-twitter";
|
||||
$url = "https://www.twitter.com/$value";
|
||||
$color = "#55acee";
|
||||
$name = "Twitter";
|
||||
break;
|
||||
case "myspace":
|
||||
$icon = "fa-brands fa-myspace";
|
||||
$url = "https://www.myspace.com/$value";
|
||||
$color = "#000000";
|
||||
$name = "Myspace";
|
||||
break;
|
||||
case "soundcloud":
|
||||
$icon = "fa-brands fa-soundcloud";
|
||||
$url = "https://www.soundcloud.com/$value";
|
||||
$color = "#ff8800";
|
||||
$name = "Soundcloud";
|
||||
break;
|
||||
case "mixcloud":
|
||||
$icon = "fa-brands fa-mixcloud";
|
||||
$url = "https://www.mixcloud.com/$value";
|
||||
$color = "#00c7f7";
|
||||
$name = "Mixcloud";
|
||||
break;
|
||||
case "spotify":
|
||||
$icon = "fa-brands fa-spotify";
|
||||
$url = "https://www.spotify.com/$value";
|
||||
$color = "#1DB954";
|
||||
$name = "Spotify";
|
||||
break;
|
||||
}
|
||||
|
||||
return "
|
||||
<li class='list-group-item d-flex justify-content-between align-items-center p-3'>
|
||||
<i class='fa $icon fa-lg' style='color: $color;'></i>
|
||||
<p class='mb-0'><a href='$url'>$value</a>
|
||||
</p>
|
||||
</li>";
|
||||
}
|
||||
$socials = $dj->get_socials();
|
||||
|
||||
foreach ($socials as $key => $value) {
|
||||
echo social_line($key, $value);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</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">Full Name</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">Johnatan Smith</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Email</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">example@example.com</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Phone</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">(097) 234-5678</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Mobile</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">(098) 765-4321</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Address</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">Bay Area, San Francisco, CA</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card mb-4 mb-md-0">
|
||||
<div class="card-body">
|
||||
<p class="mb-4"><span class="text-primary font-italic me-1">assigment</span> Project
|
||||
Status
|
||||
</p>
|
||||
<p class="mb-1" style="font-size: .77rem;">Web Design</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 80%"
|
||||
aria-valuenow="80"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Website Markup</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 72%"
|
||||
aria-valuenow="72"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">One Page</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 89%"
|
||||
aria-valuenow="89"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Mobile Template</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 55%"
|
||||
aria-valuenow="55"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Backend API</p>
|
||||
<div class="progress rounded mb-2" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 66%"
|
||||
aria-valuenow="66"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card mb-4 mb-md-0">
|
||||
<div class="card-body">
|
||||
<p class="mb-4"><span class="text-primary font-italic me-1">assigment</span> Project
|
||||
Status
|
||||
</p>
|
||||
<p class="mb-1" style="font-size: .77rem;">Web Design</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 80%"
|
||||
aria-valuenow="80"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Website Markup</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 72%"
|
||||
aria-valuenow="72"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">One Page</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 89%"
|
||||
aria-valuenow="89"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Mobile Template</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 55%"
|
||||
aria-valuenow="55"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Backend API</p>
|
||||
<div class="progress rounded mb-2" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 66%"
|
||||
aria-valuenow="66"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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>
|
||||
</section>
|
||||
|
||||
</body>
|
||||
<?php
|
||||
|
||||
// read toml config file
|
||||
require_once 'vendor/autoload.php';
|
||||
require_once 'functions/i18n.php';
|
||||
require_once 'classes/Database.php';
|
||||
require_once 'classes/DJ.php';
|
||||
|
||||
use Yosymfony\Toml\Toml;
|
||||
|
||||
$config = Toml::ParseFile('includes/config.toml');
|
||||
$lang = $_SESSION['lang'] ?? $config['app']['locale'];
|
||||
$locale = loadLocale($lang);
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<!doctype html >
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?php echo $config['app']['name']; ?></title>
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="fontawesome/css/all.css" rel="stylesheet" />
|
||||
|
||||
|
||||
</head>
|
||||
<body style="background-color: #eee;">
|
||||
<?php require 'navbar.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="#"><?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>";
|
||||
}
|
||||
|
||||
?>
|
||||
</p>
|
||||
<p class="text-muted mb-4">$location1</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>
|
||||
<div class="card mb-4 mb-lg-0">
|
||||
<div class="card-body p-0">
|
||||
<ul class="list-group list-group-flush rounded-3">
|
||||
<?php
|
||||
function social_line($social, $value): string
|
||||
{
|
||||
$icon = "";
|
||||
$url = "";
|
||||
$color = "#000000";
|
||||
|
||||
switch ($social) {
|
||||
case "facebook":
|
||||
$icon = "fa-brands fa-facebook";
|
||||
$url = "https://www.facebook.com/$value";
|
||||
$color = "#3b5998";
|
||||
$name = "Facebook";
|
||||
break;
|
||||
case "instagram":
|
||||
$icon = "fa-brands fa-instagram";
|
||||
$url = "https://www.instagram.com/$value";
|
||||
$color = "#ac2bac";
|
||||
$name = "Instagram";
|
||||
break;
|
||||
case "twitter":
|
||||
$icon = "fa-brands fa-twitter";
|
||||
$url = "https://www.twitter.com/$value";
|
||||
$color = "#55acee";
|
||||
$name = "Twitter";
|
||||
break;
|
||||
case "myspace":
|
||||
$icon = "fa-brands fa-myspace";
|
||||
$url = "https://www.myspace.com/$value";
|
||||
$color = "#000000";
|
||||
$name = "Myspace";
|
||||
break;
|
||||
case "soundcloud":
|
||||
$icon = "fa-brands fa-soundcloud";
|
||||
$url = "https://www.soundcloud.com/$value";
|
||||
$color = "#ff8800";
|
||||
$name = "Soundcloud";
|
||||
break;
|
||||
case "mixcloud":
|
||||
$icon = "fa-brands fa-mixcloud";
|
||||
$url = "https://www.mixcloud.com/$value";
|
||||
$color = "#00c7f7";
|
||||
$name = "Mixcloud";
|
||||
break;
|
||||
case "spotify":
|
||||
$icon = "fa-brands fa-spotify";
|
||||
$url = "https://www.spotify.com/$value";
|
||||
$color = "#1DB954";
|
||||
$name = "Spotify";
|
||||
break;
|
||||
}
|
||||
|
||||
return "
|
||||
<li class='list-group-item d-flex justify-content-between align-items-center p-3'>
|
||||
<i class='fa $icon fa-lg' style='color: $color;'></i>
|
||||
<p class='mb-0'><a href='$url'>$value</a>
|
||||
</p>
|
||||
</li>";
|
||||
}
|
||||
$socials = $dj->get_socials();
|
||||
|
||||
foreach ($socials as $key => $value) {
|
||||
echo social_line($key, $value);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</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">Full Name</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">Johnatan Smith</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Email</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">example@example.com</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Phone</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">(097) 234-5678</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Mobile</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">(098) 765-4321</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Address</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">Bay Area, San Francisco, CA</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card mb-4 mb-md-0">
|
||||
<div class="card-body">
|
||||
<p class="mb-4"><span class="text-primary font-italic me-1">assigment</span> Project
|
||||
Status
|
||||
</p>
|
||||
<p class="mb-1" style="font-size: .77rem;">Web Design</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 80%"
|
||||
aria-valuenow="80"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Website Markup</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 72%"
|
||||
aria-valuenow="72"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">One Page</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 89%"
|
||||
aria-valuenow="89"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Mobile Template</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 55%"
|
||||
aria-valuenow="55"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Backend API</p>
|
||||
<div class="progress rounded mb-2" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 66%"
|
||||
aria-valuenow="66"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card mb-4 mb-md-0">
|
||||
<div class="card-body">
|
||||
<p class="mb-4"><span class="text-primary font-italic me-1">assigment</span> Project
|
||||
Status
|
||||
</p>
|
||||
<p class="mb-1" style="font-size: .77rem;">Web Design</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 80%"
|
||||
aria-valuenow="80"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Website Markup</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 72%"
|
||||
aria-valuenow="72"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">One Page</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 89%"
|
||||
aria-valuenow="89"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Mobile Template</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 55%"
|
||||
aria-valuenow="55"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Backend API</p>
|
||||
<div class="progress rounded mb-2" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 66%"
|
||||
aria-valuenow="66"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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>
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
1
fontawesome
Symbolic link
1
fontawesome
Symbolic link
|
@ -0,0 +1 @@
|
|||
fontawesome-free-6.5.2-web
|
626
genre.php
626
genre.php
|
@ -1,314 +1,314 @@
|
|||
<?php
|
||||
|
||||
// read toml config file
|
||||
require_once 'vendor/autoload.php';
|
||||
require_once 'functions/i18n.php';
|
||||
require_once 'classes/Database.php';
|
||||
require_once 'classes/Genre.php';
|
||||
|
||||
use Yosymfony\Toml\Toml;
|
||||
|
||||
$config = Toml::ParseFile('includes/config.toml');
|
||||
$lang = $_SESSION['lang'] ?? $config['app']['locale'];
|
||||
$locale = loadLocale($lang);
|
||||
$genre= null;
|
||||
$genreFound = false;
|
||||
// if there's a query parameter named 'dj', load the DJ class
|
||||
$db = new Database($config);
|
||||
$genreRequested = false;
|
||||
if (isset($_GET['genre']) && $_GET['genre'] != "") {
|
||||
$genre = new Genre($_GET['genre'], $db);
|
||||
if ($genre->get_name() != "") {
|
||||
$genreRequested = true;
|
||||
$genreFound = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<!doctype html >
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?php echo $config['app']['name']; ?></title>
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="fontawesome/css/all.css" rel="stylesheet"/>
|
||||
|
||||
|
||||
</head>
|
||||
<body style="background-color: #eee;">
|
||||
<?php require 'navbar.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="#"><?php echo $locale['genres']; ?></a></li>
|
||||
<li class="breadcrumb-item active"
|
||||
aria-current="page"><?php
|
||||
if ($genre && $genre->get_name() != "") {
|
||||
echo $genre->get_name();
|
||||
} else {
|
||||
echo $locale['notfound'];
|
||||
}
|
||||
?></li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($genreNotFound): ?>
|
||||
<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>";
|
||||
}
|
||||
|
||||
?>
|
||||
</p>
|
||||
<p class="text-muted mb-4">$location1</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>
|
||||
<div class="card mb-4 mb-lg-0">
|
||||
<div class="card-body p-0">
|
||||
<ul class="list-group list-group-flush rounded-3">
|
||||
<?php
|
||||
function social_line($social, $value): string
|
||||
{
|
||||
$icon = "";
|
||||
$url = "";
|
||||
$color = "#000000";
|
||||
|
||||
switch ($social) {
|
||||
case "facebook":
|
||||
$icon = "fa-brands fa-facebook";
|
||||
$url = "https://www.facebook.com/$value";
|
||||
$color = "#3b5998";
|
||||
$name = "Facebook";
|
||||
break;
|
||||
case "instagram":
|
||||
$icon = "fa-brands fa-instagram";
|
||||
$url = "https://www.instagram.com/$value";
|
||||
$color = "#ac2bac";
|
||||
$name = "Instagram";
|
||||
break;
|
||||
case "twitter":
|
||||
$icon = "fa-brands fa-twitter";
|
||||
$url = "https://www.twitter.com/$value";
|
||||
$color = "#55acee";
|
||||
$name = "Twitter";
|
||||
break;
|
||||
case "myspace":
|
||||
$icon = "fa-brands fa-myspace";
|
||||
$url = "https://www.myspace.com/$value";
|
||||
$color = "#000000";
|
||||
$name = "Myspace";
|
||||
break;
|
||||
case "soundcloud":
|
||||
$icon = "fa-brands fa-soundcloud";
|
||||
$url = "https://www.soundcloud.com/$value";
|
||||
$color = "#ff8800";
|
||||
$name = "Soundcloud";
|
||||
break;
|
||||
case "mixcloud":
|
||||
$icon = "fa-brands fa-mixcloud";
|
||||
$url = "https://www.mixcloud.com/$value";
|
||||
$color = "#00c7f7";
|
||||
$name = "Mixcloud";
|
||||
break;
|
||||
case "spotify":
|
||||
$icon = "fa-brands fa-spotify";
|
||||
$url = "https://www.spotify.com/$value";
|
||||
$color = "#1DB954";
|
||||
$name = "Spotify";
|
||||
break;
|
||||
}
|
||||
|
||||
return "
|
||||
<li class='list-group-item d-flex justify-content-between align-items-center p-3'>
|
||||
<i class='fa $icon fa-lg' style='color: $color;'></i>
|
||||
<p class='mb-0'><a href='$url'>$value</a>
|
||||
</p>
|
||||
</li>";
|
||||
}
|
||||
$socials = $dj->get_socials();
|
||||
|
||||
foreach ($socials as $key => $value) {
|
||||
echo social_line($key, $value);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</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">Full Name</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">Johnatan Smith</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Email</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">example@example.com</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Phone</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">(097) 234-5678</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Mobile</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">(098) 765-4321</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Address</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">Bay Area, San Francisco, CA</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card mb-4 mb-md-0">
|
||||
<div class="card-body">
|
||||
<p class="mb-4"><span class="text-primary font-italic me-1">assigment</span> Project
|
||||
Status
|
||||
</p>
|
||||
<p class="mb-1" style="font-size: .77rem;">Web Design</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 80%"
|
||||
aria-valuenow="80"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Website Markup</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 72%"
|
||||
aria-valuenow="72"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">One Page</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 89%"
|
||||
aria-valuenow="89"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Mobile Template</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 55%"
|
||||
aria-valuenow="55"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Backend API</p>
|
||||
<div class="progress rounded mb-2" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 66%"
|
||||
aria-valuenow="66"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card mb-4 mb-md-0">
|
||||
<div class="card-body">
|
||||
<p class="mb-4"><span class="text-primary font-italic me-1">assigment</span> Project
|
||||
Status
|
||||
</p>
|
||||
<p class="mb-1" style="font-size: .77rem;">Web Design</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 80%"
|
||||
aria-valuenow="80"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Website Markup</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 72%"
|
||||
aria-valuenow="72"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">One Page</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 89%"
|
||||
aria-valuenow="89"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Mobile Template</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 55%"
|
||||
aria-valuenow="55"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Backend API</p>
|
||||
<div class="progress rounded mb-2" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 66%"
|
||||
aria-valuenow="66"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<?php echo $locale['genreNotFound']; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</body>
|
||||
<?php
|
||||
|
||||
// read toml config file
|
||||
require_once 'vendor/autoload.php';
|
||||
require_once 'functions/i18n.php';
|
||||
require_once 'classes/Database.php';
|
||||
require_once 'classes/Genre.php';
|
||||
|
||||
use Yosymfony\Toml\Toml;
|
||||
|
||||
$config = Toml::ParseFile('includes/config.toml');
|
||||
$lang = $_SESSION['lang'] ?? $config['app']['locale'];
|
||||
$locale = loadLocale($lang);
|
||||
$genre= null;
|
||||
$genreFound = false;
|
||||
// if there's a query parameter named 'dj', load the DJ class
|
||||
$db = new Database($config);
|
||||
$genreRequested = false;
|
||||
if (isset($_GET['genre']) && $_GET['genre'] != "") {
|
||||
$genre = new Genre($_GET['genre'], $db);
|
||||
if ($genre->get_name() != "") {
|
||||
$genreRequested = true;
|
||||
$genreFound = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<!doctype html >
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?php echo $config['app']['name']; ?></title>
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="fontawesome/css/all.css" rel="stylesheet"/>
|
||||
|
||||
|
||||
</head>
|
||||
<body style="background-color: #eee;">
|
||||
<?php require 'navbar.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="#"><?php echo $locale['genres']; ?></a></li>
|
||||
<li class="breadcrumb-item active"
|
||||
aria-current="page"><?php
|
||||
if ($genre && $genre->get_name() != "") {
|
||||
echo $genre->get_name();
|
||||
} else {
|
||||
echo $locale['notfound'];
|
||||
}
|
||||
?></li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($genreNotFound): ?>
|
||||
<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>";
|
||||
}
|
||||
|
||||
?>
|
||||
</p>
|
||||
<p class="text-muted mb-4">$location1</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>
|
||||
<div class="card mb-4 mb-lg-0">
|
||||
<div class="card-body p-0">
|
||||
<ul class="list-group list-group-flush rounded-3">
|
||||
<?php
|
||||
function social_line($social, $value): string
|
||||
{
|
||||
$icon = "";
|
||||
$url = "";
|
||||
$color = "#000000";
|
||||
|
||||
switch ($social) {
|
||||
case "facebook":
|
||||
$icon = "fa-brands fa-facebook";
|
||||
$url = "https://www.facebook.com/$value";
|
||||
$color = "#3b5998";
|
||||
$name = "Facebook";
|
||||
break;
|
||||
case "instagram":
|
||||
$icon = "fa-brands fa-instagram";
|
||||
$url = "https://www.instagram.com/$value";
|
||||
$color = "#ac2bac";
|
||||
$name = "Instagram";
|
||||
break;
|
||||
case "twitter":
|
||||
$icon = "fa-brands fa-twitter";
|
||||
$url = "https://www.twitter.com/$value";
|
||||
$color = "#55acee";
|
||||
$name = "Twitter";
|
||||
break;
|
||||
case "myspace":
|
||||
$icon = "fa-brands fa-myspace";
|
||||
$url = "https://www.myspace.com/$value";
|
||||
$color = "#000000";
|
||||
$name = "Myspace";
|
||||
break;
|
||||
case "soundcloud":
|
||||
$icon = "fa-brands fa-soundcloud";
|
||||
$url = "https://www.soundcloud.com/$value";
|
||||
$color = "#ff8800";
|
||||
$name = "Soundcloud";
|
||||
break;
|
||||
case "mixcloud":
|
||||
$icon = "fa-brands fa-mixcloud";
|
||||
$url = "https://www.mixcloud.com/$value";
|
||||
$color = "#00c7f7";
|
||||
$name = "Mixcloud";
|
||||
break;
|
||||
case "spotify":
|
||||
$icon = "fa-brands fa-spotify";
|
||||
$url = "https://www.spotify.com/$value";
|
||||
$color = "#1DB954";
|
||||
$name = "Spotify";
|
||||
break;
|
||||
}
|
||||
|
||||
return "
|
||||
<li class='list-group-item d-flex justify-content-between align-items-center p-3'>
|
||||
<i class='fa $icon fa-lg' style='color: $color;'></i>
|
||||
<p class='mb-0'><a href='$url'>$value</a>
|
||||
</p>
|
||||
</li>";
|
||||
}
|
||||
$socials = $dj->get_socials();
|
||||
|
||||
foreach ($socials as $key => $value) {
|
||||
echo social_line($key, $value);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</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">Full Name</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">Johnatan Smith</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Email</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">example@example.com</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Phone</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">(097) 234-5678</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Mobile</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">(098) 765-4321</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<p class="mb-0">Address</p>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<p class="text-muted mb-0">Bay Area, San Francisco, CA</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card mb-4 mb-md-0">
|
||||
<div class="card-body">
|
||||
<p class="mb-4"><span class="text-primary font-italic me-1">assigment</span> Project
|
||||
Status
|
||||
</p>
|
||||
<p class="mb-1" style="font-size: .77rem;">Web Design</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 80%"
|
||||
aria-valuenow="80"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Website Markup</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 72%"
|
||||
aria-valuenow="72"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">One Page</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 89%"
|
||||
aria-valuenow="89"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Mobile Template</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 55%"
|
||||
aria-valuenow="55"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Backend API</p>
|
||||
<div class="progress rounded mb-2" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 66%"
|
||||
aria-valuenow="66"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card mb-4 mb-md-0">
|
||||
<div class="card-body">
|
||||
<p class="mb-4"><span class="text-primary font-italic me-1">assigment</span> Project
|
||||
Status
|
||||
</p>
|
||||
<p class="mb-1" style="font-size: .77rem;">Web Design</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 80%"
|
||||
aria-valuenow="80"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Website Markup</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 72%"
|
||||
aria-valuenow="72"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">One Page</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 89%"
|
||||
aria-valuenow="89"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Mobile Template</p>
|
||||
<div class="progress rounded" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 55%"
|
||||
aria-valuenow="55"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<p class="mt-4 mb-1" style="font-size: .77rem;">Backend API</p>
|
||||
<div class="progress rounded mb-2" style="height: 5px;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 66%"
|
||||
aria-valuenow="66"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<?php echo $locale['genreNotFound']; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
54
navbar.php
54
navbar.php
|
@ -1,28 +1,28 @@
|
|||
<header class="navbar sticky-top bg-dark flex-md-nowrap p-0 shadow" data-bs-theme="dark">
|
||||
<a class="navbar-brand col-md-3 col-lg-2 me-0 px-3 fs-6 text-white" href="#"><?php echo $config['app']['name'];?></a>
|
||||
|
||||
<ul class="navbar-nav flex-row d-md-none">
|
||||
<li class="nav-item text-nowrap">
|
||||
<button class="nav-link px-3 text-white" type="button" data-bs-toggle="collapse"
|
||||
data-bs-target="#navbarSearch" aria-controls="navbarSearch" aria-expanded="false"
|
||||
aria-label="Toggle search">
|
||||
<svg class="bi">
|
||||
<use xlink:href="#search"/>
|
||||
</svg>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item text-nowrap">
|
||||
<button class="nav-link px-3 text-white" type="button" data-bs-toggle="offcanvas"
|
||||
data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false"
|
||||
aria-label="Toggle navigation">
|
||||
<svg class="bi">
|
||||
<use xlink:href="#list"/>
|
||||
</svg>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="navbarSearch" class="navbar-search w-100 collapse">
|
||||
<input class="form-control w-100 rounded-0 border-0" type="text" placeholder="Search" aria-label="Search">
|
||||
</div>
|
||||
<header class="navbar sticky-top bg-dark flex-md-nowrap p-0 shadow" data-bs-theme="dark">
|
||||
<a class="navbar-brand col-md-3 col-lg-2 me-0 px-3 fs-6 text-white" href="#"><?php echo $config['app']['name'];?></a>
|
||||
|
||||
<ul class="navbar-nav flex-row d-md-none">
|
||||
<li class="nav-item text-nowrap">
|
||||
<button class="nav-link px-3 text-white" type="button" data-bs-toggle="collapse"
|
||||
data-bs-target="#navbarSearch" aria-controls="navbarSearch" aria-expanded="false"
|
||||
aria-label="Toggle search">
|
||||
<svg class="bi">
|
||||
<use xlink:href="#search"/>
|
||||
</svg>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item text-nowrap">
|
||||
<button class="nav-link px-3 text-white" type="button" data-bs-toggle="offcanvas"
|
||||
data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false"
|
||||
aria-label="Toggle navigation">
|
||||
<svg class="bi">
|
||||
<use xlink:href="#list"/>
|
||||
</svg>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="navbarSearch" class="navbar-search w-100 collapse">
|
||||
<input class="form-control w-100 rounded-0 border-0" type="text" placeholder="Search" aria-label="Search">
|
||||
</div>
|
||||
</header>
|
Loading…
Add table
Add a link
Reference in a new issue