log
This commit is contained in:
40
show_log.php
Normal file
40
show_log.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?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'])
|
||||
Reference in New Issue
Block a user