-
Notifications
You must be signed in to change notification settings - Fork 29
/
refresh_hosts.php
38 lines (29 loc) · 794 Bytes
/
refresh_hosts.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
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
require("config.inc.php");
require("func.inc.php");
$dbh = anubis_db_connect();
$result = $dbh->query($show_tables);
db_error();
while ($row = $result->fetch(PDO::FETCH_NUM))
{
if ($row[0] == "configuration")
$gotconfigtbl = 1;
if ($row[0] == "hosts")
$gothoststbl = 1;
}
if (!isset($gotconfigtbl))
include("configtbl.sql.php");
if (!isset($gothoststbl))
include("hoststbl.sql.php");
$config = get_config_data();
$result = $dbh->query("SELECT * FROM hosts ORDER BY name ASC");
if ($result)
{
echo create_host_header();
while ($host_data = $result->fetch(PDO::FETCH_ASSOC))
echo get_host_summary($host_data);
echo create_totals();
}
?>