/**
 * List search results
 * @param array $res Array containing results of search
 * @param bool $includesource If true, adds backend column to address listing
 */
function addr_display_result($res, $includesource = true)
{
    global $PHP_SELF, $oTemplate, $oErrorHandler;
    //FIXME: no HTML output from core
    echo addForm($PHP_SELF, 'post', 'addressbook', '', '', array(), TRUE) . addHidden('html_addr_search_done', 'true');
    addr_insert_hidden();
    $oTemplate->assign('compose_addr_pop', false);
    $oTemplate->assign('include_abook_name', $includesource);
    $oTemplate->assign('addresses', formatAddressList($res));
    $oTemplate->display('addrbook_search_list.tpl');
    echo '</form>';
}
示例#2
0
文件: forms.php 项目: jprice/EHCP
/**
 * Function to create a selectlist from an array.
 * Usage:
 * name: html name attribute
 * values: array ( key => value )  ->     <option value="key">value</option>
 * default: the key that will be selected
 * usekeys: use the keys of the array as option value or not
 */
function addSelect($name, $values, $default = null, $usekeys = false)
{
    // only one element
    if (count($values) == 1) {
        $k = key($values);
        $v = array_pop($values);
        return addHidden($name, $usekeys ? $k : $v) . htmlspecialchars($v) . "\n";
    }
    $ret = '<select name="' . htmlspecialchars($name) . "\">\n";
    foreach ($values as $k => $v) {
        if (!$usekeys) {
            $k = $v;
        }
        $ret .= '<option value="' . htmlspecialchars($k) . '"' . ($default == $k ? ' selected="selected"' : '') . '>' . htmlspecialchars($v) . "</option>\n";
    }
    $ret .= "</select>\n";
    return $ret;
}
示例#3
0
function writeContent()
{
    global $sId, $aStates, $isPost, $sName, $sEmail, $nPhone, $sAddress, $sAddress2, $sCity, $sState, $nZip, $bAdmin, $bActive;
    if (!empty($sId)) {
        addHidden('use_id', $sId);
    }
    addField(makeInput('Name', 'use_name', $sName), true);
    addField(makeEmail('Email Address', 'use_email', $sEmail), true);
    addField(makePassword('Password', 'use_password'));
    addField(makeInput('Phone', 'use_phone', $nPhone, 'size="13"'));
    addField(makeInput('Address', 'use_address', $sAddress, 'size="30"'));
    addField(makeInput('Address 2', 'use_address2', $sAddress2, 'size="30"'));
    addField(makeInput('City', 'use_city', $sCity));
    addField(makeSelect('State', 'use_state', $aStates, $sState));
    addField(makeInput('Zip', 'use_zip', $nZip, 'size="10"'));
    addField(makeCheckbox('Admin', 'use_admin', $bAdmin));
    addField(makeCheckbox('Active', 'use_active', $bActive));
    addField(makeSubmit('Save', 'save') . ' ' . makeCancel('Cancel', 'cancel'));
    writeDataForm($_SERVER['PHP_SELF'], 'user');
}
示例#4
0
/**
 * 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;
}
示例#5
0
                    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';
/**
 * List search results
 * @param array $res Array containing results of search
 * @param bool $includesource UNDOCUMENTED [Default=true]
 */
