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


PHP addEndForm函数代码示例

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


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

示例1: put_print_form

function put_print_form()
{
    global $DB, $pagename;
    $langs = $DB->q('KEYTABLE SELECT langid AS ARRAYKEY, name, extensions FROM language
	                 WHERE allow_submit = 1 ORDER BY name');
    echo "<script type=\"text/javascript\">\n<!--\n";
    echo "function detectLanguage(filename)\n\t{\n\t\tvar parts = filename.toLowerCase().split('.').reverse();\n\t\tif ( parts.length < 2 ) return;\n\n\t\t// language ID\n\n\t\tvar elt=document.getElementById('langid');\n\t\t// the 'autodetect' option has empty value\n\t\tif ( elt.value != '' ) return;\n\n\t\tvar langid = getMainExtension(parts[0]);\n\t\tfor (i=0;i<elt.length;i++) {\n\t\t\tif ( elt.options[i].value == langid ) {\n\t\t\t\telt.selectedIndex = i;\n\t\t\t}\n\t\t}\n\n\t}\n";
    putgetMainExtension($langs);
    echo "// -->\n</script>\n";
    echo addForm($pagename, 'post', null, 'multipart/form-data');
    ?>

	<table>
	<tr><td><label for="code">File</label>:</td>
	<td><input type="file" name="code" id="code" size="40" required onChange='detectLanguage(document.getElementById("code").value);' /></td>
	</tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<tr><td><label for="langid">Language</label>:</td>
	    <td><?php 
    $langlist = array();
    foreach ($langs as $langid => $langdata) {
        $langlist[$langid] = $langdata['name'];
    }
    $langlist[''] = 'plain text';
    echo addSelect('langid', $langlist, '', true);
    ?>
</td>
	</tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<tr><td></td>
	    <td><?php 
    echo addSubmit('Print code', 'submit');
    ?>
</td>
	</tr>
	</table>

	<?php 
    echo addEndForm();
}
开发者ID:nya3jp,项目名称:domjudge,代码行数:40,代码来源:printing.php

示例2: array

}
echo "</table>\n";
echo "<h2>Details</h2>\n";
$restrictions = array('rejudgingid' => $id);
if ($viewtypes[$view] == 'unverified') {
    $restrictions['verified'] = 0;
}
if ($viewtypes[$view] == 'unjudged') {
    $restrictions['judged'] = 0;
}
if ($viewtypes[$view] == 'diff') {
    $restrictions['rejudgingdiff'] = 1;
}
if (isset($_REQUEST['old_verdict']) && $_REQUEST['old_verdict'] != 'all') {
    $restrictions['old_result'] = $_REQUEST['old_verdict'];
}
if (isset($_REQUEST['new_verdict']) && $_REQUEST['new_verdict'] != 'all') {
    $restrictions['result'] = $_REQUEST['new_verdict'];
}
echo addForm($pagename, 'get') . "<p>Show submissions:\n" . addHidden('id', $id);
for ($i = 0; $i < count($viewtypes); ++$i) {
    echo addSubmit($viewtypes[$i], 'view[' . $i . ']', null, $view != $i);
}
$verdicts = array_keys($verdicts);
array_unshift($verdicts, 'all');
echo "<br/>old verdict: " . addSelect('old_verdict', $verdicts, isset($_REQUEST['old_verdict']) ? $_REQUEST['old_verdict'] : 'all');
echo ", new verdict: " . addSelect('new_verdict', $verdicts, isset($_REQUEST['new_verdict']) ? $_REQUEST['new_verdict'] : 'all');
echo addSubmit('filter');
echo "</p>\n" . addEndForm();
putSubmissions($cdatas, $restrictions);
require LIBWWWDIR . '/footer.php';
开发者ID:nya3jp,项目名称:domjudge,代码行数:31,代码来源:rejudging.php

示例3: putScoreBoard

