예제 #1
0
 echo rejudgeForm('submission', $id) . "<br /><br />\n\n";
 echo "<h2 style=\"display:inline;\">Judging j" . (int) $jud['judgingid'] . $state . "</h2>\n\n&nbsp;";
 if (!$jud['verified']) {
     echo addForm($pagename . '?id=' . urlencode($id) . '&amp;jid=' . urlencode($jid));
     if (!empty($jud['jury_member'])) {
         echo ' (claimed by ' . specialchars($jud['jury_member']) . ') ';
     }
     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>";
     }
예제 #2
0
          WHERE endtime > %i OR (endtime IS NULL and valid = 1)
          GROUP BY judgehost';
$from = $now - 2 * 60;
$work2min = $DB->q($query, $now, $from, $from);
$from = $now - 10 * 60;
$work10min = $DB->q($query, $now, $from, $from);
$from = $cdata['starttime'];
$workcontest = $DB->q($query, $now, $from, $from);
$clen = difftime($now, $cdata['starttime']);
if ($res->count() == 0) {
    echo "<p class=\"nodata\">No judgehosts defined</p>\n\n";
} else {
    echo "<table class=\"list sortable\">\n<thead>\n" . "<tr><th scope=\"col\">hostname</th>" . "<th scope=\"col\">active</th>" . "<th class=\"sorttable_nosort\">status</th>" . "<th class=\"sorttable_nosort\">restriction</th>" . "<th class=\"sorttable_nosort\">load</th></tr>\n" . "</thead>\n<tbody>\n";
    while ($row = $res->next()) {
        $link = '<a href="judgehost.php?id=' . urlencode($row['hostname']) . '">';
        echo "<tr" . ($row['active'] ? '' : ' class="disabled"') . "><td>" . $link . printhost($row['hostname']) . '</a>' . "</td><td class=\"tdcenter\">" . $link . printyn($row['active']) . "</a></td>";
        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";
                }
            }
예제 #3
0
    echo ", time since judgehost last checked in: " . printtimediff($row['polltime']) . 's.';
}
?>
</td></tr>
</table>

<?php 
if (IS_ADMIN) {
    $cmd = $row['active'] == 1 ? 'deactivate' : 'activate';
    echo addForm($pagename) . "<p>\n" . addHidden('id', $row['hostname']) . addHidden('cmd', $cmd) . addSubmit($cmd) . "</p>\n" . addEndForm();
}
if (IS_ADMIN) {
    echo "<p>" . delLink('judgehost', 'hostname', $row['hostname']) . "</p>\n\n";
}
echo rejudgeForm('judgehost', $row['hostname']) . "<br />\n\n";
echo "<h3>Judgings by " . printhost($row['hostname']) . "</h3>\n\n";
// get the judgings for a specific key and value pair
// select only specific fields to avoid retrieving large blobs
$cids = getCurContests(FALSE);
if (!empty($cids)) {
    $res = $DB->q('SELECT judgingid, submitid, starttime, endtime, judgehost,
	               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'])) {
예제 #4
0
파일: team.php 프로젝트: sponi78/domjudge
if ($row['enabled'] != 1) {
    echo "<p><em>Team is disabled</em></p>\n\n";
}
?>

<div class="col1"><table>
<tr><td>ID:        </td><td>t<?php 
echo specialchars($row['teamid']);
?>
</td></tr>
<tr><td>Name:      </td><td><?php 
echo specialchars($row['name']);
?>
</td></tr>
<tr><td>Host:</td><td><?php 
echo @$row['hostname'] ? printhost($row['hostname'], TRUE) : '';
?>
</td></tr>
<?php 
if (!empty($row['penalty'])) {
    ?>
<tr><td>Penalty time:</td><td><?php 
    echo specialchars($row['penalty']);
    ?>
</td></tr>
<?php 
}
if (!empty($row['room'])) {
    ?>
<tr><td>Location:</td><td><?php 
    echo specialchars($row['room']);
예제 #5
0
파일: user.php 프로젝트: nya3jp/domjudge
    echo "No roles assigned";
} else {
    while ($role = $roles->next()) {
        echo "{$role['role']} - {$role['description']}<br>";
    }
}
?>
</td></tr>
<tr><td>Team:</td><?php 
if ($row['teamid']) {
    echo "<td class=\"teamid\"><a href=\"team.php?id=" . urlencode($row['teamid']) . "\">" . htmlspecialchars($row['teamname'] . " (t" . $row['teamid'] . ")") . "</a></td>";
} else {
    echo "<td>-</td>";
}
?>
</tr>
<tr><td>Last login:</td><td><?php 
echo printtime($row['last_login'], '%a %d %b %Y %T %Z');
?>
</td></tr>
<tr><td>Last IP:   </td><td><?php 
echo @$row['ip_address'] ? printhost($row['ip_address'], TRUE) : '';
?>
</td></tr>
</table></div>

<?php 
if (IS_ADMIN) {
    echo "<p class=\"nomorecol\">" . editLink('user', $id) . "\n" . delLink('user', 'userid', $id) . "</p>\n\n";
}
require LIBWWWDIR . '/footer.php';
예제 #6
0
파일: teams.php 프로젝트: nya3jp/domjudge
 $status = $numsub = $numcor = 0;
 if (isset($row['teampage_first_visited'])) {
     $status = 1;
 }
 if (isset($nsubmits[$row['teamid']]) && $nsubmits[$row['teamid']]['cnt'] > 0) {
     $status = 2;
     $numsub = (int) $nsubmits[$row['teamid']]['cnt'];
 }
 if (isset($ncorrect[$row['teamid']]) && $ncorrect[$row['teamid']]['cnt'] > 0) {
     $status = 3;
     $numcor = (int) $ncorrect[$row['teamid']]['cnt'];
 }
 $link = '<a href="team.php?id=' . urlencode($row['teamid']) . '">';
 echo "<tr class=\"category" . (int) $row['categoryid'] . ($row['enabled'] == 1 ? '' : ' sub_ignore') . "\">" . "<td>" . $link . "t" . htmlspecialchars($row['teamid']) . "</a></td>" . "<td>" . $link . htmlspecialchars($row['name']) . "</a></td>" . "<td>" . $link . htmlspecialchars($row['catname']) . "</a></td>" . "<td title=\"" . htmlspecialchars($row['affname']) . "\">" . $link . ($row['affshortname'] ? htmlspecialchars($row['affshortname']) : '&nbsp;') . "</a></td><td>" . $link . $row['numcontests'] . "</a></td><td title=\"";
 if (@$row['hostname']) {
     echo htmlspecialchars($row['hostname']) . "\">" . $link . printhost($row['hostname']);
 } else {
     echo "\">" . $link . "-";
 }
 echo "</a></td><td>" . $link . ($row['room'] ? htmlspecialchars($row['room']) : '&nbsp;') . "</a></td>";
 echo "<td class=\"";
 switch ($status) {
     case 0:
         echo 'team-nocon" title="no connections made"';
         break;
     case 1:
         echo 'team-nosub" title="teampage viewed, no submissions"';
         break;
     case 2:
         echo 'team-nocor" title="submitted, none correct"';
         break;