function addr_display_result($res, $includesource = true)
{
    global $color, $javascript_on, $PHP_SELF, $squirrelmail_language;
    if (sizeof($res) <= 0) {
        return;
    }
    echo addForm($PHP_SELF, 'POST', 'addrbook') . addHidden('html_addr_search_done', 'true');
    addr_insert_hidden();
    $line = 0;
    if ($javascript_on) {
        print '<script language="JavaScript" type="text/javascript">' . "\n<!-- \n" . "function CheckAll(ch) {\n" . "   for (var i = 0; i < document.addrbook.elements.length; i++) {\n" . "       if( document.addrbook.elements[i].type == 'checkbox' &&\n" . "           document.addrbook.elements[i].name.substr(0,16) == 'send_to_search['+ch ) {\n" . "           document.addrbook.elements[i].checked = !(document.addrbook.elements[i].checked);\n" . "       }\n" . "   }\n" . "}\n" . "//-->\n" . "</script>\n";
        $chk_all = '<a href="#" onClick="CheckAll(\'T\');">' . _("All") . '</a>&nbsp;<font color="' . $color[9] . '">' . _("To") . '</font>' . '&nbsp;&nbsp;' . '<a href="#" onClick="CheckAll(\'C\');">' . _("All") . '</a>&nbsp;<font color="' . $color[9] . '">' . _("Cc") . '</font>' . '&nbsp;&nbsp;' . '<a href="#" onClick="CheckAll(\'B\');">' . _("All") . '</a>';
    }
    echo html_tag('table', '', 'center', '', 'border="0" width="98%"') . html_tag('tr', '', '', $color[9]) . html_tag('th', '&nbsp;' . $chk_all, 'left') . html_tag('th', '&nbsp;' . _("Name"), 'left') . html_tag('th', '&nbsp;' . _("E-mail"), 'left') . html_tag('th', '&nbsp;' . _("Info"), 'left');
    if ($includesource) {
        echo html_tag('th', '&nbsp;' . _("Source"), 'left', '', 'width="10%"');
    }
    echo "</tr>\n";
    foreach ($res as $row) {
        $email = AddressBook::full_address($row);
        if ($line % 2) {
            $tr_bgcolor = $color[12];
        } else {
            $tr_bgcolor = $color[4];
        }
        if ($squirrelmail_language == 'ja_JP') {
            echo html_tag('tr', '', '', $tr_bgcolor, 'nowrap') . html_tag('td', '<input type="checkbox" name="send_to_search[T' . $line . ']" value = "' . htmlspecialchars($email) . '" />&nbsp;' . _("To") . '&nbsp;' . '<input type="checkbox" name="send_to_search[C' . $line . ']" value = "' . htmlspecialchars($email) . '" />&nbsp;' . _("Cc") . '&nbsp;' . '<input type="checkbox" name="send_to_search[B' . $line . ']" value = "' . htmlspecialchars($email) . '" />&nbsp;' . _("Bcc") . '&nbsp;', 'center', '', 'width="5%" nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['lastname']) . ' ' . htmlspecialchars($row['firstname']) . '&nbsp;', 'left', '', 'nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['email']) . '&nbsp;', 'left', '', 'nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['label']) . '&nbsp;', 'left', '', 'nowrap');
        } else {
            echo html_tag('tr', '', '', $tr_bgcolor, 'nowrap') . html_tag('td', addCheckBox('send_to_search[T' . $line . ']', FALSE, $email) . '&nbsp;' . _("To") . '&nbsp;' . addCheckBox('send_to_search[C' . $line . ']', FALSE, $email) . '&nbsp;' . _("Cc") . '&nbsp;' . addCheckBox('send_to_search[B' . $line . ']', FALSE, $email) . '&nbsp;' . _("Bcc") . '&nbsp;', 'center', '', 'width="5%" nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['name']) . '&nbsp;', 'left', '', 'nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['email']) . '&nbsp;', 'left', '', 'nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['label']) . '&nbsp;', 'left', '', 'nowrap');
        }
        if ($includesource) {
            echo html_tag('td', '&nbsp;' . $row['source'] . '&nbsp;', 'left', '', 'nowrap');
        }
        echo "</tr>\n";
        $line++;
    }
    if ($includesource) {
        $td_colspan = '5';
    } else {
        $td_colspan = '4';
    }
    echo html_tag('tr', html_tag('td', '<input type="submit" name="addr_search_done" value="' . _("Use Addresses") . '" />', 'center', '', 'colspan="' . $td_colspan . '"')) . '</table>' . addHidden('html_addr_search_done', '1') . '</form>';
}
示例#7
0
}
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';
示例#8
0
    @(include $theme[$theme_default]['PATH']);
}
displayHtmlHeader("{$org_name} - " . _("Login"), $header, FALSE);
echo "<body text=\"{$color['8']}\" bgcolor=\"{$color['4']}\" link=\"{$color['7']}\" vlink=\"{$color['7']}\" alink=\"{$color['7']}\" onLoad=\"squirrelmail_loginpage_onload()\">" . "\n" . '<form action="redirect.php" method="post" onSubmit="document.forms[0].js_autodetect_results.value=\'' . SMPREF_JS_ON . '\';">' . "\n";
$username_form_name = 'login_username';
$password_form_name = 'secretkey';
do_hook('login_top');
$loginname_value = sqGetGlobalVar('loginname', $loginname) ? htmlspecialchars($loginname) : '';
/* If they don't have a logo, don't bother.. */
if (isset($org_logo) && $org_logo) {
    /* Display width and height like good little people */
    $width_and_height = '';
    if (isset($org_logo_width) && is_numeric($org_logo_width) && $org_logo_width > 0) {
        $width_and_height = " width=\"{$org_logo_width}\"";
    }
    if (isset($org_logo_height) && is_numeric($org_logo_height) && $org_logo_height > 0) {
        $width_and_height .= " height=\"{$org_logo_height}\"";
    }
}
if (sqgetGlobalVar('mailto', $mailto)) {
    $rcptaddress = addHidden('mailto', $mailto);
} else {
    $rcptaddress = '';
}
echo html_tag('table', html_tag('tr', html_tag('td', '<center>' . (isset($org_logo) && $org_logo ? '<img src="' . $org_logo . '" alt="' . sprintf(_("%s Logo"), $org_name) . '"' . $width_and_height . ' /><br />' . "\n" : '') . (isset($hide_sm_attributions) && $hide_sm_attributions ? '' : '<small>' . sprintf(_("SquirrelMail version %s"), $version) . '<br />' . "\n" . '  ' . _("By the SquirrelMail Development Team") . '<br /></small>' . "\n") . html_tag('table', html_tag('tr', html_tag('td', '<b>' . sprintf(_("%s Login"), $org_name) . "</b>\n", 'center', $color[0])) . html_tag('tr', html_tag('td', "\n" . html_tag('table', html_tag('tr', html_tag('td', _("Name:"), 'right', '', 'width="30%"') . html_tag('td', addInput($username_form_name, $loginname_value), 'left', '', 'width="*"')) . "\n" . html_tag('tr', html_tag('td', _("Password:"******"30%"') . html_tag('td', addPwField($password_form_name) . addHidden('js_autodetect_results', SMPREF_JS_OFF) . $rcptaddress . addHidden('just_logged_in', '1'), 'left', '', 'width="*"')), 'center', $color[4], 'border="0" width="100%"'), 'left', $color[4])) . html_tag('tr', html_tag('td', '<center>' . addSubmit(_("Login")) . '</center>', 'left')), '', $color[4], 'border="0" width="350"') . '</center>', 'center')), '', $color[4], 'border="0" cellspacing="0" cellpadding="0" width="100%"');
do_hook('login_form');
echo '</form>' . "\n";
do_hook('login_bottom');
?>
</body></html>
示例#9
0
    echo addInput('data[0][country]', @$row['country'], 4, 3, 'pattern="[A-Z]{3}" title="three uppercase letters (ISO-3166-1 alpha-3)"');
    ?>
<a target="_blank"
href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Current_codes"><img
src="../images/b_help.png" class="smallpicto" alt="?" /></a></td></tr>

<tr><td><label for="data_0__comments_">Comments:</label></td>
<td><?php 
    echo addTextArea('data[0][comments]', @$row['comments']);
    ?>
</td></tr>

</table>

<?php 
    echo addHidden('cmd', $cmd) . addHidden('table', 'team_affiliation') . addHidden('referrer', @$_GET['referrer']) . addSubmit('Save') . addSubmit('Cancel', 'cancel', null, true, 'formnovalidate') . addEndForm();
    require LIBWWWDIR . '/footer.php';
    exit;
}
$data = $DB->q('MAYBETUPLE SELECT * FROM team_affiliation WHERE affilid = %s', $id);
if (!$data) {
    error("Missing or invalid affiliation id");
}
$affillogo = "../images/affiliations/" . urlencode($data['affilid']) . ".png";
$countryflag = "../images/countries/" . urlencode($data['country']) . ".png";
echo "<h1>Affiliation: " . specialchars($data['name']) . "</h1>\n\n";
echo "<table>\n";
echo '<tr><td>ID:</td><td>' . specialchars($data['affilid']) . "</td></tr>\n";
echo '<tr><td>Shortname:</td><td>' . specialchars($data['shortname']) . "</td></tr>\n";
echo '<tr><td>Name:</td><td>' . specialchars($data['name']) . "</td></tr>\n";
echo '<tr><td>Logo:</td><td>';
示例#10
0
        $nunchecked++;
        if ($results === NULL) {
            $nomatch[] = "string '<code>@EXPECTED_RESULTS@:</code>' not found in " . "<a href=\"submission.php?id=" . $sid . "\">s{$sid}</a>, leaving submission unchecked";
        } else {
            $earlier[] = "<a href=\"submission.php?id=" . $sid . "\">s{$sid}</a> already verified earlier";
        }
    }
}
echo "{$nchecked} submissions checked: " . count($unexpected) . " unexpected results, " . count($multiple) . ($verify_multiple ? " automatically verified (multiple outcomes), " : " to check manually, ") . count($verified) . " automatically verified<br/>\n";
echo "{$nunchecked} submissions not checked: " . count($earlier) . " verified earlier, " . count($nomatch) . " without magic string<br/>\n";
if (count($unexpected)) {
    flushresults("Unexpected results", $unexpected);
}
if (count($multiple)) {
    if ($verify_multiple) {
        flushresults("Automatically verified (multiple outcomes)", $multiple, TRUE);
    } else {
        flushresults("Check manually", $multiple);
        echo "<div class=\"details\" id=\"detail{$section}\">\n" . addForm($pagename) . "<p>Verify all multiple outcome submissions: " . addHidden('verify_multiple', '1') . addSubmit('verify') . addEndForm() . "</p>\n</div>\n\n";
    }
}
if (count($verified)) {
    flushresults("Automatically verified", $verified, TRUE);
}
if (count($earlier)) {
    flushresults("Verified earlier", $earlier, TRUE);
}
if (count($nomatch)) {
    flushresults("Without magic string", $nomatch, TRUE);
}
require LIBWWWDIR . '/footer.php';
示例#11
0
    $viewall = $_COOKIE['domjudge_balloonviewall'];
}
// Did someone press the view button?
if (isset($_REQUEST['viewall'])) {
    $viewall = $_REQUEST['viewall'];
}
dj_setcookie('domjudge_balloonviewall', $viewall);
$refresh = array('after' => 15, 'url' => 'balloons.php');
require LIBWWWDIR . '/header.php';
echo "<h1>Balloon Status</h1>\n\n";
foreach ($cdatas as $cdata) {
    if (isset($cdata['freezetime']) && difftime($cdata['freezetime'], now()) <= 0) {
        echo "<h4>Scoreboard of c{$cdata['cid']} ({$cdata['shortname']}) is now frozen.</h4>\n\n";
    }
}
echo addForm($pagename, 'get') . "<p>\n" . addHidden('viewall', $viewall ? 0 : 1) . addSubmit($viewall ? 'view unsent only' : 'view all') . "</p>\n" . addEndForm();
$contestids = $cids;
if ($cid !== null) {
    $contestids = array($cid);
}
// Problem metadata: colours and names.
if (empty($cids)) {
    $probs_data = array();
} else {
    $probs_data = $DB->q('KEYTABLE SELECT probid AS ARRAYKEY,name,color,cid
	                      FROM problem
	                      INNER JOIN contestproblem USING (probid)
	                      WHERE cid IN (%Ai)', $contestids);
}
$freezecond = array();
if (!dbconfig_get('show_balloons_postfreeze', 0)) {
示例#12
0
/**
 * Confirms event update
 * @return void
 * @access private
 */
function confirm_update()
{
    global $calself, $year, $month, $day, $hour, $minute, $calendardata, $color, $event_year, $event_month, $event_day, $event_hour, $event_minute, $event_length, $event_priority, $event_title, $event_text;
    $tmparray = $calendardata["{$month}{$day}{$year}"]["{$hour}{$minute}"];
    $tab = '    ';
    echo html_tag('table', html_tag('tr', html_tag('th', _("Do you really want to change this event from:") . "<br />\n", '', $color[4], 'colspan="2"') . "\n") . html_tag('tr', html_tag('td', _("Date:"), 'right', $color[4]) . "\n" . html_tag('td', date_intl(_("m/d/Y"), mktime(0, 0, 0, $month, $day, $year)), 'left', $color[4]) . "\n") . html_tag('tr', html_tag('td', _("Time:"), 'right', $color[4]) . "\n" . html_tag('td', date_intl(_("H:i"), mktime($hour, $minute, 0, $month, $day, $year)), 'left', $color[4]) . "\n") . html_tag('tr', html_tag('td', _("Priority:"), 'right', $color[4]) . "\n" . html_tag('td', $tmparray['priority'], 'left', $color[4]) . "\n") . html_tag('tr', html_tag('td', _("Title:"), 'right', $color[4]) . "\n" . html_tag('td', sm_encode_html_special_chars($tmparray['title']), 'left', $color[4]) . "\n") . html_tag('tr', html_tag('td', _("Message:"), 'right', $color[4]) . "\n" . html_tag('td', nl2br(sm_encode_html_special_chars($tmparray['message'])), 'left', $color[4]) . "\n") . html_tag('tr', html_tag('th', _("to:") . "<br />\n", '', $color[4], 'colspan="2"') . "\n") . html_tag('tr', html_tag('td', _("Date:"), 'right', $color[4]) . "\n" . html_tag('td', date_intl(_("m/d/Y"), mktime(0, 0, 0, $event_month, $event_day, $event_year)), 'left', $color[4]) . "\n") . html_tag('tr', html_tag('td', _("Time:"), 'right', $color[4]) . "\n" . html_tag('td', date_intl(_("H:i"), mktime($event_hour, $event_minute, 0, $event_month, $event_day, $event_year)), 'left', $color[4]) . "\n") . html_tag('tr', html_tag('td', _("Priority:"), 'right', $color[4]) . "\n" . html_tag('td', $event_priority, 'left', $color[4]) . "\n") . html_tag('tr', html_tag('td', _("Title:"), 'right', $color[4]) . "\n" . html_tag('td', sm_encode_html_special_chars($event_title), 'left', $color[4]) . "\n") . html_tag('tr', html_tag('td', _("Message:"), 'right', $color[4]) . "\n" . html_tag('td', nl2br(sm_encode_html_special_chars($event_text)), 'left', $color[4]) . "\n") . html_tag('tr', html_tag('td', "<form name=\"updateevent\" method=\"post\" action=\"{$calself}\">\n" . $tab . addHidden('year', $year) . $tab . addHidden('month', $month) . $tab . addHidden('day', $day) . $tab . addHidden('hour', $hour) . $tab . addHidden('minute', $minute) . $tab . addHidden('event_year', $event_year) . $tab . addHidden('event_month', $event_month) . $tab . addHidden('event_day', $event_day) . $tab . addHidden('event_hour', $event_hour) . $tab . addHidden('event_minute', $event_minute) . $tab . addHidden('event_priority', $event_priority) . $tab . addHidden('event_length', $event_length) . $tab . addHidden('event_title', $event_title) . $tab . addHidden('event_text', $event_text) . $tab . addHidden('updated', 'yes') . $tab . addHidden('confirmed', 'yes') . $tab . addSubmit(_("Yes")) . "</form>\n", 'right', $color[4]) . "\n" . html_tag('td', "<form name=\"nodelevent\" method=\"post\" action=\"day.php\">\n" . $tab . addHidden('year', $year) . $tab . addHidden('month', $month) . $tab . addHidden('day', $day) . $tab . addSubmit(_("No")) . "</form>\n", 'left', $color[4]) . "\n"), '', $color[0], 'border="0" cellpadding="2" cellspacing="1"');
}
示例#13
0
    $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 "<p>Show submissions:</p>\n" . addForm($pagename, 'get') . addHidden('id', $id);
for ($i = 0; $i < count($viewtypes); ++$i) {
    echo addSubmit($viewtypes[$i], 'view[' . $i . ']', null, $view != $i);
}
if (isset($_REQUEST['old_verdict'])) {
    echo addHidden('old_verdict', $_REQUEST['old_verdict']);
}
if (isset($_REQUEST['new_verdict'])) {
    echo addHidden('new_verdict', $_REQUEST['new_verdict']);
}
echo addEndForm() . "<br />\n";
echo addForm($pagename, 'get') . addHidden('id', $id) . addHidden("view[{$view}]", $viewtypes[$view]);
$verdicts = array_keys($verdicts);
array_unshift($verdicts, 'all');
echo "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') . addEndForm();
echo addForm($pagename, 'get') . addHidden('id', $id) . addHidden("view[{$view}]", $viewtypes[$view]) . addSubmit('clear') . addEndForm() . "<br /><br />\n";
putSubmissions($cdatas, $restrictions);
require LIBWWWDIR . '/footer.php';
示例#14
0
?>
<h1>Import and Export</h1>

<h2>Import / Export via file up/download</h2>

<ul>
<li><a href="impexp_contestyaml.php">Contest data (contest.yaml)</a></li>
<li><a href="problems.php">Problem archive</a></li>
<li>Tab separated, export:
	<a href="impexp_tsv.php?act=ex&amp;fmt=groups">groups.tsv</a>,
	<a href="impexp_tsv.php?act=ex&amp;fmt=teams">teams.tsv</a>,
	<a href="impexp_tsv.php?act=ex&amp;fmt=scoreboard">scoreboard.tsv</a>,
	<a href="impexp_tsv.php?act=ex&amp;fmt=results">results.tsv</a>
<li>
<?php 
echo addForm('impexp_tsv.php', 'post', null, 'multipart/form-data') . 'Tab separated, import: ' . '<label for="fmt">type:</label> ' . addSelect('fmt', array('groups', 'teams', 'accounts')) . ', <label for="tsv">file:</label>' . addFileField('tsv') . addHidden('act', 'im') . addSubmit('import') . addEndForm();
?>
</li>
</ul>

<h2>Import teams / Upload standings from / to icpc.baylor.edu</h2>

<p>
Create a "Web Services Token" with appropriate rights in the "Export" section
for your contest at <a
href="https://icpc.baylor.edu/login">https://icpc.baylor.edu/login</a>. You can
find the Contest ID (e.g. <code>Southwestern-Europe-2014</code>) in the URL.
</p>

<?php 
echo addForm("impexp_baylor.php");
示例#15
0
    ?>
 <label for="data_0__visible_0">no</label></td></tr>

</table>

<?php 
    echo addHidden('cmd', $cmd) . addHidden('table', 'team_category') . addHidden('referrer', @$_GET['referrer'] . ($cmd == 'edit' ? strstr(@$_GET['referrer'], '?') === FALSE ? '?edited=1' : '&edited=1' : '')) . addSubmit('Save') . addSubmit('Cancel', 'cancel', null, true, 'formnovalidate' . (isset($_GET['referrer']) ? ' formaction="' . specialchars($_GET['referrer']) . '"' : '')) . addEndForm();
    require LIBWWWDIR . '/footer.php';
    exit;
}
$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";
示例#16
0
/**
 * Provides list of writeable backends.
 * Works only when address is added ($name='addaddr')
 * @param string $name name of form
 * @return string html formated backend field (select or hidden)
 */
function list_writable_backends($name)
{
    global $color, $abook;
    if ($name != 'addaddr') {
        return;
    }
    $writeable_abook = 1;
    if ($abook->numbackends > 1) {
        $backends = $abook->get_backend_list();
        $writeable_abooks = array();
        while (list($undef, $v) = each($backends)) {
            if ($v->writeable) {
                // add each backend to array
                $writeable_abooks[$v->bnum] = $v->sname;
                // save backend number
                $writeable_abook = $v->bnum;
            }
        }
        if (count($writeable_abooks) > 1) {
            // we have more than one writeable backend
            $ret = addSelect('backend', $writeable_abooks, null, true);
            return html_tag('tr', html_tag('td', _("Add to:"), 'right', $color[4]) . html_tag('td', $ret, 'left', $color[4])) . "\n";
        }
    }
    // Only one backend exists or is writeable.
    return html_tag('tr', html_tag('td', addHidden('backend', $writeable_abook), 'center', $color[4], 'colspan="2"')) . "\n";
}
示例#17
0
} else {
    if (empty($curcids)) {
        $rows = array();
    } else {
        $rows = $DB->q('TABLE SELECT * FROM contest WHERE cid IN (%Ai)', $curcids);
    }
    echo "</legend>\n\n";
    foreach ($rows as $row) {
        $prevchecked = false;
        $hasstarted = difftime($row['starttime'], $now) <= 0;
        $hasended = difftime($row['endtime'], $now) <= 0;
        $hasfrozen = !empty($row['freezetime']) && difftime($row['freezetime'], $now) <= 0;
        $hasunfrozen = !empty($row['unfreezetime']) && difftime($row['unfreezetime'], $now) <= 0;
        $contestname = specialchars(sprintf('%s (%s - c%d)', $row['name'], $row['shortname'], $row['cid']));
        echo "<form action=\"contests.php\" method=\"post\">\n";
        echo addHidden('cid', $row['cid']);
        echo "<fieldset><legend>{$contestname}</legend>\n";
        echo "<table>\n";
        foreach ($times as $time) {
            $haspassed = difftime($row[$time . 'time'], $now) <= 0;
            echo "<tr><td>";
            // display checkmark when done or ellipsis when next up
            if (empty($row[$time . 'time'])) {
                // don't display anything before an empty row
            } elseif ($haspassed) {
                echo "<img src=\"../images/s_success.png\" alt=\"&#10003;\" class=\"picto\" />\n";
                $prevchecked = true;
            } elseif ($prevchecked) {
                echo "…";
                $prevchecked = false;
            }
/**
 * Displays the standard message list header.
 *
 * To finish the table, you need to do a "</table></table>";
 *
 * @param resource $imapConnection
 * @param array    $aMailbox associative array with mailbox related information
 * @param string   $msg_cnt_str
 * @param string   $paginator Paginator string
 */
function mail_message_listing_beginning($imapConnection, $aMailbox, $msg_cnt_str = '', $paginator = '&nbsp;')
{
    global $color, $show_flag_buttons, $PHP_SELF;
    global $lastTargetMailbox, $boxes;
    $php_self = $PHP_SELF;
    $urlMailbox = urlencode($aMailbox['NAME']);
    if (preg_match('/^(.+)\\?.+$/', $php_self, $regs)) {
        $source_url = $regs[1];
    } else {
        $source_url = $php_self;
    }
    if (!isset($msg)) {
        $msg = '';
    }
    $moveFields = addHidden('msg', $msg) . addHidden('mailbox', $aMailbox['NAME']) . addHidden('startMessage', $aMailbox['PAGEOFFSET']);
    /* build thread sorting links */
    $sort = $aMailbox['SORT'];
    if ($aMailbox['ALLOW_THREAD']) {
        if ($aMailbox['SORT'] & SQSORT_THREAD) {
            $sort -= SQSORT_THREAD;
            $thread_name = _("Unthread View");
        } else {
            $thread_name = _("Thread View");
            $sort = $aMailbox['SORT'] + SQSORT_THREAD;
        }
        $thread_link_str = '<small>[<a href="' . $source_url . '?srt=' . $sort . '&start_messages=1' . '&mailbox=' . urlencode($aMailbox['NAME']) . '">' . $thread_name . '</a>]</small>';
    } else {
        $thread_link_str = '';
    }
    /*
     * This is the beginning of the message list table.
     * It wraps around all messages
     */
    $safe_name = preg_replace("/[^0-9A-Za-z_]/", '_', $aMailbox['NAME']);
    $form_name = "FormMsgs" . $safe_name;
    echo '<form name="' . $form_name . '" method="post" action="' . $php_self . '">' . "\n" . $moveFields;
    $button_str = '';
    // display flag buttons only if supported
    if ($show_flag_buttons && in_array('\\flagged', $aMailbox['PERMANENTFLAGS'], true)) {
        $button_str .= getButton('submit', 'markUnflagged', _("Unflag"));
        $button_str .= getButton('submit', 'markFlagged', _("Flag"));
        $button_str .= "&nbsp;\n";
    }
    if (in_array('\\seen', $aMailbox['PERMANENTFLAGS'], true)) {
        $button_str .= getButton('submit', 'markUnread', _("Unread"));
        $button_str .= getButton('submit', 'markRead', _("Read"));
        $button_str .= "&nbsp;\n";
    }
    $button_str .= getButton('submit', 'attache', _("Forward")) . "&nbsp;\n";
    if (in_array('\\deleted', $aMailbox['PERMANENTFLAGS'], true)) {
        $button_str .= getButton('submit', 'delete', _("Delete"));
        $button_str .= '<input type="checkbox" name="bypass_trash" />' . _("Bypass Trash");
        $button_str .= "&nbsp;\n";
    }
    if (!$aMailbox['AUTO_EXPUNGE'] && $aMailbox['RIGHTS'] != 'READ-ONLY') {
        $button_str .= getButton('submit', 'expungeButton', _("Expunge")) . '&nbsp;' . _("mailbox") . "\n";
        $button_str .= '&nbsp;';
    }
    ?>
    <table width="100%" cellpadding="1"  cellspacing="0" style="border: 1px solid <?php 
    echo $color[0];
    ?>
">
        <tr>
        <td>
            <table bgcolor="<?php 
    echo $color[4];
    ?>
" border="0" width="100%" cellpadding="1"  cellspacing="0">
            <tr>
                <?php 
    echo html_tag('td', '<small>' . $paginator . $thread_link_str . '</small>', 'left') . "\n";
    ?>
                <?php 
    echo html_tag('td', '', 'center') . "\n";
    ?>
                <?php 
    echo html_tag('td', '<small>' . $msg_cnt_str . '</small>', 'right') . "\n";
    ?>
            </tr>
            </table>
        </td>
        </tr>
        <tr width="100%" cellpadding="1"  cellspacing="0" border="0" bgcolor="<?php 
    echo $color[0];
    ?>
">
        <td>
            <table border="0" width="100%" cellpadding="1"  cellspacing="0">
            <tr>
                <?php 
    echo html_tag('td', '', 'left') . "\n";
    ?>
                <small>
                    <?php 
    echo $button_str;
    ?>
                    <?php 
    do_hook('mailbox_display_buttons');
    ?>
                </small>
                </td>
                <?php 
    if (in_array('\\deleted', $aMailbox['PERMANENTFLAGS'], true)) {
        ?>
                <?php 
        echo html_tag('td', '', 'right');
        ?>
                    <small>&nbsp;<tt>
                        <select name="targetMailbox">
                            <?php 
        echo sqimap_mailbox_option_list($imapConnection, array(strtolower($lastTargetMailbox)), 0, $boxes);
        ?>
                        </select></tt>&nbsp;
                        <?php 
        echo getButton('submit', 'moveButton', _("Move"));
        ?>
                    </small>
                <?php 
    }
    ?>
                </td>
            </tr>
            </table>
        </td>
        </tr>
    </table>
<?php 
    do_hook('mailbox_form_before');
}
示例#19
0
        if ($reltime < dbconfig_get('judgehost_critical', 120)) {
            echo "Warning";
        } else {
            echo "Critical";
        }
    }
    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']);
}
示例#20
0
    plain_error_message(_("You have not selected a folder to rename. Please do so.") . '<br /><a href="../src/folders.php">' . _("Click here to go back") . '</a>.', $color);
    exit;
}
if (substr($old, strlen($old) - strlen($delimiter)) == $delimiter) {
    $isfolder = TRUE;
    $old = substr($old, 0, strlen($old) - 1);
} else {
    $isfolder = FALSE;
}
$old = imap_utf7_decode_local($old);
// displayable mailbox format is without folder prefix on front
global $folder_prefix;
if (substr($old, 0, strlen($folder_prefix)) == $folder_prefix) {
    $displayable_old = substr($old, strlen($folder_prefix));
} else {
    $displayable_old = $old;
}
if (strpos($displayable_old, $delimiter)) {
    $old_name = substr($displayable_old, strrpos($displayable_old, $delimiter) + 1);
    $parent = htmlspecialchars(substr($displayable_old, 0, strrpos($displayable_old, $delimiter)) . ' ' . $delimiter);
} else {
    $old_name = $displayable_old;
    $parent = '';
}
displayPageHeader($color, 'None');
echo '<br />' . html_tag('table', '', 'center', '', 'width="95%" border="0"') . html_tag('tr', html_tag('td', '<b>' . _("Rename a folder") . '</b>', 'center', $color[0])) . html_tag('tr') . html_tag('td', '', 'center', $color[4]) . addForm('folders_rename_do.php') . _("New name:") . '<br /><b>' . $parent . '</b>' . addInput('new_name', $old_name, 25) . '<br />' . "\n";
if ($isfolder) {
    echo addHidden('isfolder', 'true');
}
echo addHidden('orig', $old) . addHidden('old_name', $old_name) . '<input type="submit" value="' . _("Submit") . "\" />\n" . '</form><br /></td></tr></table>';
示例#21
0
    $data['memlimit'] = dbconfig_get('memory_limit');
}
if (!isset($data['outputlimit'])) {
    $defaultoutputlimit = TRUE;
    $data['outputlimit'] = dbconfig_get('output_limit');
}
if (!isset($data['special_run'])) {
    $defaultrun = TRUE;
    $data['special_run'] = dbconfig_get('default_run');
}
if (!isset($data['special_compare'])) {
    $defaultcompare = TRUE;
    $data['special_compare'] = dbconfig_get('default_compare');
}
echo "<h1>Problem " . specialchars($data['name']) . "</h1>\n\n";
echo addForm($pagename . '?id=' . urlencode($id), 'post', null, 'multipart/form-data') . "<p>\n" . addHidden('id', $id) . "</p>\n";
?>
<table>
<tr><td>ID:          </td><td>p<?php 
echo specialchars($data['probid']);
?>
</td></tr>
<tr><td>Name:        </td><td><?php 
echo specialchars($data['name']);
?>
</td></tr>
<tr><td>Testcases:   </td><td><?php 
if ($data['ntestcases'] == 0) {
    echo '<em>no testcases</em>';
} else {
    echo (int) $data['ntestcases'];
示例#22
0
     }
     echo "</table>\n";
 }
 // 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 {
示例#23
0
                $pre_defined_color = 1;
                break;
            }
        }
    }
    if (isset($theid) && !isset($message_highlight_list[$theid]['color'])) {
        $selected_choose = TRUE;
    } else {
        if ($pre_defined_color) {
            $selected_predefined = TRUE;
        } else {
            if ($selected_choose == '') {
                $selected_input = TRUE;
            }
        }
    }
    $oTemplate->assign('rule_name', $name);
    $oTemplate->assign('rule_value', $value);
    $oTemplate->assign('rule_field', $field);
    $oTemplate->assign('rule_color', $color);
    $oTemplate->assign('color_radio', $selected_choose ? 1 : ($selected_input ? 2 : 0));
    $oTemplate->assign('color_input', $selected_input ? $color : '');
    echo addForm('options_highlight.php', 'post', 'f', '', '', array(), TRUE) . addHidden('action', 'save');
    if ($action == 'edit') {
        echo addHidden('theid', isset($theid) ? $theid : '');
    }
    $oTemplate->display('options_highlight_addedit.tpl');
    echo "</form>\n";
}
do_hook('options_highlight_bottom', $null);
$oTemplate->display('footer.tpl');
示例#24
0
/**
 * Make a <form> start-tag.
 *
 * @param string  $sAction   form handler URL
 * @param string  $sMethod   http method used to submit form data. 'get' or 'post'
 * @param string  $sName     form name used for identification (used for backward 
 *                           compatibility). Use of id is recommended instead.
 * @param string  $sEnctype  content type that is used to submit data. html 4.01 
 *                           defaults to 'application/x-www-form-urlencoded'. Form 
 *                           with file field needs 'multipart/form-data' encoding type.
 * @param string  $sCharset  charset that is used for submitted data
 * @param array   $aAttribs  (since 1.5.1) extra attributes
 * @param boolean $bAddToken (since 1.5.2) When given as a string or as boolean TRUE,
 *                           a hidden input is also added to the form containing a
 *                           security token.  When given as TRUE, the input name is
 *                           "smtoken"; otherwise the name is the string that is
 *                           given for this parameter.  When FALSE, no hidden token
 *                           input field is added.  (OPTIONAL; default not used)
 *
 * @return string html formated form start string
 *
 */
