91 lines
4.3 KiB
PHP
91 lines
4.3 KiB
PHP
<?php
|
|
require ('core/config.php');
|
|
|
|
class PartyStarter {
|
|
function bootstrap() {
|
|
echo '<link rel="stylesheet" href="css/bootstrap.min.css">
|
|
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js" integrity="sha384-mQ93GR66B00ZXjt0YO5KlohRA5SY2XofN4zfuZxLkoj1gXtW8ANNCe9d5Y3eG5eD" crossorigin="anonymous"></script>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css">';
|
|
}
|
|
function header() {
|
|
// to not confuse you i renamed it from loggedoutheader to header since qzip made it both lol
|
|
require ('core/config.php');
|
|
$grubloxlogotohome = '<a class="navbar-brand text-dark" href="/"><div class="headerLogo d-inline-block align-top" alt=""></div></a>';
|
|
$showhome = '';
|
|
if (isset($_SESSION['user'])) {
|
|
$showhome = ' <li class="nav-item text-dark" style="color: #FFFFFF;">
|
|
<a class="nav-link text-dark" href="/home"><i class="bi bi-house"></i> Home
|
|
<span class="visually-hidden">(current)</span>
|
|
</a>
|
|
</li>';
|
|
$grubloxlogotohome = '<a class="navbar-brand text-dark" href="/home"><div class="headerLogo d-inline-block align-top" alt=""></div></a>';
|
|
$query = $con->prepare('SELECT money FROM users WHERE id=:id');
|
|
$query->bindParam(':id', $id);
|
|
$query->execute();
|
|
$money = $query->fetch(PDO::FETCH_ASSOC) ["money"] ?? "-0";
|
|
|
|
if ($money < 1000000) {
|
|
// Anything less than a million
|
|
$money = number_format($money);
|
|
}
|
|
else if ($money < 1000000000) {
|
|
// Anything less than a billion
|
|
$money = number_format($money / 1000000, 1) . 'M';
|
|
}
|
|
else {
|
|
// At least a billion
|
|
$money = number_format($money / 1000000000, 1) . 'B';
|
|
|
|
}
|
|
// messy shit sorry mario1 fix it urself :trol:
|
|
$rightside = '<li class="nav-item"><a class="nav-link text-dark">' . $money . '</a></li> <li class="nav-item">
|
|
<a class="nav-link text-dark" href="/logout"><i class="bi bi-box-arrow-right"></i> Logout</a>
|
|
</li>';
|
|
}
|
|
else {
|
|
$rightside = '
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" href="/register">Register</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" href="/login">Login</a>
|
|
</li>';
|
|
}
|
|
echo '
|
|
<link rel="stylesheet" href="css/bootstrap.min.css"><link rel="stylesheet" href="/css/global.css">
|
|
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js" integrity="sha384-mQ93GR66B00ZXjt0YO5KlohRA5SY2XofN4zfuZxLkoj1gXtW8ANNCe9d5Y3eG5eD" crossorigin="anonymous"></script>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css">
|
|
<nav class="navbar navbar-expand-lg navbar-light sticky-top" style="background-color: #ff7700; height: 45px; ">
|
|
<div class="container-fluid">
|
|
' . $grubloxlogotohome . '
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarColor03" aria-controls="navbarColor03" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarColor03">
|
|
<ul class="navbar-nav me-auto ml-auto" style="color: #FFFFFF;">
|
|
' . $showhome . '
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" href="/games"><i class="bi bi-controller"></i> Games</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" href="/catalog"><i class="bi bi-shop"></i> Catalog</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" href="/about"><i class="bi bi-question-circle"></i> About</a>
|
|
</li>
|
|
</ul>
|
|
<ul class="navbar-nav">
|
|
<li class="nav-item">
|
|
</li>
|
|
' . $rightside . '
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>';
|
|
}
|
|
|
|
}
|
|
?>
|