Use a layout for the dashboard
This commit is contained in:
1 parent
ec0391a150
commit
ed2d5d0b13
9 files changed
+551
-705
No files matched your search
@@ -84,77 +84,43 @@ $result = $conn->query($sql);
|
||||
$row = $result->fetch_assoc();
|
||||
$uploads = $row['COUNT(*)'];
|
||||
|
||||
$conn->close();
|
||||
|
||||
$size = formatUnitSize($totalSize);
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Xytriza's Uploading Service - Dashboard</title>
|
||||
<link rel="icon" href="/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend:wght@400&display=swap">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
<link rel="stylesheet" href="/dashboard/assets/main.css?v=<?php echo filemtime('/var/www/xus/webroot/dashboard/assets/main.css'); ?>">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script src="/dashboard/assets/main.js?v=<?php echo filemtime('/var/www/xus/webroot/dashboard/assets/main.js'); ?>"></script>
|
||||
<style>
|
||||
textarea {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="/assets/logo.png" alt="Xytriza's Uploading Service" height="40vw" width="40vw"></a>
|
||||
<a href="/dashboard/"><i class="fas fa-home sidebar-item"></i></a>
|
||||
<a href="/dashboard/gallery.php"><i class="fas fa-file-alt sidebar-item" style="margin-left: 20%;"></i></a>
|
||||
<a href="/dashboard/upload.php"><i class="fas fa-upload sidebar-item"></i></a>
|
||||
<a href="/dashboard/settings.php"><i class="fas fa-cog sidebar-item"></i></a>
|
||||
<a href="/dashboard/account.php" style="margin-top: auto;"><i class="fas fa-user-cog sidebar-item"></i></a>
|
||||
<?php
|
||||
if ($role === 1 || $role === 2) {
|
||||
echo '<a href="/dashboard/admin" class="sidebar-item"><i class="fas fa-user-shield"></i></a>';
|
||||
}
|
||||
?>
|
||||
<a href="javascript:logout()"><i class="fas fa-sign-out-alt sidebar-item"></i></a>
|
||||
</div>
|
||||
|
||||
<div id="notification-container"></div>
|
||||
|
||||
<div id="container">
|
||||
<div class="info-group">
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>Total Storage Used</strong></p>
|
||||
<p><?php echo $size;?></p>
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>Total Uploads</strong></p>
|
||||
<p><?php echo $uploads;?></p>
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>Total Users</strong></p>
|
||||
<p><?php echo $users;?></p>
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>Total Logins</strong></p>
|
||||
<p><?php echo $logins;?></p>
|
||||
</div>
|
||||
<div id="container">
|
||||
<div class="info-group">
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>Total Storage Used</strong></p>
|
||||
<p><?php echo $size; ?></p>
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>Total Uploads</strong></p>
|
||||
<p><?php echo $uploads; ?></p>
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>Total Users</strong></p>
|
||||
<p><?php echo $users; ?></p>
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>Total Logins</strong></p>
|
||||
<p><?php echo $logins; ?></p>
|
||||
</div>
|
||||
<p>Dynamic placeholders like %discord% (Discord link), %username% (user's name), %uploads% (user's upload count), %role% (user's role), %uid% (user ID), %storage% (user's storage usage), and date details (%year%, %month%, %monthformat%, %day%, %dayformat%, %date%) are automatically replaced with specific user or system information for personalized messages.</p>
|
||||
<form method="POST">
|
||||
<p>News</p>
|
||||
<textarea name="news"><?php echo $news; ?></textarea>
|
||||
<p>MOTD</p>
|
||||
<textarea name="motd"><?php echo $motd; ?></textarea>
|
||||
<button type="submit">Update</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<p>Dynamic placeholders like %discord% (Discord link), %username% (user's name), %uploads% (user's upload count),
|
||||
%role% (user's role), %uid% (user ID), %storage% (user's storage usage), and date details (%year%, %month%,
|
||||
%monthformat%, %day%, %dayformat%, %date%) are automatically replaced with specific user or system information
|
||||
for personalized messages.</p>
|
||||
<form method="POST">
|
||||
<p>News</p>
|
||||
<textarea name="news"><?php echo $news; ?></textarea>
|
||||
<p>MOTD</p>
|
||||
<textarea name="motd"><?php echo $motd; ?></textarea>
|
||||
<button type="submit">Update</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
$title = 'Admin Settings';
|
||||
include __DIR__ . '/../layout.php'; //this is the only way it wanted to work?
|
||||
?>
|
||||
Reference in new issue
Block a user