function addForm($sAction, $sMethod = 'post', $sName = '', $sEnctype = '', $sCharset = '', $aAttribs = array(), $bAddToken = FALSE)
{
    global $oTemplate;
    //FIXME: all the values in the $aAttribs list as well as $charset used to go thru sm_encode_html_special_chars()... I would propose that most everything that is assigned to the template should go thru that *in the template class* on its way between here and the actual template file.  Otherwise we have to do something like:  foreach ($aAttribs as $key => $value) $aAttribs[$key] = sm_encode_html_special_chars($value); $sCharset = sm_encode_html_special_chars($sCharset);
    $oTemplate->assign('aAttribs', $aAttribs);
    $oTemplate->assign('name', $sName);
    $oTemplate->assign('method', $sMethod);
    $oTemplate->assign('action', $sAction);
    $oTemplate->assign('enctype', $sEnctype);
    $oTemplate->assign('charset', $sCharset);
    $sForm = $oTemplate->fetch('form.tpl');
    if ($bAddToken) {
        $sForm .= addHidden(is_string($bAddToken) ? $bAddToken : 'smtoken', sm_generate_security_token());
    }
    return $sForm;
}
示例#25
0
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>
示例#26
0
                     /* Display the "new address" form */
                     echo abook_create_form($form_url, 'editaddr', _("Update address"), _("Update address"), $current_backend, $olddata);
                     echo addHidden('oldnick', $olddata['nickname']) . addHidden('backend', $olddata['backend']) . addHidden('doedit', '1') . '</form>';
                 }
             }
         } elseif ($doedit == 1) {
             /* Stage two: Write new data */
             $newdata = $editaddr;
             $r = $abook->modify($oldnick, $newdata, $backend);
             /* Handle error messages */
             if (!$r) {
                 /* Display error */
                 plain_error_message(nl2br(sm_encode_html_special_chars($abook->error)));
                 /* Display the "new address" form again */
                 echo abook_create_form($form_url, 'editaddr', _("Update address"), _("Update address"), $current_backend, $newdata);
                 echo addHidden('oldnick', $oldnick) . addHidden('backend', $backend) . addHidden('doedit', '1') . "\n" . '</form>';
                 $abortform = true;
             }
         } else {
             /**
              * $editaddr is set, but $sel (address selection in address listing)
              * and $doedit (address edit form) are not set.
              * Assume that user clicked on "Edit address" without selecting any address.
              */
             $formerror = _("Please select address that you want to edit");
             $showaddrlist = true;
         }
         /* end of edit stage detection */
     }
     /* !empty($editaddr)                     - Update/modify address */
 }
