<?php $leases = []; $filename = "dhcpleases.txt"; { } ?> <html> <head> <title>DHCP leases</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0$ <style> .content { padding: 40px 80px 0; } .monospace { font-family: monospace; font-size: 15px; } </style> </head> <body> <div class="content"> <h1>DHCP leases</h1> <table class="table table-striped table-hover table-bordered"> <caption> </caption> <thead> <tr> <th>Expire time</th> <th>MAC address</th> <th>IP address</th> <th>Hostname</th> </tr> </thead> <tbody> <?php foreach($leases as $lease): ?> <tr> <td><?=$lease[0]?></td> <td class="monospace"><?=$lease[1]?></td> <td class="monospace"><?=$lease[2]?></td> <td><a href="<?=strpos($lease[3], 'http') !== 0 ? "http://{$lease[3]}" : $lease[3]?>"><?=$lease[3]?></a></td> </tr> <?php endforeach ?> </tbody> </table> </div> </body> </html>