<?php
$conn = new mysqli("localhost", "tasmoybb_tracker", "3XT3RN4l!337", "tasmoybb_tracking");
$result = $conn->query("SELECT * FROM visits ORDER BY visit_time DESC");
?>

<!DOCTYPE html>
<html>
<head>
<title>Visitor Logs</title>
<style>
body {
    background:#0b1220;
    color:#e8f0ff;
    font-family:Arial;
}
table {
    width:100%;
    border-collapse:collapse;
}
td, th {
    padding:10px;
    border:1px solid #1f2b4a;
}
tr:hover {
    background:#162447;
}
</style>
</head>
<body>

<h2>Visitor Logs</h2>

<table>
<tr>
<th>IP</th>
<th>Location</th>
<th>Device</th>
<th>Browser</th>
<th>Screen</th>
<th>Time</th>
</tr>

<?php while($row = $result->fetch_assoc()): ?>
<tr>
<td><?= $row['ip'] ?></td>
<td><?= $row['city'] ?>, <?= $row['country'] ?></td>
<td><?= $row['device'] ?></td>
<td><?= $row['browser'] ?></td>
<td><?= $row['screen_resolution'] ?></td>
<td><?= $row['visit_time'] ?></td>
</tr>
<?php endwhile; ?>

</table>

</body>
</html>