-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathStatus.php
80 lines (68 loc) · 2.17 KB
/
Status.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
include 'content/configs/config.php';
include 'content/configs/regex.php';
function dat_loader($class) {
include 'class/' . $class . '.php';
}
spl_autoload_register('dat_loader');
$DB = new Database;
$DB->InitDB();
$SP = new StatusPage($DB,false);
if (isset($_GET["token"])) {
$token = $_GET["token"];
}
$servers = $SP->getServersbyToken($token);
include 'content/header.html';
echo '<body><div class="container">';
?>
<?php
if (empty($servers['name'])) {
?>
<div class="row">
<div class="col-md-8 column col-sm-offset-2">
<div class="alert alert-danger text-center">Status Page was not found!</div>
</div>
</div>
<?php
}
else {
?>
<div class="row">
<div class="col-md-12 col-sm-offset-2">
<h3><?php echo Page::escape($servers['name']); ?></h3>
</div>
</div>
<div class="row clearfix">
<div class="col-md-8 column col-sm-offset-2">
<div class="panel panel-<?php echo ($servers['operational'] == 1 ? "success" : "warning"); ?>">
<div class="panel-heading">
<h3 class="panel-title">
<?php echo ($servers['operational'] == 1 ? "All Systems Operational" : "Not All Systems Operational"); ?>
</h3>
</div>
</div>
<div class="row clearfix">
<div class="col-md-12 column">
<div class="list-group">
<?php
foreach($servers['servers'] as $server)
{
echo '<div class="list-group-item">
<h4 class="list-group-item-heading">'.Page::escape($server['Name']).'
<span class="pull-right">
<div class="text-'.($server['Status'] == 1 ? "success" : "danger").'" id="fs-small">'.($server['Status'] == 1 ? "Operational" : "Not Operational").'</div>
</span>
</h4>
</div>';
}
?>
</div>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
<?php include 'content/footer.html'; ?>