forked from science-ation/science-ation
120 lines
2.8 KiB
PHP
120 lines
2.8 KiB
PHP
|
<?
|
||
|
/*
|
||
|
This file is part of the 'Science Fair In A Box' project
|
||
|
SFIAB Website: http://www.sfiab.ca
|
||
|
|
||
|
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
|
||
|
Copyright (C) 2005 James Grant <james@lightbox.org>
|
||
|
|
||
|
This program is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU General Public
|
||
|
License as published by the Free Software Foundation, version 2.
|
||
|
|
||
|
This program is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU General Public License
|
||
|
along with this pr<input type=\"submit\" value=\"".i18n("Save Configuration")."\" />\n";
|
||
|
ogram; see the file COPYING. If not, write to
|
||
|
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||
|
Boston, MA 02111-1307, USA.
|
||
|
*/
|
||
|
?>
|
||
|
<?
|
||
|
require("../common.inc.php");
|
||
|
send_header("Judges - Scheduler Status");
|
||
|
?>
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
|
||
|
|
||
|
function getHTTPObject()
|
||
|
{
|
||
|
var xmlhttp;
|
||
|
/*@cc_on
|
||
|
@if (@_jscript_version >= 5)
|
||
|
try {
|
||
|
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
|
||
|
} catch (e) {
|
||
|
try {
|
||
|
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||
|
} catch (E) {
|
||
|
xmlhttp = false;
|
||
|
}
|
||
|
}
|
||
|
@else
|
||
|
xmlhttp = false;
|
||
|
@end @*/
|
||
|
if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
|
||
|
{
|
||
|
try {
|
||
|
xmlhttp = new XMLHttpRequest();
|
||
|
} catch (e)
|
||
|
{
|
||
|
xmlhttp = false;
|
||
|
}
|
||
|
}
|
||
|
return xmlhttp;
|
||
|
}
|
||
|
|
||
|
var http=getHTTPObject();
|
||
|
|
||
|
|
||
|
|
||
|
function updateStatus()
|
||
|
{
|
||
|
var url="judges_scheduler_status_output.php";
|
||
|
http.open("GET",url,true);
|
||
|
http.onreadystatechange=handleResponse;
|
||
|
http.send(null);
|
||
|
}
|
||
|
|
||
|
function handleResponse()
|
||
|
{
|
||
|
try {
|
||
|
|
||
|
if(http.readyState==4)
|
||
|
{
|
||
|
var obj=http.responseText.split(":");
|
||
|
document.getElementById('schedulerstatus').innerHTML=obj[1];
|
||
|
document.getElementById('schedulerpercent').innerHTML=obj[0]+"%";
|
||
|
setTimeout('updateStatus()',5000);
|
||
|
}
|
||
|
}
|
||
|
catch(e)
|
||
|
{
|
||
|
alert('caught error'+e);
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
</script>
|
||
|
|
||
|
<?
|
||
|
if($config['judge_scheduler_percent']=="-1")
|
||
|
//|| $config['judge_scheduler_percent']=="0")
|
||
|
{
|
||
|
echo i18n("The judge scheduler is not currently running");
|
||
|
echo $config['judge_scheduler_percent'];
|
||
|
echo $config['judge_scheduler_activity'];
|
||
|
echo "<br />";
|
||
|
echo "<br />";
|
||
|
echo "<a href=\"judges_schedulerconfig.php\">".i18n("Judges Scheduler Configuration")."</a>";
|
||
|
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
echo "<table>";
|
||
|
echo "<tr><td>".i18n("Scheduler status").":</td><td><div id=\"schedulerstatus\" style=\"font-weight: bold;\"></div></td></tr>";
|
||
|
echo "<tr><td>".i18n("Scheduler percent").":</td><td><div id=\"schedulerpercent\" style=\"font-weight: bold;\"></div></td></tr>";
|
||
|
echo "</table>";
|
||
|
?>
|
||
|
<script type="text/javascript">updateStatus()</script>
|
||
|
<?
|
||
|
}
|
||
|
send_footer();
|
||
|
|
||
|
?>
|