Exemple #1
0
     }
     if ($jury_member == @$jud['jury_member']) {
         echo addSubmit('unclaim', 'unclaim');
     } else {
         echo addSubmit('claim', 'claim');
     }
     echo addEndForm();
 }
 echo "<br /><br />\n\n";
 echo 'Result: ' . printresult($jud['result'], $jud['valid']) . ($lastjud === NULL ? '' : '<span class="lastresult"> (<a href="submission.php?id=' . $lastsubmitid . '">s' . $lastsubmitid . '</a>: ' . @$lastjud['result'] . ')</span>') . ', ' . 'Judgehost: <a href="judgehost.php?id=' . urlencode($jud['judgehost']) . '">' . printhost($jud['judgehost']) . '</a>, ';
 // Time (start, end, used)
 echo "<span class=\"judgetime\">Judging started: " . printtime($jud['starttime'], '%H:%M:%S');
 if ($judging_ended) {
     echo ', finished in ' . printtimediff($jud['starttime'], $jud['endtime']) . ' s';
 } elseif ($jud['valid'] || isset($jud['rejudgingid'])) {
     echo ' [still judging - busy ' . printtimediff($jud['starttime']) . ']';
 } else {
     echo ' [aborted]';
 }
 echo "</span>\n";
 if (@$jud['result'] !== 'compiler-error') {
     echo ", max/sum runtime: " . sprintf('%.2f/%.2fs', $max_runtime, $sum_runtime);
     if (isset($max_lastruntime)) {
         echo " <span class=\"lastruntime\">(<a href=\"submission.php?id={$lastsubmitid}\">s{$lastsubmitid}</a>: " . sprintf('%.2f/%.2fs', $max_lastruntime, $sum_lastruntime) . ")</span>";
     }
     echo "<table>\n{$tclist}";
     if ($lastjud !== NULL) {
         echo $lasttclist;
     }
     echo "</table>\n";
 }
Exemple #2
0
 echo "<td class=\"tdcenter ";
 if (empty($row['polltime'])) {
     echo "judgehost-nocon";
     echo "\" title =\"never checked in\">";
 } else {
     $reltime = floor(difftime($now, $row['polltime']));
     if ($reltime < dbconfig_get('judgehost_warning', 30)) {
         echo "judgehost-ok";
     } else {
         if ($reltime < dbconfig_get('judgehost_critical', 120)) {
             echo "judgehost-warn";
         } else {
             echo "judgehost-crit";
         }
     }
     echo "\" title =\"last checked in " . printtimediff($row['polltime']) . "s ago\">";
 }
 echo $link . CIRCLE_SYM . "</a></td>";
 echo "<td>" . $link . (is_null($row['name']) ? '<i>none</i>' : $row['name']) . '</a></td>';
 echo "<td title=\"load during the last 2 and 10 minutes and the whole contest\">" . $link . sprintf('%.2f&nbsp;%.2f&nbsp;%.2f', @$work2min[$row['hostname']] / (2 * 60), @$work10min[$row['hostname']] / (10 * 60), @$workcontest[$row['hostname']] / $clen) . "</a></td>";
 if (IS_ADMIN) {
     if ($row['active']) {
         $activepicto = "pause";
         $activecmd = "deactivate";
     } else {
         $activepicto = "play";
         $activecmd = "activate";
     }
     echo "<td><a href=\"judgehost.php?id=" . $row['hostname'] . "&amp;cmd=" . $activecmd . "\"><img class=\"picto\" alt=\"" . $activecmd . "\" title=\"" . $activecmd . " judgehost\" " . "src=\"../images/" . $activepicto . ".png\" /></a></td>";
     echo "<td>" . delLink('judgehost', 'hostname', $row['hostname']) . "</td>";
 }
