当前位置: 首页>>代码示例>>PHP>>正文


PHP printyn函数代码示例

本文整理汇总了PHP中printyn函数的典型用法代码示例。如果您正苦于以下问题:PHP printyn函数的具体用法?PHP printyn怎么用?PHP printyn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了printyn函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dbconfig_get

 }
 // Show JS toggle of previous submission results.
 if ($lastjud !== NULL) {
     echo "<span class=\"testcases_prev\">" . "<a href=\"javascript:togglelastruns();\">show/hide</a> results of previous " . "<a href=\"submission.php?id={$lastsubmitid}\">submission s{$lastsubmitid}</a>" . (empty($lastjud['verify_comment']) ? '' : "<span class=\"prevsubmit\"> (verify comment: '" . $lastjud['verify_comment'] . "')</span>") . "</span>";
 }
 // display following data only when the judging has been completed
 if ($judging_ended) {
     // display verification data: verified, by whom, and comment.
     // only if this is a valid judging, otherwise irrelevant
     if ($jud['valid'] || isset($jud['rejudgingid']) && $jud['rvalid']) {
         $verification_required = dbconfig_get('verification_required', 0);
         if (!($verification_required && $jud['verified'])) {
             $val = !$jud['verified'];
             echo addForm('verify.php') . addHidden('id', $jud['judgingid']) . addHidden('val', $val) . addHidden('redirect', @$_SERVER['HTTP_REFERER']);
         }
         echo "<p>Verified: " . "<strong>" . printyn($jud['verified']) . "</strong>";
         if ($jud['verified'] && !empty($jud['jury_member'])) {
             echo ", by " . specialchars($jud['jury_member']);
             if (!empty($jud['verify_comment'])) {
                 echo ' with comment "' . specialchars($jud['verify_comment']) . '"';
             }
         }
         if (!($verification_required && $jud['verified'])) {
             echo '; ' . addSubmit(($val ? '' : 'un') . 'mark verified', 'verify');
             if ($val) {
                 echo ' with comment ' . addInput('comment', '', 25);
             }
             echo "</p>" . addEndForm();
         } else {
             echo "</p>\n";
         }
开发者ID:sponi78,项目名称:domjudge,代码行数:31,代码来源:submission.php

示例2: array

        echo "<p class=\"nodata\">No contests defined</p>\n\n";
    } else {
        $times = array('activate', 'start', 'freeze', 'end', 'unfreeze');
        echo "<table class=\"list sortable\">\n<thead>\n" . "<tr><th scope=\"col\" class=\"sorttable_numeric\">CID</th>";
        echo "<th scope=\"col\">contest<br />shortname</th>\n";
        echo "<th scope=\"col\">contest<br />name</th>";
        echo "<th scope=\"col\">problem<br />shortname</th>";
        echo "<th scope=\"col\">allow<br />submit</th>";
        echo "<th scope=\"col\">allow<br />judge</th>";
        echo "<th class=\"sorttable_nosort\" scope=\"col\">colour</th>\n";
        echo "</tr>\n</thead>\n<tbody>\n";
        $iseven = false;
        foreach ($res as $row) {
            $link = '<a href="contest.php?id=' . urlencode($row['cid']) . '">';
            echo '<tr class="' . ($iseven ? 'roweven' : 'rowodd') . (!$row['enabled'] ? ' disabled' : '') . '">' . "<td class=\"tdright\">" . $link . "c" . (int) $row['cid'] . "</a></td>\n";
            echo "<td>" . $link . specialchars($row['shortname']) . "</a></td>\n";
            echo "<td>" . $link . specialchars($row['name']) . "</a></td>\n";
            echo "<td>" . $link . specialchars($row['problemshortname']) . "</a></td>\n";
            echo "<td class=\"tdcenter\">" . $link . printyn($row['allow_submit']) . "</a></td>\n";
            echo "<td class=\"tdcenter\">" . $link . printyn($row['allow_judge']) . "</a></td>\n";
            echo !empty($row['color']) ? '<td title="' . specialchars($row['color']) . '">' . $link . '<div class="circle" style="background-color: ' . specialchars($row['color']) . ';"></div></a></td>' : '<td>' . $link . '&nbsp;</a></td>';
            $iseven = !$iseven;
            echo "</tr>\n";
        }
        echo "</tbody>\n</table>\n\n";
    }
}
echo "<h2>Submissions for " . specialchars($data['name']) . "</h2>\n\n";
$restrictions = array('probid' => $id);
putSubmissions($cdatas, $restrictions);
require LIBWWWDIR . '/footer.php';
开发者ID:Surya97,项目名称:domjudge,代码行数:31,代码来源:problem.php

