Ejemplo n.º 1
0
				});
			});
		</script>
	</td>
</tr>
<?php 
    }
    ?>

<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;
Ejemplo n.º 2
0
    dbconfig_store();
    // Redirect to the original page to prevent accidental redo's
    header('Location: config.php');
    return;
}
$title = "Configuration";
require LIBWWWDIR . '/header.php';
// Check admin rights after header to generate valid HTML page
requireAdmin();
echo "<h1>Configuration settings</h1>\n\n";
echo addForm($pagename) . "<table>\n<thead>\n" . "<tr class=\"thleft\"><th>Option</th><th>Value(s)</th><th>Description</th></tr>\n" . "</thead>\n<tbody>\n";
$extra = ' class="config_input"';
foreach ($LIBDBCONFIG as $key => $data) {
    switch (@$data['type']) {
        case 'bool':
            $editfield = addRadioButton('config_' . $key, (bool) $data['value'] == true, 1) . "<label for=\"config_{$key}1\">yes</label>" . addRadioButton('config_' . $key, (bool) $data['value'] == false, 0) . "<label for=\"config_{$key}0\">no</label>";
            break;
        case 'int':
            $editfield = addInputField('number', 'config_' . $key, $data['value'], $extra);
            break;
        case 'string':
            $editfield = addInput('config_' . $key, $data['value'], 0, 0, $extra);
            break;
        case 'array_val':
        case 'array_keyval':
            $editfield = '';
            $i = 0;
            foreach ($data['value'] as $k => $v) {
                if ($data['type'] == 'array_keyval') {
                    $editfield .= addInput("config_{$key}[{$i}][key]", $k, 0, 0, $extra);
                    $editfield .= addInput("config_{$key}[{$i}][val]", $v, 0, 0, $extra);
Ejemplo n.º 3
0
<tr><td><label for="data_0__color_">Colour:</label></td>
<td><?php 
    echo addInput('data[0][color]', @$row['color'], 15, 25, 'class="color {required:false,adjust:false,hash:true,caps:false}"');
    ?>
<a target="_blank"
href="http://www.w3schools.com/cssref/css_colornames.asp"><img
src="../images/b_help.png" class="smallpicto" alt="?" /></a></td></tr>

<tr><td>Visible:</td>
<td><?php 
    echo addRadioButton('data[0][visible]', !isset($row['visible']) || $row['visible'], 1);
    ?>
 <label for="data_0__visible_1">yes</label>
<?php 
    echo addRadioButton('data[0][visible]', isset($row['visible']) && !$row['visible'], 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'])) {
Ejemplo n.º 4
0
			noResultsText: '<?php 
        echo $type_settings['noResultsText'];
        ?>
',
			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) {
Ejemplo n.º 5
0
		<?php 
    echo addRadioButton("data[0][mapping][0][extra][{id}][allow_submit]", true, 1);
    ?>
		<label for='data_0__mapping__0__extra__{id}__allow_submit_1'>yes</label>
		<?php 
    echo addRadioButton("data[0][mapping][0][extra][{id}][allow_submit]", false, 0);
    ?>
		<label for='data_0__mapping__0__extra__{id}__allow_submit_0'>no</label>
	</td>
	<td>
		<?php 
    echo addRadioButton("data[0][mapping][0][extra][{id}][allow_judge]", true, 1);
    ?>
		<label for='data_0__mapping__0__extra__{id}__allow_judge_1'>yes</label>
		<?php 
    echo addRadioButton("data[0][mapping][0][extra][{id}][allow_judge]", false, 0);
    ?>
		<label for='data_0__mapping__0__extra__{id}__allow_judge_0'>no</label>
	</td>
	<td>
		<?php 
    echo addInput("data[0][mapping][0][extra][{id}][color]", '{color}', 15, 25, 'class="color {required:false,adjust:false,hash:true,caps:false}"');
    ?>
	</td>
	<td>
		<?php 
    echo addInputField('number', "data[0][mapping][0][extra][{id}][lazy_eval_results]", '{lazy_eval_results}', ' min="0" max="1"');
    ?>
	</td>
</tr>
</script>
Ejemplo n.º 6
0
<td><?php 
    echo addRadioButton('data[0][allow_submit]', !isset($row['allow_submit']) || $row['allow_submit'], 1);
    ?>
 <label for="data_0__allow_submit_1">yes</label>
<?php 
    echo addRadioButton('data[0][allow_submit]', isset($row['allow_submit']) && !$row['allow_submit'], 0);
    ?>
 <label for="data_0__allow_submit_0">no</label></td></tr>

<tr><td>Allow judge:</td>
<td><?php 
    echo addRadioButton('data[0][allow_judge]', !isset($row['allow_judge']) || $row['allow_judge'], 1);
    ?>
 <label for="data_0__allow_judge_1">yes</label>
<?php 
    echo addRadioButton('data[0][allow_judge]', isset($row['allow_judge']) && !$row['allow_judge'], 0);
    ?>
 <label for="data_0__allow_judge_0">no</label></td></tr>

<tr><td><label for="data_0__time_factor_">Time factor:</label></td>
<td><?php 
    echo addInputField('number', 'data[0][time_factor]', isset($row['time_factor']) ? $row['time_factor'] : 1, ' min="0" step="any" required');
    ?>
 &times;</td></tr>
<tr><td><label for="data_0__compile_script_">Compile script:</label></td>
<td>
<?php 
    $execmap = $DB->q("KEYVALUETABLE SELECT execid,description FROM executable\n\t\t\tWHERE type = 'compile'\n\t\t\tORDER BY execid");
    $execmap[''] = 'none';
    echo addSelect('data[0][compile_script]', $execmap, @$row['compile_script'], True);
    ?>