-
Notifications
You must be signed in to change notification settings - Fork 48
/
summaryBrowsersCard.php
40 lines (38 loc) · 2.3 KB
/
summaryBrowsersCard.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
include_once('./inc/browsers.inc.php');
include_once('./inc/browserGeo.inc.php');
require('./vendor/autoload.php');
?>
<?php
$hookedBrowsersList = getHookedBrowsers();
foreach ($hookedBrowsersList as $row) {
$ua_info = parse_user_agent($row['userAgent']);
$geoloc = getGeoloc($row['browserId'], $row['publicIP']);
?>
<tr>
<?php
echo '<td><a href="browserDetails.php?browserId=' . htmlspecialchars($row['browserId']) . '" class="clientID">' . htmlspecialchars($row['browserId']) . '</a></td>';
// Process last activity as heartbeat
if(isAlive($row['lastHeatbeat'])) {
echo '<td class="align-middle"><img src="./images/online_button.png" height="20" width="20"/></td>';
}
else {
echo '<td class="align-middle"><img src="./images/offline_button.png" height="20" width="20"/></td>';
}
echo '<td>' . htmlspecialchars(date("d/m/Y H:i:s", strtotime($row['lastHeatbeat']))) . '</td>';
echo '<td>' . htmlspecialchars(date("d/m/Y H:i:s", strtotime($row['hookedDate']))) . '</td>';
echo '<td class="align-middle"><img src="./images/user_agent/platform/' . getPlatformIcon($ua_info['platform']) . '.png" height="20" width="20" title="' . htmlspecialchars($ua_info['platform']) . '"/></td>';
echo '<td class="align-middle"><img src="./images/user_agent/browser/' . getBrowserIcon($ua_info['browser']) . '.png" height="20" width="20" title="' . htmlspecialchars($ua_info['browser']) . '"/></td>';
echo '<td>' . htmlspecialchars($ua_info['version']) . '</td>';
echo '<td class="align-middle"><span class="fi fi-' . $geoloc['countryCode'] . ' fis" title="' . $geoloc['country'] . '"></span></td>';
echo '<td>' . htmlspecialchars($row['publicIP']) . '</td>';
echo '<td>' . htmlspecialchars($row['hostname']) . '</td>';
echo '<td>
<a class="btn btn-light shadow-none ui-action-icons-details p-1" href="browserDetails.php?browserId=' . htmlspecialchars($row['browserId']) . '" role="button"><i class="bi bi-search"></i></a>
<a class="btn btn-danger shadow-none ui-action-icons-delete p-1" href="index.php?delete=' . htmlspecialchars($row['browserId']) . '" role="button"><i class="bi bi-trash"></i></a>
</td>';
?>
</tr>
<?php
}
?>