1e versie
This commit is contained in:
31
public/admin.php
Normal file
31
public/admin.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once __DIR__ . '/../includes/functions.php';
|
||||
require_once __DIR__ . '/../includes/db.php';
|
||||
|
||||
if (!isset($_SESSION['user']) || !isAdmin($_SESSION['user'])) {
|
||||
header('Location: dashboard.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$bericht = '';
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['nieuwe_ronde'])) {
|
||||
$lootjes = startNieuweRonde($pdo);
|
||||
$bericht = 'Nieuwe ronde gestart!';
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head><title>Beheer</title></head>
|
||||
<body>
|
||||
<h2>Beheerpagina</h2>
|
||||
<?php if ($bericht): ?><p style="color:green"><?= htmlspecialchars($bericht) ?></p><?php endif; ?>
|
||||
|
||||
<form method="post">
|
||||
<button type="submit" name="nieuwe_ronde">Start nieuwe lootjes-ronde</button>
|
||||
</form>
|
||||
|
||||
<p><a href="dashboard.php">Terug</a></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user