Exemple #3
0
	               result, verified, valid FROM judging
	               WHERE cid IN (%Ai) AND judgehost = %s
	               ORDER BY starttime DESC, judgingid DESC', $cids, $row['hostname']);
}
if (empty($cids) || $res->count() == 0) {
    echo "<p class=\"nodata\">No judgings.</p>\n\n";
} else {
    echo "<table class=\"list sortable\">\n<thead>\n" . "<tr><th scope=\"col\" class=\"sorttable_numeric\">ID</th><th " . "scope=\"col\">started</th><th scope=\"col\">runtime</th><th " . "scope=\"col\">result</th><th scope=\"col\">valid</th><th " . "scope=\"col\">verified</th></tr>\n</thead>\n<tbody>\n";
    while ($jud = $res->next()) {
        if (empty($jud['endtime'])) {
            if ($jud['valid']) {
                $runtime = printtimediff($jud['starttime'], NULL);
            } else {
                $runtime = '[aborted]';
            }
        } else {
            $runtime = printtimediff($jud['starttime'], $jud['endtime']);
        }
        $link = ' href="submission.php?id=' . (int) $jud['submitid'] . '&amp;jid=' . (int) $jud['judgingid'] . '"';
        echo '<tr' . ($jud['valid'] ? '' : ' class="disabled"') . '>';
        echo "<td><a{$link}>j" . (int) $jud['judgingid'] . '</a></td>';
        echo "<td><a{$link}>" . printtime($jud['starttime']) . '</a></td>';
        echo "<td><a{$link}>" . $runtime . '</a></td>';
        echo "<td><a{$link}>" . printresult(@$jud['result'], $jud['valid']) . '</a></td>';
        echo "<td class=\"tdcenter\"><a{$link}>" . printyn($jud['valid']) . '</a></td>';
        echo "<td class=\"tdcenter\"><a{$link}>" . printyn($jud['verified']) . '</a></td>';
        echo "</tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
require LIBWWWDIR . '/footer.php';
Exemple #4
0
/**
 * Output clock
 */
function putClock()
{
    global $cdata, $username;
    echo '<div id="clock">';
    // timediff to end of contest
    if (difftime(now(), $cdata['starttime']) >= 0 && difftime(now(), $cdata['endtime']) < 0) {
        $left = "time left: " . printtimediff(now(), $cdata['endtime']);
    } else {
        if (difftime(now(), $cdata['activatetime']) >= 0 && difftime(now(), $cdata['starttime']) < 0) {
            $left = "time to start: " . printtimediff(now(), $cdata['starttime']);
        } else {
            $left = "";
        }
    }
    echo "<span id=\"timeleft\">" . $left . "</span>";
    global $cid, $cdatas;
    // Show a contest selection form, if there are contests
    if (IS_JURY || count($cdatas) > 1) {
        echo "<div id=\"selectcontest\">\n";
        echo addForm('change_contest.php', 'get', 'selectcontestform');
        $contests = array_map(function ($c) {
            return $c['shortname'];
        }, $cdatas);
        if (IS_JURY) {
            $values = array(-1 => '- No contest');
        }
        foreach ($contests as $contestid => $name) {
            $values[$contestid] = $name;
        }
        echo 'contest: ' . addSelect('cid', $values, $cid, true);
        echo addEndForm();
        echo "<script type=\"text/javascript\">\n\t\t      document.getElementById('cid').addEventListener('change', function() {\n\t\t      document.getElementById('selectcontestform').submit();\n\t});\n</script>\n";
        echo "</div>\n";
    }
    if (logged_in()) {
        echo "<div id=\"username\">logged in as " . $username . (have_logout() ? " <a href=\"../auth/logout.php\">×</a>" : "") . "</div>";
    }
    echo "</div>";
    echo "<script type=\"text/javascript\">\n\tvar initial = " . time() . ";\n\tvar activatetime = " . (isset($cdata['activatetime']) ? $cdata['activatetime'] : -1) . ";\n\tvar starttime = " . (isset($cdata['starttime']) ? $cdata['starttime'] : -1) . ";\n\tvar endtime = " . (isset($cdata['endtime']) ? $cdata['endtime'] : -1) . ";\n\tvar offset = 0;\n\tvar date = new Date(initial*1000);\n\tvar timeleftelt = document.getElementById(\"timeleft\");\n\n\tsetInterval(function(){updateClock();},1000);\n\tupdateClock();\n</script>\n";
}