Example #1
0
/**
 * Return a link to delete a specific data element from a given table.
 * Takes the table, the key field to match on and the value.
 * Optionally specify an extra description of the item to be deleted.
 */
function delLink($table, $field, $value, $desc = NULL)
{
    return delLinkMultiple($table, array($field), array($value), '', $desc);
}
Example #2
0
/**
 * Return a link to delete a specific data element from a given table.
 * Takes the table, the key field to match on and the value.
 */
function delLink($table, $field, $value)
{
    return delLinkMultiple($table, array($field), array($value));
}
Example #3
0
    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';