-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathstatusUpdate.php
executable file
·51 lines (50 loc) · 1.37 KB
/
statusUpdate.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
<?php
session_start();
require_once 'constants.php';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<head>
<style type="text/css">
body {font-family: arial;}
.tab {
margin-left: 1cm;
}
.clock {
float: left;
margin-right: 0.25cm;
}
</style>
</head>
<?php
// Load last line from "status_log.txt" file.
$statusLogLines = explode("\n", trim(file_get_contents("status_log.txt")));
$statusLog = str_replace("\n","<br>\n",trim(file_get_contents("status_log.txt")));
if (count($statusLogLines) > 1) {
$statusLogEntry = $statusLog;
} else if (count($statusLogLines) == 1) {
if ($statusLog[count($statusLog)-1] == "") {
$statusLogEntry = "No system status notes.";
} else {
$statusLogEntry = $statusLog;
}
} else {
$statusLogEntry = "No system status notes.";
}
?>
<script type="text/javascript">
reload_page=function() {
var autoSubmitForm = document.createElement('form');
autoSubmitForm.setAttribute('method','post');
autoSubmitForm.setAttribute('action','statusUpdate.php');
document.body.appendChild(autoSubmitForm);
autoSubmitForm.submit();
}
var internalIntervalID = window.setInterval(reload_page, 30000);
</script>
<body onload = "parent.resize_iframe('status', 75);" class="tab">
<font size="2">
<?php echo $statusLogEntry; ?>
</font>
</BODY>
</HTML>