示例#27
0
</tr>
</script>
<?php 
    echo "\n<table id=\"judgehosts\">\n" . "<tr><th>Hostname</th><th>Active</th><th>Restrictions</th></tr>\n";
    if ($cmd == 'add') {
        // Nothing, added by javascript in addAddRowButton
    } else {
        $res = $DB->q('SELECT * FROM judgehost ORDER BY hostname');
        $i = 0;
        while ($row = $res->next()) {
            echo "<tr><td>" . addHidden("keydata[{$i}][hostname]", $row['hostname']) . printhost($row['hostname']) . "</td><td>" . addSelect("data[{$i}][active]", array(1 => 'yes', 0 => 'no'), $row['active'], true) . "</td><td>" . addSelect("data[{$i}][restrictionid]", $restrictions, $row['restrictionid'], true) . "</td></tr>\n";
            ++$i;
        }
    }
    echo "</table>\n\n<br /><br />\n";
    echo addHidden('cmd', $cmd) . ($cmd == 'add' ? addHidden('skipwhenempty', 'hostname') : '') . addHidden('table', 'judgehost') . ($cmd == 'add' ? addAddRowButton('judgehost_template', 'judgehosts') : '') . addSubmit('Save Judgehosts') . addEndForm();
    require LIBWWWDIR . '/footer.php';
    exit;
}
$res = $DB->q('SELECT judgehost.*, judgehost_restriction.name
               FROM judgehost
               LEFT JOIN judgehost_restriction USING (restrictionid)
               ORDER BY hostname');
$now = now();
$query = 'KEYVALUETABLE SELECT judgehost,
          SUM(IF(endtime,endtime,%i) - GREATEST(%i,starttime))
          FROM judging
          WHERE endtime > %i OR (endtime IS NULL and valid = 1)
          GROUP BY judgehost';
$from = $now - 2 * 60;
$work2min = $DB->q($query, $now, $from, $from);
    }
    echo '</table>' . "\n";
}
if (count($index_order) != count($available)) {
    $opts = array();
    for ($i = 1; $i <= count($available); $i++) {
        $found = false;
        for ($j = 1; $j <= count($index_order); $j++) {
            if ($index_order[$j] == $i) {
                $found = true;
            }
        }
        if (!$found) {
            $opts[$i] = $available[$i];
        }
    }
    echo addForm('options_order.php', 'post', 'f');
    echo addSelect('add', $opts, '', TRUE);
    echo addHidden('method', 'add');
    echo addSubmit(_("Add"), 'submit');
    echo '</form>';
}
echo html_tag('p', '<a href="../src/options.php">' . _("Return to options page") . '</a></p><br />');
?>
    </td></tr>
    </table>

