'; } function header() { // to not confuse you i renamed it from loggedoutheader to header since qzip made it both lol require 'core/config.php'; $grubloxlogotohome = 'G GRUBLOX'; $showhome = ''; $adminTab = " "; if (isset($_SESSION['user'])) { $showhome = ' '; $query = $con->prepare('SELECT COUNT(id) FROM users WHERE id=:id'); $query->bindParam(':id', $_SESSION['user'], PDO::PARAM_INT); $query->execute(); $userExists = $query->fetchColumn(); if($userExists <= 1) { // php me when } else { unset($_SESSION["user"]); } $query = $con->prepare('SELECT * FROM users WHERE id=:id'); $query->bindParam(':id', $_SESSION['user'], PDO::PARAM_INT); $query->execute(); // if admin if($query->fetch(PDO::FETCH_ASSOC)["admin"] >= 1) { $adminTab = ' '; } else { $adminTab = " "; } $grubloxlogotohome = 'G GRUBLOX'; $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); $time = time(); $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 $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 = ' '; } else { $rightside = ' '; } echo ' '; } } ?>