From cfd5763bcf88b29d8e5eefe30ef357ad0b8d819a Mon Sep 17 00:00:00 2001 From: ui0ppk Date: Sat, 11 Feb 2023 19:11:59 +0200 Subject: [PATCH] ye so much --- admin.php | 0 .../user/{thumbnail.php => fullbody.php} | 0 catalog.php | 8 +- core/classes.php | 40 ++++-- core/classes/user.php | 12 ++ core/config.php | 6 +- css/global.css | 14 ++ games.php | 2 +- home.php | 2 +- item.php | 122 ++++++++++++++++-- user.php | 18 +-- 11 files changed, 190 insertions(+), 34 deletions(-) create mode 100644 admin.php rename assets/renders/user/{thumbnail.php => fullbody.php} (100%) diff --git a/admin.php b/admin.php new file mode 100644 index 0000000..e69de29 diff --git a/assets/renders/user/thumbnail.php b/assets/renders/user/fullbody.php similarity index 100% rename from assets/renders/user/thumbnail.php rename to assets/renders/user/fullbody.php diff --git a/catalog.php b/catalog.php index ccf8c26..b2fd52a 100644 --- a/catalog.php +++ b/catalog.php @@ -47,6 +47,12 @@ if(isset($_GET["filter"])) { $page = null; } +$sql = "SELECT allStar FROM catalog ORDER BY RAND() LIMIT 1"; +$q = $con->prepare(str_replace('allStar', 'name', $sql)); +$q->execute(); +$random_search_array = $q->fetch(); +$random_search = array_rand($random_search_array, 1); + $getitstarted = new PartyStarter; $getitstarted->header(); ?> @@ -57,7 +63,7 @@ $getitstarted->header();
diff --git a/core/classes.php b/core/classes.php index 1617602..68fd29d 100644 --- a/core/classes.php +++ b/core/classes.php @@ -1,5 +1,6 @@ - Home + Home (current) '; @@ -37,7 +38,7 @@ class PartyStarter { // if admin if($query->fetch(PDO::FETCH_ASSOC)["admin"] >= 1) { - $adminTab = ' '; } else { @@ -45,7 +46,28 @@ class PartyStarter { } $grubloxlogotohome = 'G GRUBLOX'; - $money = $query->fetch(PDO::FETCH_ASSOC)["money"] ?? "0"; + $user = new User($con, $_SESSION['user']); + $money = $user->getMoney(false); + + if($user->getLastPaid() !== NULL) { + $dateToCheck = (int)$user->getLastPaid()+86400; + if($user->getLastPaid() >= $dateToCheck) { + $q = $con->prepare("UPDATE users SET money=money+:price WHERE id=:id"); + $q->bindParam(':id',$_SESSION['user'],PDO::PARAM_INT); + $q->bindParam(':price',$pay,PDO::PARAM_INT); + $q->execute(); + } + } else { + $q = $con->prepare("UPDATE users SET lastPaid=:date WHERE id=:id"); + $q->bindParam(':id',$_SESSION['user'],PDO::PARAM_INT); + $q->bindParam(':date',time(),PDO::PARAM_INT); + $q->execute(); + + $q = $con->prepare("UPDATE users SET money=money+:price WHERE id=:id"); + $q->bindParam(':id',$_SESSION['user'],PDO::PARAM_INT); + $q->bindParam(':price',$pay,PDO::PARAM_INT); + $q->execute(); + } if ($money < 1000000) { // Anything less than a million @@ -66,7 +88,7 @@ class PartyStarter {