100 lines
4.1 KiB
PHP
100 lines
4.1 KiB
PHP
<?php
|
|
require_once 'core/classes.php';
|
|
require_once 'core/classes/user.php';
|
|
headStart();
|
|
require_once('core/config.php');
|
|
if($maintenance && $pagename !== "Maintenance") {
|
|
header("Location: /maintenance"
|
|
); }
|
|
$user = new User($con, $_SESSION['user'] ?? 0);
|
|
if(!$user->isLoggedIn()) {
|
|
header('location: /login');
|
|
exit;
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html data-bs-theme="dark">
|
|
<head>
|
|
<?php
|
|
if(isAdmin() == '0') {
|
|
header('Location: /home');
|
|
exit;
|
|
}
|
|
$getitstarted = new PartyStarter;
|
|
$getitstarted->header();
|
|
if(isset($_GET['p'])) {
|
|
$page = $_GET['p'];
|
|
} else {
|
|
$page = 1;
|
|
}
|
|
$limit = 18;
|
|
$page -= 1;
|
|
$offset = $page * $limit;
|
|
|
|
?>
|
|
</head>
|
|
<title><?php echo $pagename; ?> | <?php echo $sitename; ?></title>
|
|
<body>
|
|
<main class="container d-flex flex-column mt-4" style="height: 90vh;">
|
|
<h2> <span class="grufont">G </span><span class="gotham"><?php echo strtoupper($sitename); ?></span> </span> Admin Panel </h2>
|
|
<div class="d-flex align-items-start">
|
|
<div class="nav flex-column nav-pills me-3" id="v-pills-tab" role="tablist" aria-orientation="vertical">
|
|
<button class="nav-link active" id="users-tab" data-bs-toggle="pill" data-bs-target="#users" type="button" role="tab" aria-controls="users" aria-selected="true">Users</button>
|
|
<button class="nav-link" id="games-tab" data-bs-toggle="pill" data-bs-target="#games" type="button" role="tab" aria-controls="games" aria-selected="false">Games</button>
|
|
<button class="nav-link" id="catalog-tab" data-bs-toggle="pill" data-bs-target="#catalog" type="button" role="tab" aria-controls="catalog" aria-selected="false">Catalog</button>
|
|
<button class="nav-link" id="jobs-tab" data-bs-toggle="pill" data-bs-target="#jobs" type="button" role="tab" aria-controls="jobs" aria-selected="false">Jobs</button>
|
|
<button class="nav-link" id="v-pills-settings-tab" data-bs-toggle="pill" data-bs-target="#v-pills-settings" type="button" role="tab" aria-controls="v-pills-settings" aria-selected="false">Settings</button>
|
|
</div>
|
|
<div class="tab-content w-100" id="v-pills-tabContent">
|
|
<div class="tab-pane fade show active" id="users" role="tabpanel" aria-labelledby="users-tab" tabindex="0">
|
|
|
|
<table class="table table-dark table-striped border">
|
|
<thead>
|
|
<tr class="border">
|
|
<th scope="col" class="border">ID</th>
|
|
<th scope="col" class="border">User</th>
|
|
<th scope="col" class="border">Date registered</th>
|
|
<th scope="col" class="border">Money</th>
|
|
<th scope="col" class="border">Admin</th>
|
|
<th scope="col" class="border">Banned</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$b = $con->prepare('SELECT * FROM bans');
|
|
$b->execute();
|
|
$banned = $b->fetchAll();
|
|
$q = $con->prepare('SELECT * FROM users');
|
|
//$q->bindParam(':name',$_POST['name']);
|
|
$q->execute();
|
|
$users = $q->fetchAll();
|
|
foreach ($users as $user) {
|
|
$sUser = New User($con, $user['id']);
|
|
?>
|
|
<tr style="vertical-align: middle;">
|
|
<th scope="row"><?php echo $user['id']; ?></th>
|
|
<td><img class="rounded-5 me-1" height=32 width=32 src="/assets/renders/user/headshot?userId=<?php echo $user['id']; ?>"><?php echo $user['username']; ?></td>
|
|
<td><?php echo $user['date']; ?></td>
|
|
<td><?php echo $sUser->getMoney(true)." (".$sUser->getMoney(false).")"; ?></td>
|
|
<?php if($user['admin'] == 1) { echo "<td>True</td>"; } else { echo "<td>False</td>"; } ?></td>
|
|
<?php foreach ($banned as $ban) {
|
|
echo '<td>False</td>'; } ?></td>
|
|
</tr>
|
|
<?php }?>
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
<div class="tab-pane fade" id="games" role="tabpanel" aria-labelledby="games-tab" tabindex="0">games to approve</div>
|
|
<div class="tab-pane fade" id="catalog" role="tabpanel" aria-labelledby="catalog-tab" tabindex="0">catalog items to approve and add custom ones that users cantt add...</div>
|
|
<div class="tab-pane fade" id="jobs" role="tabpanel" aria-labelledby="jobs-tab" tabindex="0">job execustionfg</div>
|
|
<div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab" tabindex="0">set if revival use key sistem or no.</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php $getitstarted->footer(); ?>
|
|
</main>
|
|
</body>
|
|
</html>
|