/**
 * Function to output a complete scoreboard.
 * This takes care of outputting the headings, start/endtimes and footer
 * of the scoreboard. It calls genScoreBoard to generate the data and
 * renderScoreBoardTable for displaying the actual table.
 *
 * Arguments:
 * $cdata       current contest data, as from an index in 'getCurContests(TRUE)'
 * $myteamid    set to highlight that teamid in the scoreboard
 * $static      generate a static scoreboard, e.g. for external use
 * $filter      set to TRUE to generate filter options, or pass array
 *              with keys 'affilid', 'country', 'categoryid' pointing
 *              to array of values to filter on these.
 * $sdata       if not NULL, use this as scoreboard data instead of fetching it locally
 */
function putScoreBoard($cdata, $myteamid = NULL, $static = FALSE, $filter = FALSE, $sdata = NULL)
{
    global $DB, $pagename;
    if (empty($cdata)) {
        echo "<p class=\"nodata\">No active contest</p>\n";
        return;
    }
    $fdata = calcFreezeData($cdata);
    if ($sdata === NULL) {
        $sdata = genScoreBoard($cdata, IS_JURY, $filter);
    }
    // page heading with contestname and start/endtimes
    echo '<div class="score-head">';
    echo "<h1>Scoreboard " . htmlspecialchars($cdata['name']) . "</h1>\n\n";
    if ($fdata['showfinal']) {
        echo "<h4>final standings</h4>\n\n";
    } elseif (!$fdata['cstarted']) {
        echo "<h4>" . printContestStart($cdata) . "</h4>\n\n";
        // Stop here (do not leak problem number, descriptions etc).
        // Alternatively we could only display the list of teams?
        if (!IS_JURY) {
            return;
        }
    } else {
        echo "<h4>starts: " . printtime($cdata['starttime']) . " - ends: " . printtime($cdata['endtime']);
        if ($fdata['showfrozen']) {
            echo " (";
            if (IS_JURY) {
                echo '<a href="../public/">the public scoreboard</a> is ';
            }
            echo "frozen since " . printtime($cdata['freezetime']) . ")";
        }
        echo "</h4>\n\n";
    }
    echo '</div>';
    // The static scoreboard does not support filtering
    if ($filter !== FALSE && $static !== TRUE) {
        $categids = $DB->q('KEYVALUETABLE SELECT categoryid, name FROM team_category ' . (IS_JURY ? '' : 'WHERE visible = 1 '));
        // show only affilids/countries with visible teams
        if (empty($categids)) {
            $affils = array();
        } else {
            $affils = $DB->q('KEYTABLE SELECT affilid AS ARRAYKEY,
			                  team_affiliation.name, country
			                  FROM team_affiliation
			                  LEFT JOIN team t USING (affilid)
			                  INNER JOIN contest c ON (c.cid = %i)
			                  LEFT JOIN contestteam ct ON (ct.teamid = t.teamid AND ct.cid = c.cid)
			                  WHERE categoryid IN (%As) AND c.cid = %i AND
			                  (c.public = 1 OR ct.teamid IS NOT NULL)
			                  GROUP BY affilid', $cdata['cid'], array_keys($categids), $cdata['cid']);
        }
        $affilids = array();
        $countries = array();
        foreach ($affils as $id => $affil) {
            $affilids[$id] = $affil['name'];
            if (isset($affil['country'])) {
                $countries[] = $affil['country'];
            }
        }
        $countries = array_unique($countries);
        sort($countries);
        $filteron = array();
        $filtertext = "";
        foreach (array('affilid' => 'affiliation', 'country' => 'country', 'categoryid' => 'category') as $type => $text) {
            if (isset($filter[$type])) {
                $filteron[] = $text;
            }
        }
        if (sizeof($filteron) > 0) {
            $filtertext = "(filtered on " . implode(", ", $filteron) . ")";
        }
        require_once LIBWWWDIR . '/forms.php';
        ?>

<table class="scorefilter">
<tr>
<td><a class="collapse" href="javascript:collapse('filter')"><img src="../images/filter.png" alt="filter&hellip;" title="filter&hellip;" class="picto" /></a></td>
<td><?php 
        echo $filtertext;
        ?>
</td>
<td><div id="detailfilter">
<?php 
        echo addForm($pagename, 'get') . (count($affilids) > 1 ? addSelect('affilid[]', $affilids, @$filter['affilid'], TRUE, 8) : "") . (count($countries) > 1 ? addSelect('country[]', $countries, @$filter['country'], FALSE, 8) : "") . (count($categids) > 1 ? addSelect('categoryid[]', $categids, @$filter['categoryid'], TRUE, 8) : "") . addSubmit('filter', 'filter') . addSubmit('clear', 'clear') . addEndForm();
//.........这里部分代码省略.........
开发者ID:22a,项目名称:Cleaner-Ducss-Judge,代码行数:101,代码来源:scoreboard.php

示例4: rejudgeForm

/**
 * Returns a form to rejudge all judgings based on a (table,id)
 * pair. For example, to rejudge all for language 'java', call
 * as rejudgeForm('language', 'java').
 */
function rejudgeForm($table, $id)
{
    $ret = addForm('rejudge.php') . addHidden('table', $table) . addHidden('id', $id);
    $button = 'REJUDGE this submission';
    $question = "Rejudge submission s{$id}?";
    $disabled = false;
    $allbutton = false;
    // special case submission
    if ($table == 'submission') {
        // disable the form button if there are no valid judgings anyway
        // (nothing to rejudge) or if the result is already correct
        global $DB;
        $validresult = $DB->q('MAYBEVALUE SELECT result FROM judging WHERE
		                       submitid = %i AND valid = 1', $id);
        if (IS_ADMIN) {
            if (!$validresult) {
                $question = "Restart judging of PENDING submission s{$id}, " . 'are you sure?';
                $button = 'RESTART judging';
            } elseif ($validresult == 'correct') {
                $question = "Rejudge CORRECT submission s{$id}, " . 'are you sure?';
            }
        } else {
            if (!$validresult || $validresult == 'correct') {
                $disabled = true;
            }
        }
    } else {
        $button = "REJUDGE ALL for {$table} {$id}";
        $question = "Rejudge all submissions for this {$table}?";
        if (IS_ADMIN) {
            $allbutton = true;
        }
    }
    $ret .= '<input type="submit" value="' . htmlspecialchars($button) . '" ' . ($disabled ? 'disabled="disabled"' : 'onclick="return confirm(\'' . htmlspecialchars($question) . '\');"') . " />\n" . ($allbutton ? addCheckBox('include_all') . '<label for="include_all">include pending/correct submissions</label>' : '') . addCheckBox('full_rejudge') . '<label for="full_rejudge">create rejudging with reason: </label>' . addInput('reason', '', 0, 255) . addEndForm();
    return $ret;
}
开发者ID:retnan,项目名称:domjudge,代码行数:41,代码来源:common.jury.php

示例5: putClock

if (checkrole('team')) {
    echo "<a target=\"_top\" href=\"../team/\" accesskey=\"t\"><span class=\"octicon octicon-arrow-right\"></span> team</a>\n";
}
?>
</div>

<div id="menutopright">
<?php 
putClock();
$notify_flag = isset($_COOKIE["domjudge_notify"]) && (bool) $_COOKIE["domjudge_notify"];
$refresh_flag = !isset($_COOKIE["domjudge_refresh"]) || (bool) $_COOKIE["domjudge_refresh"];
echo "<div id=\"toggles\">\n";
if (isset($refresh)) {
    $text = $refresh_flag ? 'Disable' : 'Enable';
    echo '<input id="refresh-toggle" type="button" value="' . $text . ' refresh" />';
}
// Default hide this from view, only show when javascript and
// notifications are available:
echo '<div id="notify" style="display: none">' . addForm('toggle_notify.php', 'get') . addHidden('enable', $notify_flag ? 0 : 1) . addSubmit(($notify_flag ? 'Dis' : 'En') . 'able notifications', 'toggle_notify', 'return toggleNotifications(' . ($notify_flag ? 'false' : 'true') . ')') . addEndForm() . "</div>";
?>
<script type="text/javascript">
<!--
    if ( 'Notification' in window ) {
		document.getElementById('notify').style.display = 'block';
	}
// -->
</script>

</div>
</div></nav>
开发者ID:bertptrs,项目名称:domjudge,代码行数:30,代码来源:menu.php

示例6: error

                    break;
                case 'NOCONSTRAINT':
                    break;
                default:
                    error("{$t}.{$key} is referenced in {$table} with unknown action '{$action}'.");
            }
        }
    }
}
if (isset($_POST['confirm'])) {
    // LIMIT 1 is a security measure to prevent our bugs from
    // wiping a table by accident.
    $DB->q("DELETE FROM {$t} WHERE %SS LIMIT 1", $k);
    auditlog($t, implode(', ', $k), 'deleted');
    echo "<p>" . ucfirst($t) . " <strong>" . specialchars(implode(", ", $k)) . "</strong> has been deleted.</p>\n\n";
    if (!empty($referrer)) {
        echo "<p><a href=\"" . $referrer . "\">back to overview</a></p>";
    } else {
        // one table falls outside the predictable filenames
        $tablemulti = $t == 'team_category' ? 'team_categories' : $t . 's';
        echo "<p><a href=\"" . $tablemulti . ".php\">back to {$tablemulti}</a></p>";
    }
} else {
    echo addForm($pagename) . addHidden('table', $t);
    foreach ($k as $key => $val) {
        echo addHidden($key, $val);
    }
    echo msgbox("Really delete?", "You're about to delete {$t} <strong>" . specialchars(join(", ", array_values($k))) . (empty($desc) ? '' : ' "' . specialchars($desc) . '"') . "</strong>.<br />\n" . (count($warnings) > 0 ? "<br /><strong>Warning, this will:</strong><br />" . implode('<br />', $warnings) : '') . "<br /><br />\n" . "Are you sure?<br /><br />\n\n" . (empty($referrer) ? '' : addHidden('referrer', $referrer)) . addSubmit(" Never mind... ", 'cancel') . addSubmit(" Yes I'm sure! ", 'confirm'));
    echo addEndForm();
}
require LIBWWWDIR . '/footer.php';
开发者ID:bertptrs,项目名称:domjudge,代码行数:31,代码来源:delete.php

