Files
lootjes/show_log.php
2025-11-12 11:20:27 +01:00

41 lines
1.1 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'])