</td></tr>
</table>
</body></html>
示例#29
0
sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
sqgetGlobalVar('mailbox', $mailbox, SQ_POST);
/* end globals */
if ($mailbox == '') {
    displayPageHeader($color, 'None');
    plain_error_message(_("You have not selected a folder to delete. Please do so.") . '<br /><a href="../src/folders.php">' . _("Click here to go back") . '</a>.', $color);
    exit;
}
if (sqgetGlobalVar('backingout', $tmp, SQ_POST)) {
    $location = get_location();
    header("Location: {$location}/folders.php");
    exit;
}
if (!sqgetGlobalVar('confirmed', $tmp, SQ_POST)) {
    displayPageHeader($color, 'None');
    echo '<br />' . html_tag('table', '', 'center', '', 'width="95%" border="0"') . html_tag('tr', html_tag('td', '<b>' . _("Delete Folder") . '</b>', 'center', $color[0])) . html_tag('tr') . html_tag('td', '', 'center', $color[4]) . sprintf(_("Are you sure you want to delete %s?"), str_replace(array(' ', '<', '>'), array('&nbsp;', '&lt;', '&gt;'), imap_utf7_decode_local($mailbox))) . addForm('folders_delete.php', 'post') . "<p>\n" . addHidden('mailbox', $mailbox) . addSubmit(_("Yes"), 'confirmed') . addSubmit(_("No"), 'backingout') . '</p></form><br /></td></tr></table>';
    exit;
}
$imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list($imap_stream);
$numboxes = count($boxes);
global $delete_folder;
if (substr($mailbox, -1) == $delimiter) {
    $mailbox_no_dm = substr($mailbox, 0, strlen($mailbox) - 1);
} else {
    $mailbox_no_dm = $mailbox;
}
/** lets see if we CAN move folders to the trash.. otherwise,
 ** just delete them **/