示例7: echo

echo (int) $data['outputlimit'] . ' kB' . (@$defaultoutputlimit ? ' (default)' : '');
?>
</td></tr>
<?php 
if (!empty($data['color'])) {
    echo '<tr><td>Colour:</td><td><div class="circle" style="background-color: ' . specialchars($data['color']) . ';"></div> ' . specialchars($data['color']) . "</td></tr>\n";
}
if (!empty($data['problemtext_type'])) {
    echo '<tr><td>Problem text:</td><td class="nobreak"><a href="problem.php?id=' . urlencode($id) . '&amp;cmd=viewtext"><img src="../images/' . urlencode($data['problemtext_type']) . '.png" alt="problem text" ' . 'title="view problem description" /></a> ' . "</td></tr>\n";
}
echo '<tr><td>Run script:</td><td class="filename">' . '<a href="executable.php?id=' . urlencode($data['special_run']) . '">' . specialchars($data['special_run']) . "</a>" . (@$defaultrun ? ' (default)' : '') . "</td></tr>\n";
echo '<tr><td>Compare script:</td><td class="filename">' . '<a href="executable.php?id=' . urlencode($data['special_compare']) . '">' . specialchars($data['special_compare']) . "</a>" . (@$defaultcompare ? ' (default)' : '') . "</td></tr>\n";
if (!empty($data['special_compare_args'])) {
    echo '<tr><td>Compare script arguments:</td><td>' . specialchars($data['special_compare_args']) . "</td></tr>\n";
}
echo "</table>\n" . addEndForm();
if (IS_ADMIN) {
    echo "<p>" . exportLink($id) . "\n" . editLink('problem', $id) . "\n" . delLink('problem', 'probid', $id) . "</p>\n\n";
}
echo rejudgeForm('problem', $id) . "<br />\n\n";
if ($current_cid === null) {
    echo "<h3>Contests</h3>\n\n";
    $res = $DB->q('TABLE SELECT c.*, cp.shortname AS problemshortname,
	                            cp.allow_submit, cp.allow_judge, cp.color
	               FROM contest c
	               INNER JOIN contestproblem cp USING (cid)
	               WHERE cp.probid = %i ORDER BY starttime DESC', $id);
    if (count($res) == 0) {
        echo "<p class=\"nodata\">No contests defined</p>\n\n";
    } else {
        $times = array('activate', 'start', 'freeze', 'end', 'unfreeze');
开发者ID:Surya97,项目名称:domjudge,代码行数:31,代码来源:problem.php

示例8: ON

                    LEFT JOIN team t ON (t.teamid = c.recipient)
                    LEFT JOIN team f ON (f.teamid = c.sender)
                    WHERE c.cid = %i AND c.sender = %i
                    ORDER BY submittime DESC, clarid DESC', $cid, $teamid);
$clarifications = $DB->q('SELECT c.*, cp.shortname, t.name AS toname, f.name AS fromname,
                          u.mesgid AS unread
                          FROM clarification c
                          LEFT JOIN problem p USING (probid)
                          LEFT JOIN contestproblem cp USING (probid, cid)
                          LEFT JOIN team t ON (t.teamid = c.recipient)
                          LEFT JOIN team f ON (f.teamid = c.sender)
                          LEFT JOIN team_unread u ON (c.clarid=u.mesgid AND u.teamid = %i)
                          WHERE c.cid = %i AND c.sender IS NULL
                          AND ( c.recipient IS NULL OR c.recipient = %i )
                          ORDER BY c.submittime DESC, c.clarid DESC', $teamid, $cid, $teamid);
echo "<h3 class=\"teamoverview\">Clarifications</h3>\n";
# FIXME: column width and wrapping/shortening of clarification text
if ($clarifications->count() == 0) {
    echo "<p class=\"nodata\">No clarifications.</p>\n\n";
} else {
    putClarificationList($clarifications, $teamid);
}
echo "<h3 class=\"teamoverview\">Clarification Requests</h3>\n";
if ($requests->count() == 0) {
    echo "<p class=\"nodata\">No clarification requests.</p>\n\n";
} else {
    putClarificationList($requests, $teamid);
}
echo addForm('clarification.php', 'get') . "<p>" . addSubmit('request clarification') . "</p>" . addEndForm();
echo "</div>\n";
require LIBWWWDIR . '/footer.php';
开发者ID:Surya97,项目名称:domjudge,代码行数:31,代码来源:index.php

示例9: header

		        endtime = %s, freezetime = %s, unfreezetime = %s,
		        activatetime = %s, deactivatetime = %s
		        WHERE cid = %i', $docdata['starttime'], $docdata['starttime_string'], $docdata['endtime'], $docdata['freezetime'], $docdata['unfreezetime'], $docdata['activatetime'], $docdata['deactivatetime'], $docid);
        header("Location: ./contests.php?edited=1");
    } else {
        $DB->q('UPDATE contest SET ' . $time . 'time = %s, ' . $time . 'time_string = %s
		        WHERE cid = %i', $now, $nowstring, $docid);
        header("Location: ./contests.php");
    }
    exit;
}
$title = 'Contests';
require LIBWWWDIR . '/header.php';
echo "<h1>Contests</h1>\n\n";
if (isset($_GET['edited'])) {
    echo addForm('refresh_cache.php') . msgbox("Warning: Refresh scoreboard cache", "After changing the contest start time, it may be necessary to recalculate any cached scoreboards.<br /><br />" . addSubmit('recalculate caches now', 'refresh')) . addEndForm();
}
// Display current contest data prominently
echo "<fieldset><legend>Current contests: ";
$curcids = getCurContests(FALSE);
if (empty($curcids)) {
    echo "none</legend>\n\n";
    $row = $DB->q('MAYBETUPLE SELECT * FROM contest
	               WHERE activatetime > UNIX_TIMESTAMP() AND enabled = 1
	               ORDER BY activatetime LIMIT 1');
    if ($row) {
        echo "<form action=\"contests.php\" method=\"post\">\n";
        echo addHidden('cid', $row['cid']);
        echo "<p>No active contest. Upcoming:<br/> <em>" . specialchars($row['name']) . ' (' . specialchars($row['shortname']) . ')' . "</em>; active from " . printtime($row['activatetime'], '%a %d %b %Y %T %Z') . "<br /><br />\n";
        if (IS_ADMIN) {
            echo addSubmit("activate now", "donow[activate]");
开发者ID:sponi78,项目名称:domjudge,代码行数:31,代码来源:contests.php

示例10: putClock

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

示例11: addFileField

    }
    echo "</script>\n\n";
    ?>
<h3>Create new testcase</h3>

<table>
<tr><td>Input testdata: </td><td><?php 
    echo addFileField('add_input');
    ?>
</td></tr>
<tr><td>Output testdata:</td><td><?php 
    echo addFileField('add_output');
    ?>
</td></tr>
<tr><td>Sample testcase:</td><td><?php 
    echo addSelect('add_sample', array("no", "yes"), 0, true);
    ?>
</td></tr>
<tr><td>Description:    </td><td><?php 
    echo addInput('add_desc', '', 30);
    ?>
</td></tr>
<tr><td>Image:          </td><td><?php 
    echo addFileField('add_image');
    ?>
</td></tr>
</table>
<?php 
    echo "<br />" . addSubmit('Submit all changes') . addEndForm();
}
require LIBWWWDIR . '/footer.php';
开发者ID:nya3jp,项目名称:domjudge,代码行数:31,代码来源:testcase.php

示例12: addForm

<p>Unknown authentication scheme in use.</p>
<?php 
}
echo addForm($pagename);
?>
<p>Generate a random password for:<br/>
<input type="checkbox" name="group[]" value="team">all teams<br />
<input type="checkbox" name="group[]" value="teamwithoutpw">teams without password<br />
<input type="checkbox" name="group[]" value="judge">jury members<br />
<input type="checkbox" name="group[]" value="admin">admins<br />
</p>
<p>Output format:<br/>
<input type="radio" name="format" value="page" checked>on web page<br/>
<input type="radio" name="format" value="tsv">as userdata.tsv download<br/>
<?php 
echo addSubmit('generate') . addEndForm();
require LIBWWWDIR . '/footer.php';
/**
 * Generate a random password of length 6 with lowercase alphanumeric
 * characters, except o, 0, l and 1 since these can be confusing.
 */
function genrandpasswd()
{
    $chars = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '2', '3', '4', '5', '6', '7', '8', '9');
    $max_chars = count($chars) - 1;
    $rand_str = '';
    for ($i = 0; $i < 6; ++$i) {
        $rand_str .= $chars[mt_rand(0, $max_chars)];
    }
    return $rand_str;
}
开发者ID:nya3jp,项目名称:domjudge,代码行数:31,代码来源:genpasswds.php

示例13: printyn

        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'
    // Not relevant for 'general clarifications', ie those with sender=null
    if (!empty($req['sender'])) {
        echo addForm($pagename) . addHidden('id', $id) . addHidden('answered', !$req['answered']) . addSubmit('Set ' . ($req['answered'] ? 'unanswered' : 'answered'), 'answer') . addEndForm();
    }
}
// end if ( ! $isgeneral )
// display a clarification send box
if ($isgeneral) {
    echo "<h1>Send Clarification</h1>\n\n";
    putClarificationForm("clarification.php");
} else {
    echo "<h1>Send Response</h1>\n\n";
    putClarificationForm("clarification.php", $respid);
}
require LIBWWWDIR . '/footer.php';
开发者ID:bertptrs,项目名称:domjudge,代码行数:31,代码来源:clarification.php

示例14: json_encode

        ?>
',
			preventDuplicates: true,
			excludeCurrent: true,
			prePopulate: <?php 
        echo json_encode($prepopulate);
        ?>
		});
	});
