forked from cainkilgore/geekstats.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
listServices.php
54 lines (50 loc) · 2.12 KB
/
listServices.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
<?php
include("header.php");
include("sqlConnection.php");
$siteConfig->verifyLoggedIn();
?>
<script>
function fadeMessage() {
var alert = document.getElementById("alert");
setTimeout(function() {
alert.style.opacity = "0";
setTimeout(function() {
alert.style.display = "none";
}, 600);
}, 1000);
}
</script>
<div class="container">
<h1 class="display-2">Hey <?php echo $_SESSION[username]; ?></h1>
<hr>
This is where you go to edit your services and add any you think you might need.
<?php
if($_GET["edited"] != "") {
echo "<body onload=\"fadeMessage()\"><div class='alert alert-success alert-fade' role='alert' id='alert'>Your service was successfully changed.</div>\n<hr>";
}
?>
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover">
<thead class="thead-dark">
<tr>
<th scope="col">Date Added</th>
<th scope="col">Service Name</th>
<th scope="col">Service Address</th>
<th scope="col">Service Port</th>
<th scope="col">Show public?</th>
<th scope="col">Update Interval</th>
<th scope="col">Show connection?</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
<?php
$q = mysqli_query($connection, "select * from stats");
while($row = mysqli_fetch_array($q)) {
echo "<tr valign='middle'><td>$row[date_added]</td><td>$row[nickname]</td><td>$row[hostname]</td><td>$row[port]</td><td>$row[public]</td><td>$row[update_interval]</td><td>$row[show_connection]</td><td><a href='/service/$row[id]/edit'><img class='editPage' src='/images/edit.svg' width='16px' /></a> <a href='#'><img class='editPage' src='/images/database.svg' width='16px' /></a> <a href='#'><img class='editPage' src='/images/trash.svg' width='16px' /></a></td></tr>\n";
}
?>
</tbody>
</table>
</div>
</div>