From 57097a3c8a51abe516a35b31954f0fbf37693777 Mon Sep 17 00:00:00 2001 From: ui0ppk <113091876+ui0ppk@users.noreply.github.com> Date: Tue, 24 Jan 2023 21:45:10 +0200 Subject: [PATCH] Registering + Config + Code Cleanup --- core/classes.php | 58 ++++++++++++++++++++++++++++++--------- core/classes/user.php | 54 ++++++++++++++++++++++++++++++++++++ core/config.php | 5 ++++ index.php | 4 +-- login.php | 64 +++++++++++++++++++++++++++++++++++++++++++ logout.php | 6 ++++ register.php | 51 ++++++++++++++++++++-------------- 7 files changed, 206 insertions(+), 36 deletions(-) create mode 100644 core/classes/user.php create mode 100644 logout.php diff --git a/core/classes.php b/core/classes.php index 49f00eb..0f329d2 100644 --- a/core/classes.php +++ b/core/classes.php @@ -1,5 +1,10 @@ '; } function buildloggedoutheader() { + require('core/config.php'); + if(isset($_SESSION['user'])) { + $query = $con->prepare('SELECT money FROM users WHERE id=:id'); + $query->bindParam(':id', $id); + $query->execute(); + $money = $query->fetch(PDO::FETCH_ASSOC)["money"]; + + 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 = '
{"data"}; ?>
+{"data"}; ?>