</script>
<?php 
    }
    $rejudge_own = !isset($row['restrictions']['rejudge_own']) || (bool) $row['restrictions']['rejudge_own'];
    echo '<tr><td>Rejudge on same judgehost:</td><td>' . addRadioButton('data[0][restrictions][rejudge_own]', $rejudge_own, 1) . '<label for="data_0__restrictions__rejudge_own_1">yes</label>' . addRadioButton('data[0][restrictions][rejudge_own]', !$rejudge_own, 0) . '<label for="data_0__restrictions__rejudge_own_0">no</label>' . "</td></tr>\n";
    echo "</table>\n\n";
    echo addHidden('cmd', $cmd) . addHidden('table', 'judgehost_restriction') . addHidden('referrer', @$_GET['referrer']) . addSubmit('Save') . addSubmit('Cancel', 'cancel', null, true, 'formnovalidate') . addEndForm();
    require LIBWWWDIR . '/footer.php';
    exit;
}
$data = $DB->q('TUPLE SELECT * FROM judgehost_restriction WHERE restrictionid = %i', $id);
if (!$data) {
    error("Missing or invalid restriction id");
}
echo "<h1>Restriction: " . specialchars($data['name']) . "</h1>\n\n";
echo "<table>\n";
echo '<tr><td>ID:</td><td>' . specialchars($data['restrictionid']) . "</td></tr>\n";
echo '<tr><td>Name:</td><td>' . specialchars($data['name']) . "</td></tr>\n";
$restrictions = json_decode($data['restrictions'], true);
foreach (array('contest', 'problem', 'language') as $type) {
    echo "<tr><td>Restrict to {$type}s:</td>";
    if (empty($restrictions[$type])) {
开发者ID:bertptrs,项目名称:domjudge,代码行数:31,代码来源:judgehost_restriction.php

示例15: header

            // Our color field can be both a HTML color name and an RGB value,
            // so we output it only in the human-readable field "color" and
            // leave the field "rgb" unset.
            $problem['color'] = $prob['color'];
            $contest_data['problems'][] = $problem;
        }
    }
    $yaml = Spyc::YAMLDump($contest_data);
    echo $yaml;
    header('Content-type: text/x-yaml');
    header('Content-Disposition: attachment; filename="contest.yaml"');
    exit;
}
$title = "Import / export configuration";
require LIBWWWDIR . '/header.php';
echo "<h1>Import / export configuration</h1>\n\n";
if (isset($_GET['import-ok'])) {
    echo msgbox("Import successful!", "The file " . specialchars(@$_GET['file']) . " is successfully imported.");
}
echo "<h2>Import from YAML</h2>\n\n";
echo addForm('impexp_contestyaml.php', 'post', null, 'multipart/form-data');
echo msgbox("Please note!", "Importing a contest.yaml may overwrite some settings " . "(e.g. penalty time, clarification categories, clarification answers, etc.)." . "This action can not be undone!");
echo addFileField('import_config');
echo addSubmit('Import', 'import') . addEndForm();
echo "<h2>Export to YAML</h2>\n\n";
echo addForm('impexp_contestyaml.php');
echo '<label for="contest">Select contest: </label>';
$contests = $DB->q("KEYVALUETABLE SELECT cid, name FROM contest");
echo addSelect('contest', $contests, null, true);
echo addSubmit('Export', 'export') . addEndForm();
require LIBWWWDIR . '/footer.php';
开发者ID:rohit-takhar,项目名称:domjudge,代码行数:31,代码来源:impexp_contestyaml.php


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