52 lines
1.6 KiB
PHP
52 lines
1.6 KiB
PHP
<?php
|
|
require __DIR__ . '/data/db.php'; // Zorg dat $pdo hier beschikbaar is
|
|
|
|
try {
|
|
$stmt = $pdo->query("SELECT id, gebruiker, actie, extra, tijd FROM log ORDER BY tijd DESC");
|
|
$logs = $stmt->fetchAll();
|
|
} catch (PDOException $e) {
|
|
die("Fout bij ophalen logs: " . $e->getMessage());
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="nl">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Lootjes Log</title>
|
|
<style>
|
|
table { border-collapse: collapse; width: 100%; }
|
|
th, td { border: 1px solid #ccc; padding: 8px; text-align: left; }
|
|
th { background-color: #f4f4f4; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h2>Lootjes Log</h2>
|
|
<?php if (count($logs) === 0): ?>
|
|
<p>Geen logregels gevonden.</p>
|
|
<?php else: ?>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Gebruiker</th>
|
|
<th>Actie</th>
|
|
<th>Extra</th>
|
|
<th>Tijd</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($logs as $log): ?>
|
|
<tr>
|
|
<td><?= htmlspecialchars($log['id']) ?></td>
|
|
<td><?= htmlspecialchars($log['gebruiker']) ?></td>
|
|
<td><?= htmlspecialchars($log['actie']) ?></td>
|
|
<td><?= htmlspecialchars($log['extra']) ?></td>
|
|
<td><?= htmlspecialchars($log['tijd']) ?></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
<?php endif; ?>
|
|
</body>
|
|
</html>
|