Files
2026-09-16 23:20:08 +07:00

39 lines
1.5 KiB
PHP

<?php
require_once 'header.php';
$stmt = $pdo->prepare("SELECT * FROM activity_logs ORDER BY created_at DESC");
$stmt->execute();
$logs = $stmt->fetchAll();
?>
<div class="mb-8">
<h1 class="text-3xl font-bold text-gray-900">ประวัติการทำงาน</h1>
</div>
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6">
<table class="datatable w-full text-left border-collapse">
<thead>
<tr>
<th class="border-b py-3 px-4 bg-gray-50">เวลา</th>
<th class="border-b py-3 px-4 bg-gray-50">ประเภทการทำงาน</th>
<th class="border-b py-3 px-4 bg-gray-50">รายละเอียด</th>
</tr>
</thead>
<tbody>
<?php foreach ($logs as $log): ?>
<tr class="hover:bg-gray-50">
<td class="border-b py-3 px-4"><?= date('d/m/Y H:i:s', strtotime($log['created_at'])) ?></td>
<td class="border-b py-3 px-4">
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">
<?= htmlspecialchars((string)$log['action_type']) ?>
</span>
</td>
<td class="border-b py-3 px-4"><?= htmlspecialchars((string)$log['action_details']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php require_once 'footer.php'; ?>