示例3: OR

          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";
                }
            }
开发者ID:nya3jp,项目名称:domjudge,代码行数:31,代码来源:judgehosts.php

示例4: while

<?php

/**
 * View the languages
 *
 * Part of the DOMjudge Programming Contest Jury System and licenced
 * under the GNU GPL. See README and COPYING for details.
 */
require 'init.php';
$title = 'Languages';
require LIBWWWDIR . '/header.php';
echo "<h1>Languages</h1>\n\n";
$res = $DB->q('SELECT * FROM language ORDER BY name');
if ($res->count() == 0) {
    echo "<p class=\"nodata\">No languages defined</p>\n\n";
} else {
    echo "<table class=\"list sortable\">\n<thead>\n" . "<tr><th scope=\"col\">ID/ext</th><th scope=\"col\">name</th>" . "<th scope=\"col\">allow<br />submit</th>" . "<th scope=\"col\">allow<br />judge</th><th scope=\"col\">timefactor</th>" . "<th scope=\"col\">extensions</th><th scope=\"col\"></th>" . "</tr>\n</thead>\n<tbody>\n";
    while ($row = $res->next()) {
        $link = '<a href="language.php?id=' . urlencode($row['langid']) . '">';
        echo "<tr" . ($row['allow_submit'] ? '' : ' class="disabled"') . "><td>" . $link . specialchars($row['langid']) . "</a>" . "</td><td>" . $link . specialchars($row['name']) . "</a>" . "</td><td>" . $link . printyn($row['allow_submit']) . "</a>" . "</td><td>" . $link . printyn($row['allow_judge']) . "</a>" . "</td><td>" . $link . specialchars($row['time_factor']) . "</a>" . "</td><td>" . $link . specialchars(implode(', ', json_decode($row['extensions']))) . "</a>";
        if (IS_ADMIN) {
            echo "</td><td class=\"editdel\">" . editLink('language', $row['langid']) . "&nbsp;" . delLink('language', 'langid', $row['langid']);
        }
        echo "</td></tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
if (IS_ADMIN) {
    echo "<p>" . addLink('language') . "</p>\n\n";
}
require LIBWWWDIR . '/footer.php';
开发者ID:rohit-takhar,项目名称:domjudge,代码行数:31,代码来源:languages.php

示例5: IN

	               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';
开发者ID:kien8995,项目名称:domjudge,代码行数:31,代码来源:judgehost.php

示例6: COUNT

/**
 * View the categories
 *
 * Part of the DOMjudge Programming Contest Jury System and licenced
 * under the GNU GPL. See README and COPYING for details.
 */
require 'init.php';
$title = 'Categories';
require LIBWWWDIR . '/header.php';
echo "<h1>Categories</h1>\n\n";
$res = $DB->q('SELECT team_category.*, COUNT(teamid) AS numteams
               FROM team_category LEFT JOIN team USING (categoryid)
               GROUP BY team_category.categoryid ORDER BY sortorder, categoryid');
if ($res->count() == 0) {
    echo "<p class=\"nodata\">No categories defined</p>\n\n";
} else {
    echo "<table class=\"list sortable\">\n<thead>\n" . "<tr><th scope=\"col\">ID</th><th scope=\"col\">sort</th>" . "<th scope=\"col\">name</th><th scope=\"col\">#teams</th>" . "<th scope=\"col\">visible</th><th scope=\"col\"></th></tr>\n" . "</thead>\n<tbody>\n";
    while ($row = $res->next()) {
        $link = '<a href="team_category.php?id=' . (int) $row['categoryid'] . '">';
        echo '<tr' . (isset($row['color']) ? ' style="background: ' . $row['color'] . ';"' : '') . '><td>' . $link . (int) $row['categoryid'] . '</a></td><td>' . $link . (int) $row['sortorder'] . '</a></td><td>' . $link . htmlspecialchars($row['name']) . '</a></td><td class="tdright">' . $link . (int) $row['numteams'] . '</a></td><td class="tdcenter">' . $link . printyn($row['visible']) . '</a></td>';
        if (IS_ADMIN) {
            echo "<td class=\"editdel\">" . editLink('team_category', $row['categoryid']) . " " . delLink('team_category', 'categoryid', $row['categoryid']) . "</td>";
        }
        echo "</tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
if (IS_ADMIN) {
    echo "<p>" . addLink('team_category') . "</p>\n\n";
}
require LIBWWWDIR . '/footer.php';
开发者ID:hex539,项目名称:domjudge,代码行数:31,代码来源:team_categories.php

示例7: error

$data = $DB->q('TUPLE SELECT * FROM team_category WHERE categoryid = %i', $id);
if (!$data) {
    error("Missing or invalid category id");
}
if (isset($_GET['edited'])) {
    echo addForm('refresh_cache.php') . msgbox("Warning: Refresh scoreboard cache", "If the category sort order was changed, it may be necessary to " . "recalculate any cached scoreboards.<br /><br />" . addSubmit('recalculate caches now', 'refresh')) . addHidden('cid', $id) . addEndForm();
}
echo "<h1>Category: " . specialchars($data['name']) . "</h1>\n\n";
echo "<table>\n";
echo '<tr><td>ID:</td><td>' . specialchars($data['categoryid']) . "</td></tr>\n";
echo '<tr><td>Name:</td><td>' . specialchars($data['name']) . "</td></tr>\n";
echo '<tr><td>Sortorder:</td><td>' . specialchars($data['sortorder']) . "</td></tr>\n";
if (isset($data['color'])) {
    echo '<tr><td>Colour:       </td><td style="background: ' . specialchars($data['color']) . ';">' . specialchars($data['color']) . "</td></tr>\n";
}
echo '<tr><td>Visible:</td><td>' . printyn($data['visible']) . "</td></tr>\n";
echo "</table>\n\n";
if (IS_ADMIN) {
    echo "<p>" . editLink('team_category', $data['categoryid']) . "\n" . delLink('team_category', 'categoryid', $data['categoryid'], $data['name']) . "</p>\n\n";
}
echo "<h2>Teams in " . specialchars($data['name']) . "</h2>\n\n";
$listteams = array();
$teams = $DB->q('SELECT teamid,name FROM team WHERE categoryid = %i', $id);
if ($teams->count() == 0) {
    echo "<p class=\"nodata\">no teams</p>\n\n";
} else {
    echo "<table class=\"list\">\n<thead>\n" . "<tr><th scope=\"col\">ID</th><th scope=\"col\">teamname</th></tr>\n" . "</thead>\n<tbody>\n";
    while ($team = $teams->next()) {
        $listteams[] = $team['teamid'];
        $link = '<a href="team.php?id=' . urlencode($team['teamid']) . '">';
        echo "<tr><td>" . $link . "t" . specialchars($team['teamid']) . "</a></td><td>" . $link . specialchars($team['name']) . "</a></td></tr>\n";
开发者ID:bertptrs,项目名称:domjudge,代码行数:31,代码来源:team_category.php

示例8: putClarificationList

/**
 * Print a list of clarifications in a table with links to the clarifications.
 */
function putClarificationList($clars, $team = NULL)
{
    global $username, $cids;
    if ($team == NULL && !IS_JURY) {
        error("access denied to clarifications: you seem to be team nor jury");
    }
    echo "<table class=\"list sortable\">\n<thead>\n<tr>" . (IS_JURY ? "<th scope=\"col\">ID</th>" : "") . (IS_JURY && count($cids) > 1 ? "<th scope=\"col\">contest</th>" : "") . "<th scope=\"col\">time</th>" . "<th scope=\"col\">from</th>" . "<th scope=\"col\">to</th><th scope=\"col\">subject</th>" . "<th scope=\"col\">text</th>" . (IS_JURY ? "<th scope=\"col\">answered</th><th scope=\"col\">by</th>" : "") . "</tr>\n</thead>\n<tbody>\n";
    while ($clar = $clars->next()) {
        // check viewing permission for teams
        if (!IS_JURY && !canViewClarification($team, $clar)) {
            continue;
        }
        $clar['clarid'] = (int) $clar['clarid'];
        $link = '<a href="clarification.php?id=' . urlencode($clar['clarid']) . '">';
        if (isset($clar['unread'])) {
            echo '<tr class="unread">';
        } else {
            echo '<tr>';
        }
        if (IS_JURY) {
            echo '<td>' . $link . $clar['clarid'] . '</a></td>';
        }
        echo IS_JURY && count($cids) > 1 ? '<td>' . $link . $clar['contestshortname'] . '</a></td>' : '';
        echo '<td>' . $link . printtime($clar['submittime']) . '</a></td>';
        if ($clar['sender'] == NULL) {
            $sender = 'Jury';
            if ($clar['recipient'] == NULL) {
                $recipient = 'All';
            } else {
                $recipient = htmlspecialchars($clar['toname']);
            }
        } else {
            $sender = htmlspecialchars($clar['fromname']);
            $recipient = 'Jury';
        }
        echo '<td>' . $link . $sender . '</a></td>' . '<td>' . $link . $recipient . '</a></td>';
        echo '<td>' . $link;
        if (is_null($clar['probid'])) {
            echo "general";
        } else {
            echo "problem " . $clar['shortname'];
        }
        echo "</a></td>";
        echo '<td class="clartext">' . $link . summarizeClarification($clar['body']) . "</a></td>";
        if (IS_JURY) {
            unset($answered, $jury_member);
            $claim = FALSE;
            $answered = printyn($clar['answered']);
            if (empty($clar['jury_member'])) {
                $jury_member = '&nbsp;';
            } else {
                $jury_member = htmlspecialchars($clar['jury_member']);
            }
            if (!$clar['answered']) {
                if (empty($clar['jury_member'])) {
                    $claim = TRUE;
                } else {
                    $answered = 'claimed';
                }
            }
            echo "<td>{$link} {$answered}</a></td><td>";
            if ($claim && isset($clar['sender'])) {
                echo "<a class=\"button\" href=\"clarification.php?claim=1&amp;id=" . htmlspecialchars($clar['clarid']) . "\">claim</a>";
            } else {
                if (!$clar['answered'] && $jury_member == $username) {
                    echo "<a class=\"button\" href=\"clarification.php?unclaim=1&amp;id=" . htmlspecialchars($clar['clarid']) . "\">unclaim</a>";
                } else {
                    echo "{$link} {$jury_member}</a>";
                }
            }
            echo "</td>";
        }
        echo "</tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
开发者ID:nya3jp,项目名称:domjudge,代码行数:79,代码来源:clarification.php

示例9: urlencode

 echo '<tr' . ($inout == 'output' ? ' class="testcase-middle"' : '') . '>';
 if ($inout == 'input') {
     echo "<td rowspan=\"2\" class=\"testrank\">" . "<a href=\"./testcase.php?probid=" . urlencode($probid) . "&amp;rank={$rank}&amp;move=up\">&uarr;</a>{$rank}" . "<a href=\"./testcase.php?probid=" . urlencode($probid) . "&amp;rank={$rank}&amp;move=down\">&darr;</a></td>";
 }
 echo "<td class=\"filename\"><a href=\"./testcase.php?probid=" . urlencode($probid) . "&amp;rank={$rank}&amp;fetch=" . $inout . "\">" . filebase($probid, $rank) . substr($inout, 0, -3) . "</a></td>" . "<td class=\"size\">" . printsize($row["size_{$inout}"]) . "</td>" . "<td class=\"md5\">" . htmlspecialchars($row["md5sum_{$inout}"]) . "</td>";
 if (IS_ADMIN) {
     echo "<td>" . addFileField("update_" . $inout . "[{$rank}]") . "</td>";
 }
 if ($inout == 'input') {
     if (IS_ADMIN) {
         echo "<td rowspan=\"2\"\tclass=\"testsample\" onclick=\"editTcSample({$rank})\">" . addSelect("sample[{$rank}]", array("no", "yes"), $row['sample'], true) . "</td>";
         // hide sample dropdown field if javascript is enabled
         echo "<script type=\"text/javascript\" language=\"JavaScript\">" . "hideTcSample({$rank}, '" . printyn($row['sample']) . "');</script>";
         echo "<td class=\"testdesc\" onclick=\"editTcDesc({$rank})\">" . "<textarea id=\"tcdesc_{$rank}\" name=\"description[{$rank}]\" cols=\"50\" rows=\"1\">" . htmlspecialchars($row['description']) . "</textarea></td>" . "<td rowspan=\"2\" class=\"editdel\">" . "<a href=\"delete.php?table=testcase&amp;testcaseid={$row['testcaseid']}&amp;referrer=" . urlencode('testcase.php?probid=' . $probid) . "\">" . "<img src=\"../images/delete.png\" alt=\"delete\"" . " title=\"delete this testcase\" class=\"picto\" /></a></td>";
     } else {
         echo "<td rowspan=\"2\" align=\"testsample\">" . printyn($row['issample']) . "</td>";
         echo "<td class=\"testdesc\">" . htmlspecialchars($row['description']) . "</td>";
     }
 } else {
     echo '<td class="testimage filename">';
     if ($row['size_image']) {
         echo "<a href=\"./testcase.php?probid=" . urlencode($probid) . "&amp;rank={$rank}&amp;fetch=image\">" . filebase($probid, $rank) . $row['image_type'] . "</a>";
     } else {
         echo '<span class="nodata">No image.</span>';
     }
     if (IS_ADMIN) {
         echo '&nbsp;' . addFileField("update_image[{$rank}]");
     }
     echo "</td>";
 }
 echo "</tr>\n";
开发者ID:nya3jp,项目名称:domjudge,代码行数:31,代码来源:testcase.php

示例10: putSubmissions


//.........这里部分代码省略.........
        }
        if ($sid == $highlight) {
            echo ' highlight';
        }
        if (!IS_JURY && !$row['seen']) {
            echo ' unseen';
        }
        echo '">';
        if (IS_JURY) {
            echo "<td><a{$link}>s{$sid}</a></td>";
        }
        if (IS_JURY && count($cids) > 1) {
            echo "<td><a{$link}>c{$row['cid']}</a></td>";
        }
        echo "<td><a{$link}>" . printtime($row['submittime']) . "</a></td>";
        if (IS_JURY) {
            echo '<td title="t' . htmlspecialchars($row['teamid']) . '">' . "<a{$link}>" . htmlspecialchars(str_cut($row['teamname'], 30)) . '</a></td>';
        }
        echo '<td class="probid" title="' . htmlspecialchars($row['probname']) . '">' . "<a{$link}>" . htmlspecialchars($row['shortname']) . '</a></td>';
        echo '<td class="langid" title="' . htmlspecialchars($row['langname']) . '">' . "<a{$link}>" . htmlspecialchars($row['langid']) . '</a></td>';
        echo "<td class=\"result\"><a{$link}>";
        if (difftime($row['submittime'], $cdatas[$row['cid']]['endtime']) >= 0) {
            echo printresult('too-late');
            if (IS_JURY && $row['result']) {
                echo " (" . printresult($row['result']) . ")";
            }
        } else {
            if (!$row['result'] || !IS_JURY && !$row['verified'] && dbconfig_get('verification_required', 0)) {
                echo printresult($row['judgehost'] || !IS_JURY ? '' : 'queued');
            } else {
                echo printresult($row['result']);
            }
        }
        echo "</a></td>";
        if (IS_JURY) {
            // only display verification if we're done with judging
            unset($verified, $jury_member);
            $claim = FALSE;
            if (empty($row['result'])) {
                $verified = '&nbsp;';
                $jury_member = '&nbsp;';
            } else {
                $verified = printyn($row['verified']);
                if (empty($row['jury_member'])) {
                    $jury_member = '&nbsp;';
                } else {
                    $jury_member = htmlspecialchars($row['jury_member']);
                }
                if (!$row['verified']) {
                    $vercnt++;
                    if (empty($row['jury_member'])) {
                        $claim = TRUE;
                    } else {
                        $verified = 'claimed';
                    }
                }
            }
            echo "<td><a{$link}>{$verified}</a></td><td>";
            if ($claim) {
                echo "<a class=\"button\" href=\"{$linkurl}&amp;claim=1\">claim</a>";
            } else {
                if (!$row['verified'] && $jury_member == $username) {
                    echo "<a class=\"button\" href=\"{$linkurl}&amp;unclaim=1\">unclaim</a>";
                } else {
                    echo "<a{$link}>{$jury_member}</a>";
                }
            }
            echo "</td>";
            if (isset($restrictions['rejudgingid'])) {
                echo "<td class=\"result\"><a href=\"submission.php?id={$sid}\">" . printresult($row['oldresult']) . "</a></td>";
            }
        }
        echo "</tr>\n";
        if ($row['result'] == 'correct') {
            $corcnt++;
        }
    }
    echo "</tbody>\n</table>\n\n";
    if (IS_JURY) {
        echo addEndForm();
        if ($limit > 0) {
            $query_extras = array('subcnt' => '', 'corcnt' => ' AND j.result LIKE \'correct\'', 'igncnt' => ' AND s.valid = 0', 'vercnt' => ' AND verified = 0 AND result IS NOT NULL', 'quecnt' => ' AND result IS NULL');
            foreach ($query_extras as $cnt => $query_extra) {
                ${$cnt} = $DB->q('VALUE SELECT count(s.submitid) ' . $sqlbody . $query_extra, @$restrictions['rejudgingid'], $cids, @$restrictions['teamid'], @$restrictions['categoryid'], @$restrictions['probid'], @$restrictions['langid'], @$restrictions['judgehost'], @$restrictions['rejudgingid'], @$restrictions['rejudgingid'], @$restrictions['old_result'], @$restrictions['result']);
            }
        }
        echo "<p>Total correct: {$corcnt}, submitted: {$subcnt}";
        if ($vercnt > 0) {
            echo ", unverified: {$vercnt}";
        }
        if ($igncnt > 0) {
            echo ", ignored: {$igncnt}";
        }
        if ($quecnt > 0) {
            echo ", judgement pending: {$quecnt}";
        }
        echo "</p>\n\n";
    }
    return;
}
开发者ID:nya3jp,项目名称:domjudge,代码行数:101,代码来源:common.php

示例11: auditlog

if (isset($_POST['answer']) && isset($_POST['answered'])) {
    $answered = (int) $_POST['answered'];
    $DB->q('UPDATE clarification SET answered = %i, jury_member = ' . ($answered ? '%s ' : 'NULL %_ ') . 'WHERE clarid = %i', $answered, $jury_member, $respid);
    auditlog('clarification', $respid, 'marked ' . ($answered ? 'answered' : 'unanswered'));
    // redirect back to the original location
    header('Location: clarification.php?id=' . $id);
    exit;
}
require_once LIBWWWDIR . '/header.php';
require LIBWWWDIR . '/clarification.php';
if (!$isgeneral) {
    // display clarification thread
    echo "<h1>Clarification {$id}</h1>\n\n";
    if (!$req['answered']) {
        echo addForm($pagename . '?id=' . urlencode($id));
        echo "<p>Claimed: " . "<strong>" . printyn(!empty($req['jury_member'])) . "</strong>";
        if (empty($req['jury_member'])) {
            echo '; ';
        } else {
            echo ', by ' . specialchars($req['jury_member']) . '; ' . addSubmit('unclaim', 'unclaim') . ' or ';
        }
        echo addSubmit('claim', 'claim') . '</p>' . addEndForm();
    }
    if (!empty($req['respid'])) {
        $orig = $DB->q('MAYBETUPLE SELECT q.*, t.name AS name FROM clarification q
	                LEFT JOIN team t ON (t.teamid = q.sender)
	                WHERE q.clarid = %i', $respid);
        echo '<p>See the <a href="clarification.php?id=' . $respid . '">original clarification ' . $respid . '</a> by ' . ($orig['sender'] == NULL ? 'Jury' : '<a href="team.php?id=' . urlencode($orig['sender']) . '">' . specialchars($orig['name'] . " (t" . $orig['sender'] . ")") . '</a>') . "</p>\n\n";
    }
    putClarification($id, NULL);
    // Display button to (un)set request as 'answered'
开发者ID:bertptrs,项目名称:domjudge,代码行数:31,代码来源:clarification.php

示例12: foreach

    if (empty($restrictions[$type])) {
        echo "<td class=\"nodata\">none</td></tr>\n";
    } else {
        $first = true;
        foreach ($restrictions[$type] as $val) {
            if (!$first) {
                echo '<tr><td></td>';
            }
            $first = false;
            echo "<td>" . $lists[$type][$val] . "</td></tr>\n";
        }
    }
}
echo '<tr><td>Rejudge by same judgehost:</td><td>' . printyn(!isset($restrictions['rejudge_own']) || (bool) $restrictions['rejudge_own']) . "</td></tr>\n";
echo "</table>\n\n";
if (IS_ADMIN) {
    echo "<p>" . editLink('judgehost_restriction', $data['restrictionid']) . "\n" . delLink('judgehost_restriction', 'restrictionid', $data['restrictionid'], $data['name']) . "</p>\n\n";
}
echo "<h2>Judgehosts having restriction " . specialchars($data['name']) . "</h2>\n\n";
$judgehosts = $DB->q('SELECT hostname, active FROM judgehost WHERE restrictionid = %i', $id);
if ($judgehosts->count() == 0) {
    echo "<p class=\"nodata\">no judgehosts</p>\n\n";
} else {
    echo "<table class=\"list\">\n<thead>\n" . "<tr><th scope=\"col\">hostname</th><th scope=\"col\">active</th></tr>\n" . "</thead>\n<tbody>\n";
    while ($judgehost = $judgehosts->next()) {
        $link = '<a href="judgehost.php?id=' . urlencode($judgehost['hostname']) . '">';
        echo "<tr" . ($judgehost['active'] ? '' : ' class="disabled"') . "><td>" . $link . specialchars($judgehost['hostname']) . "</a></td><td>" . $link . printyn($judgehost['active']) . "</a></td></tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
require LIBWWWDIR . '/footer.php';
开发者ID:bertptrs,项目名称:domjudge,代码行数:31,代码来源:judgehost_restriction.php

示例13: foreach

    echo "<p class=\"nodata\">No problems added yet</p>\n\n";
} else {
    echo "<table class=\"list sortable\">\n<thead>\n" . "<tr><th scope=\"col\" class=\"sorttable_numeric\">probid</th>";
    echo "<th scope=\"col\">name</th>";
    echo "<th scope=\"col\">shortname</th>";
    echo "<th scope=\"col\">points</th>";
    echo "<th scope=\"col\">allow<br />submit</th>";
    echo "<th scope=\"col\">allow<br />judge</th>";
    echo "<th class=\"sorttable_nosort\" scope=\"col\">colour</th>\n";
    echo "<th scope=\"col\">lazy eval</th>\n";
    echo "</tr>\n</thead>\n<tbody>\n";
    $iseven = false;
    foreach ($res as $row) {
        $link = '<a href="problem.php?id=' . urlencode($row['probid']) . '">';
        echo '<tr class="' . ($iseven ? 'roweven' : 'rowodd') . '">' . "<td class=\"tdright\">" . $link . "p" . (int) $row['probid'] . "</a></td>\n";
        echo "<td>" . $link . htmlspecialchars($row['name']) . "</a></td>\n";
        echo "<td>" . $link . htmlspecialchars($row['shortname']) . "</a></td>\n";
        echo "<td>" . $link . htmlspecialchars($row['points']) . "</a></td>\n";
        echo "<td class=\"tdcenter\">" . $link . printyn($row['allow_submit']) . "</a></td>\n";
        echo "<td class=\"tdcenter\">" . $link . printyn($row['allow_judge']) . "</a></td>\n";
        echo !empty($row['color']) ? '<td title="' . htmlspecialchars($row['color']) . '">' . $link . '<div class="circle" style="background-color: ' . htmlspecialchars($row['color']) . ';"></div></a></td>' : '<td>' . $link . '&nbsp;</a></td>';
        echo "<td>" . $link . (isset($row['lazy_eval_results']) ? printyn($row['lazy_eval_results']) : '-') . "</a></td>\n";
        if (IS_ADMIN) {
            echo "<td>" . delLinkMultiple('contestproblem', array('cid', 'probid'), array($id, $row['probid']), 'contest.php?id=' . $id) . "</td>";
        }
        $iseven = !$iseven;
        echo "</tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
require LIBWWWDIR . '/footer.php';
开发者ID:nya3jp,项目名称:domjudge,代码行数:31,代码来源:contest.php

示例14: specialchars

?>
<table>
<tr><td>ID/extension:</td><td><?php 
echo specialchars($data['langid']);
?>
</td></tr>
<tr><td>Name:        </td><td><?php 
echo specialchars($data['name']);
?>
</td></tr>
<tr><td>Allow submit:</td><td><?php 
echo printyn($data['allow_submit']) . ' ' . addSubmit('toggle', 'cmd[toggle_submit]', "return confirm('" . ($data['allow_submit'] ? 'Disallow' : 'Allow') . " submissions for this language?')");
?>
</td></tr>
<tr><td>Allow judge: </td><td><?php 
echo printyn($data['allow_judge']) . ' ' . addSubmit('toggle', 'cmd[toggle_judge]', "return confirm('" . ($data['allow_judge'] ? 'Disallow' : 'Allow') . " judging for this language?')");
?>
</td></tr>
<tr><td>Time factor:  </td><td><?php 
echo specialchars($data['time_factor']);
?>
 &times;</td></tr>
<tr><td>Compile script:</td><td class="filename">
<?php 
if (empty($data['compile_script'])) {
    echo '<span class="nodata">none specified</span>';
} else {
    echo '<a href="executable.php?id=' . urlencode($data['compile_script']) . '">' . specialchars($data['compile_script']) . '</a>';
}
?>
</td></tr>
开发者ID:bertptrs,项目名称:domjudge,代码行数:31,代码来源:language.php


注:本文中的printyn函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。