if (isset($delete_folder) && $delete_folder || eregi('^' . $trash_folder . '.+', $mailbox)) {
    $can_move_to_trash = FALSE;
示例#30
0
文件: team.php 项目: sponi78/domjudge
    ?>

<tr><td>Enabled:</td>
<td><?php 
    echo addRadioButton('data[0][enabled]', !isset($row['']) || $row['enabled'], 1);
    ?>
 <label for="data_0__enabled_1">yes</label>
<?php 
    echo addRadioButton('data[0][enabled]', isset($row['enabled']) && !$row['enabled'], 0);
    ?>
 <label for="data_0__enabled_0">no</label></td></tr>
</table>

<?php 
    echo addHidden('data[0][mapping][0][fk][0]', 'teamid') . addHidden('data[0][mapping][0][fk][1]', 'cid') . addHidden('data[0][mapping][0][table]', 'contestteam');
    echo addHidden('cmd', $cmd) . addHidden('table', 'team') . addHidden('referrer', @$_GET['referrer'] . ($cmd == 'edit' ? strstr(@$_GET['referrer'], '?') === FALSE ? '?edited=1' : '&edited=1' : '')) . addSubmit('Save') . addSubmit('Cancel', 'cancel', null, true, 'formnovalidate') . addEndForm();
    require LIBWWWDIR . '/footer.php';
    exit;
}
/* optional restriction of submissions list to specific problem, language, etc. */
$restrictions = array();
if (isset($_GET['restrict'])) {
    list($key, $value) = explode(":", $_GET['restrict'], 2);
    $restrictions[$key] = $value;
}
$row = $DB->q('MAYBETUPLE SELECT t.*, a.country, c.name AS catname,
                                 a.shortname AS affshortname, a.name AS affname
               FROM team t
               LEFT JOIN team_category c USING (categoryid)
               LEFT JOIN team_affiliation a ON (t.affilid = a.affilid)
               WHERE teamid = %i', $id);