-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
42 lines (39 loc) · 1.38 KB
/
index.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
41
42
<?php
$arp = `arp -a`;
$lines = explode("\n", $arp);
$devices = array();
foreach ($lines as $line) {
$cols = preg_split('/\s+/', trim($line));
if (isset($cols[2]) && $cols[2] == 'dynamic') {
$temp = array();
$temp['ip'] = $cols[0];
$temp['mac'] = $cols[1];
$devices[] = $temp;
}
}
?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.4/css/bootstrap.min.css" integrity="sha256-SC9pI7daKIBEHzXq0JEtOr9yMl5V7yMMqoowsw8uzNs=" crossorigin="anonymous" />
<div class="container" style="margin-top:250px;">
<div class="row">
<div class="col-12">
<h1>KoFiDev Network</h1>
<p>Total Device : <?php echo count($devices) ?></p>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>IP</th>
<th>MAC</th>
</tr>
</thead>
<tbody>
<?php foreach ($devices as $device) { ?>
<tr>
<td><?php echo $device['ip']; ?></td>
<td><?php echo $device['mac']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>