prepare("SELECT * FROM system_logs WHERE DATE(created_at) BETWEEN :start AND :end ORDER BY id DESC LIMIT 2000"); $stmt->execute(['start' => $start_date, 'end' => $end_date]); while ($row = $stmt->fetch()) { $actionColor = 'text-primary bg-primary-subtle'; if(strpos($row['action'], 'Failed') !== false || strpos($row['action'], 'Delete') !== false) { $actionColor = 'text-danger bg-danger-subtle'; } else if(strpos($row['action'], 'Success') !== false || strpos($row['action'], 'Create') !== false) { $actionColor = 'text-success bg-success-subtle'; } else if(strpos($row['action'], 'Update') !== false) { $actionColor = 'text-warning bg-warning-subtle'; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } catch (PDOException $e) { echo ""; } ?>
วันเวลา ผู้ใช้งาน (CID / ชื่อ) การกระทำ (Action) รายละเอียด (Detail)
" . format_thai_date($row['created_at'], true) . "
" . htmlspecialchars($row['user_name'] ?? 'Unknown') . "
" . htmlspecialchars($row['user_id'] ?? '') . "
" . htmlspecialchars($row['action']) . "" . htmlspecialchars($row['detail']) . "
Error: " . $e->getMessage() . "