Add dashboard.php
This commit is contained in:
@@ -0,0 +1,81 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once 'includes/config.php';
|
||||||
|
require_once 'includes/auth.php';
|
||||||
|
require_once 'includes/functions.php';
|
||||||
|
|
||||||
|
requireLogin();
|
||||||
|
|
||||||
|
$username = $_SESSION['user'];
|
||||||
|
|
||||||
|
$languagePath =
|
||||||
|
userPath($username) .
|
||||||
|
'/languages';
|
||||||
|
|
||||||
|
$languages = [];
|
||||||
|
|
||||||
|
if (is_dir($languagePath)) {
|
||||||
|
|
||||||
|
$languages =
|
||||||
|
array_diff(
|
||||||
|
scandir($languagePath),
|
||||||
|
['.', '..']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Dashboard</title>
|
||||||
|
<link rel="stylesheet" href="assets/css/style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
|
||||||
|
<h1>Dashboard</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Welkom,
|
||||||
|
<?= htmlspecialchars($username) ?>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a href="logout.php">
|
||||||
|
Uitloggen
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
|
||||||
|
<h2>Mijn talen</h2>
|
||||||
|
|
||||||
|
<?php if (!$languages): ?>
|
||||||
|
|
||||||
|
<p>Nog geen talen.</p>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
|
||||||
|
<?php foreach ($languages as $lang): ?>
|
||||||
|
|
||||||
|
<li><?= htmlspecialchars($lang) ?></li>
|
||||||
|
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user