<!DOCTYPE html>
<html>
<head>
<title>F3 Netze Subnetzvergabe</title>
<link rel="stylesheet" href="bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>
<body>
<div id="container" style="margin: 20px auto; width: 95%; max-width: 1200px;">
<?php
include("config.php");
include("function.php");
$query = $dbh->query("select (select count(assign) from ip where assign = 1) as assign, (select count(assign) from ip where assign != '1') as notassign, (select count(*) from ip) as allnetworks");
$result = $query->fetchAll(PDO::FETCH_OBJ);
foreach($result as $row) {
echo 'Es sind '.$row->allnetworks.' Netzwerke in der Datenbank, davon sind '.$row->assign.' Netzwerke zugeordnet und noch '.$row->notassign.' Netzwerke frei<br />';
}
echo "Die Liste wird minütlich aktualisiert";
echo '<table class="table"><thead class="thead-dark"><tr><td>ip</td><td>Zuletzt gesehen</td><td>Wurde jemals announced</td><td>Status</td></tr></thead>';
$query = $dbh->query("SELECT * FROM ip WHERE assign = '1'");
$result = $query->fetchAll(PDO::FETCH_OBJ);
foreach($result as $row) {
$datum = date("d.m.Y", $row->last_announce);
$uhrzeit = date("H:i", $row->last_announce);
$zeit = '' . $datum . ' - ' . $uhrzeit . ' Uhr';
if ($row->act_announce == 1) {
echo '<tr><td>' . $row->ip . '</td><td>' . $zeit . '</td><td>' . $row->was_announce .'</td><td>Wird aktuell announced</td></tr>';
} else {
echo '<tr><td>' . $row->ip . '</td><td>' . $zeit . '</td><td>' . $row->was_announce .'</td><td>Wird aktuell nicht announced</td></tr>';
}
}
?>
</div>
</body></html>