Пример #1
0
    // Disallow problems that are not submittable or
    // before contest start.
    if (!problemVisible($probid)) {
        $probid = NULL;
    }
    $newid = $DB->q('RETURNID INSERT INTO clarification
	                 (cid, submittime, sender, probid, category, body)
	                 VALUES (%i, %s, %i, %i, %s, %s)', $cid, now(), $teamid, $probid, $category, $_POST['bodytext']);
    auditlog('clarification', $newid, 'added', null, null, $cid);
    // redirect back to the original location
    header('Location: ./');
    exit;
}
$title = 'Clarifications';
require LIBWWWDIR . '/header.php';
if (isset($id)) {
    // display clarification thread
    if ($myrequest) {
        echo "<h1>Clarification Request</h1>\n\n";
    } else {
        echo "<h1>Clarification</h1>\n\n";
    }
    putClarification($respid, $teamid);
    echo "<h2>Send Clarification Request</h2>\n\n";
    putClarificationForm("clarification.php", $id, $cid);
} else {
    // display a clarification request send box
    echo "<h1>Send Clarification Request</h1>\n\n";
    putClarificationForm("clarification.php", null, $cid);
}
require LIBWWWDIR . '/footer.php';
Пример #2
0
        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'
    // 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);
}