grublox/home.php

107 lines
4.3 KiB
PHP

<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
<head>
<?php
require_once 'core/classes.php';
require_once 'core/classes/user.php';
$user = new User($con, $_SESSION['user']);
$himsgs = [
"Hello",
"What's up",
"How you doing",
"Ayo",
"Hola",
"Welcome",
"Welcome back",
"Hi",
"Hey",
"Heyyo",
"Howdy",
"Hi there",
"Ahoy"
];
$himsg = array_rand($himsgs);
$himsg = $himsgs[$himsg];
$getitstarted = new PartyStarter;
$getitstarted->header();
?>
</head>
<title><?php echo $sitename; ?></title>
<body>
<main class="container text-white" style="width: 100%;">
<br><br>
<img src="assets/renders/user/headshot?userId=<?php echo (int)htmlspecialchars($user->getID($con, $user->getUsername())); ?>" class="rounded-circle" width=190 height=190></img>
<span class="text-center" style="font-size: 2rem; margin-left: 6px;"><?php echo $himsg; ?>, <?php echo htmlspecialchars($user->getUsername()); ?>!</span>
<div style="margin-bottom: 50px;"></div>
<h4 class=" card-title" style="margin-bottom: 15px;">Friends (2)</h4>
<div class="card shadow-sm" style="height: 11.75rem;">
<div class="card-group" style=" margin-left: 10px; margin-top: 10px;">
<?php
$sql = "SELECT allStar FROM users";
$q = $con->prepare(str_replace('allStar', 'count(*)', $sql));
$q->execute();
$numberOfGames = $q->fetchColumn();
$q = $con->prepare(str_replace('allStar', '*', $sql));
$q->execute();
if ($numberOfGames >= 1) {
while ($usr = $q->fetch()) { ?>
<div class="card text-white border border-0" style="max-width: 130px;">
<a href="user?id=<?php echo (int)htmlspecialchars($usr["id"]); ?>" style="text-decoration: none; text-align: center; margin-bottom: 9px;">
<div class="card-body">
<img src="assets/renders/user/headshot?userId=<?php echo (int)htmlspecialchars($usr["id"]); ?>" class="rounded-circle" width=100 height=100 alt="<?php echo htmlspecialchars($usr["username"]); ?>"></img>
</div>
<small class="text-center text-white"><?php echo htmlspecialchars($usr["username"]); ?></small>
</a>
</div>
<?php }} ?>
</div>
</div>
<br>
<h4 class=" card-title">Recently played</h4>
<div class="card-group" style=" margin-top: 15px;">
<div class="card border-start rounded shadow-sm" style="max-width: 170px; margin-right: 9px;">
<a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;">
<img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="...">
<div class="card-body">
<small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small><br>
<small class="card-text text-muted">69 playing</small>
<div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;">
<div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<i class="bi bi-hand-thumbs-up-fill text-secondary" style="font-size: 1rem; float: left; margin-top: -8px;"></i>
</div>
</a>
</div>
<div class="card border-start rounded shadow-sm" style="max-width: 170px; margin-right: 9px;">
<a href="game?id=1" style="text-decoration: none; text-align: left; margin-bottom: 9px;">
<img src="https://tr.rbxcdn.com/4e0bd5c77756dce55561929587ff8772/150/150/Image/Png" class="card-img-top rounded-top" alt="...">
<div class="card-body">
<small class="card-title text-white" style="font-size: 1rem;">Build to survive ur mom</small><br>
<small class="card-text text-muted">69 playing</small>
<div class="progress rounded-4 border border-secondary" style="margin-left: 20px; margin-top: 10px; margin-bottom: -10px; height: 8px; background: none;">
<div class="progress-bar bg-secondary" role="progressbar" aria-label="Segment one" style="width: 21.5%" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<i class="bi bi-hand-thumbs-up-fill text-secondary" style="font-size: 1rem; float: left; margin-top: -8px;"></i>
</div>
</a>
</div>
</div>
</main>
</body>
</html>