-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathgetupdate.php
More file actions
90 lines (73 loc) · 2.22 KB
/
Copy pathgetupdate.php
File metadata and controls
90 lines (73 loc) · 2.22 KB
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
81
82
83
84
85
86
87
88
89
90
<?php
session_start();
$admin = $_SESSION['admin'];
if(!isset($_SESSION['admin']) || !isset($_SESSION['username'])) {
$admin = 0;
} else {
$edit1 = "<th>Options</th>";
}
?>
<?php
include_once("config.php");
include("lib/functions.php");
$countdown = "countdown";
$output = "";
$ip1 = $_SERVER['REMOTE_ADDR'];
$sql = "SELECT * FROM servers ORDER BY valid_to, name";
$res = mysqli_query($db, $sql) or die(mysqli_error());
$posts1 = "
$ajax102
<table class='table table-striped'>
<thead>
<tr>
<th>Domain</th>
<th>Authority</th>
<th>Created</th>
<th>Expiry</th>
<th>State</th>
$edit1
<tr>
</thead>
<tbody>
";
echo $posts1;
if($ajax101 == "false") {
echo "
<tr class='bg-dark'>
<td>INVALID</td>
<td>LICENSE</td>
<td>INVALID</td>
<td>LICENSE</td>
<td><span class='badge badge-pill badge-danger'>Error</span></td>
</tr>";
exit();
}
if(mysqli_num_rows($res) > 0) {
while($row = mysqli_fetch_assoc($res)) {
$getupdate = new getUpdate();
$getupdate->id = $row["id"];
$getupdate->naam = $row["name"];
$getupdate->authority_long = $row["authority"];
$getupdate->valid_from = $row["valid_from"];
$getupdate->valid_to = $row["valid_to"];
$getupdate->state = $row["state"];
$getupdate->admin = $admin;
echo $getupdate->fetchData($posts);
}
}
$posts2 .= "
</tbody>
</table>
";
echo $posts2;
?>
<script type="text/javascript">
var elems = document.getElementsByClassName('confirmation');
var confirmIt = function (e) {
if (!confirm('Are you sure you want to delete this entry from the database?')) e.preventDefault();
};
for (var i = 0, l = elems.length; i < l; i++) {
elems[i].addEventListener('click', confirmIt, false);
}
</script>
</html>