Update classes.php
This commit is contained in:
parent
4a93e2a541
commit
d0d3e8fde5
|
|
@ -6,32 +6,33 @@ session_start();
|
|||
require('core/config.php');
|
||||
|
||||
class PartyStarter {
|
||||
// creates header
|
||||
function header()
|
||||
{
|
||||
echo "test";
|
||||
}
|
||||
function bootstrap() {
|
||||
echo '<link rel="stylesheet" href="css/bootstrap.min.css">';
|
||||
}
|
||||
function buildloggedoutheader() {
|
||||
function header() {
|
||||
// to not confuse you i renamed it from loggedoutheader to header since qzip made it both lol
|
||||
require('core/config.php');
|
||||
$showhome = '';
|
||||
if(isset($_SESSION['user'])) {
|
||||
$showhome = ' <li class="nav-item" style="color: #FFFFFF;">
|
||||
<a class="nav-link active" href="/home">Home
|
||||
<span class="visually-hidden">(current)</span>
|
||||
</a>
|
||||
</li>';
|
||||
$query = $con->prepare('SELECT money FROM users WHERE id=:id');
|
||||
$query->bindParam(':id', $id);
|
||||
$query->execute();
|
||||
$money = $query->fetch(PDO::FETCH_ASSOC)["money"];
|
||||
$currencyIcon = "$";
|
||||
$query->execute();
|
||||
$money = $query->fetch(PDO::FETCH_ASSOC)["money"] ?? "-0";
|
||||
|
||||
if ($money < 1000000) {
|
||||
// Anything less than a million
|
||||
$money = $currencyIcon.number_format($money);
|
||||
$money = number_format($money);
|
||||
} else if ($money < 1000000000) {
|
||||
// Anything less than a billion
|
||||
$money = $currencyIcon.number_format($money / 1000000, 1) . 'M';
|
||||
$money = number_format($money / 1000000, 1) . 'M';
|
||||
} else {
|
||||
// At least a billion
|
||||
$money = $currencyIcon.number_format($money / 1000000000, 1) . 'B';
|
||||
$money = number_format($money / 1000000000, 1) . 'B';
|
||||
|
||||
}
|
||||
// messy shit sorry mario1 fix it urself :trol:
|
||||
|
|
@ -58,11 +59,7 @@ class PartyStarter {
|
|||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarColor03">
|
||||
<ul class="navbar-nav me-auto ml-auto" style="color: #FFFFFF;">
|
||||
<li class="nav-item" style="color: #FFFFFF;">
|
||||
<a class="nav-link active" href="/home">Home
|
||||
<span class="visually-hidden">(current)</span>
|
||||
</a>
|
||||
</li>
|
||||
' . $showhome . '
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/games">Games</a>
|
||||
</li>
|
||||
|
|
@ -85,4 +82,4 @@ class PartyStarter {
|
|||
|
||||
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue