Exemplo n.º 1
0
$sql_filter = '';
if (array_key_exists('service', $_GET)) {
    $serv_descr = param('service');
    if ($serv_descr != 'all') {
        $sql_filter = 'WHERE fi_service = ' . $serv_descr;
    }
}
$sql = 'SELECT id, score, submittime, publishtime, fi_service, fi_team, judge, judgecomment FROM advisory ' . $sql_filter . ' ORDER BY submittime DESC;';
$result = query($sql);
$review = '';
if (is_admin()) {
    $review = '<td>Review</td>';
}
myhead('Advisories');
echo "<p><a href='.'>Back</a> to main screen.</p>";
if (game_has_started()) {
    echo "\n<p><a href='advisory_submit.php'>Submit</a> a new advisory.</p>\n<form method='get'/>\n<p>Service <select name='service'><option value='all'>(View all)";
    echo dict2options($services);
    echo "</select><input type='submit' value='Filter By Service' /></p>\n\n\n<table border=1 width='100%'>\n<tr><td>Service</td><td>Team</td><td>Time</td><td>points</td><td width=20%>Comment</td><td>Display</td>{$review}</tr>";
    while ($row = mysql_fetch_array($result)) {
        if (!is_numeric($row['score'])) {
            $color = '#ffcccc';
            $row['score'] = '?';
        } else {
            $color = 'white';
        }
        $time = date("H:i d.m.Y", $row["submittime"]);
        if (!$row['fi_service']) {
            $row['fi_service'] = 0;
        }
        echo "<tr>\n      <td bgcolor='{$color}'>" . $services[$row['fi_service']] . "</td>\n      <td bgcolor='{$color}'>" . $teams[$row['fi_team']] . "</td>\n      <td bgcolor='{$color}'>" . $time . "</td>\n      <td bgcolor='{$color}' align=right>" . $row['score'] . "</td>";
Exemplo n.º 2
0
<?php

require_once 'db_inc.php';
connect();
require_once 'layout.inc.php';
myhead('Cross Flags', 60);
$fresh_minutes = floor($displayfreshscores / 60);
echo "<p><a href='/'>Back to the main page.</a></p>\n\n      <p><font color=red>Red</font> numbers denote flags collected in the last {$fresh_minutes} minutes.</p>";
if (!($debug || game_has_started())) {
    echo "<center><p>The game has not started, please come back later.</p></center>";
} else {
    $fresh_now = time() - $displayfreshscores;
    $sum_total = 0;
    $teams = get_teams();
    $team_ids = array_keys($teams);
    sort($team_ids);
    foreach ($team_ids as $id) {
        $sum_taken[$id] = 0;
        $sum_given[$id] = 0;
        foreach ($team_ids as $id2) {
            $fresh[$id][$id2] = 0;
            $old[$id][$id2] = 0;
        }
    }
    $query = query('SELECT scores.fi_team as winner,`flag`.fi_team as looser,count(*) as nr,unix_timestamp(time) as time ' . 'FROM scores,`flag` ' . "WHERE (scores.fi_game={$GAMEID})AND(`flag`.fi_game={$GAMEID})AND(scores.fi_flag=`flag`.id)" . "   AND(multiplier>0) GROUP BY winner,looser,(unix_timestamp(time)>={$fresh_now})");
    while ($row = mysql_fetch_array($query)) {
        if ($row['time'] >= $fresh_now) {
            $fresh[$row['winner']][$row['looser']] += $row['nr'];
        } else {
            $old[$row['winner']][$row['looser']] += $row['nr'];
        }
Exemplo n.º 3
0
<?php

// --------------------------------- clone of service_status.php
require_once 'db_inc.php';
connect();
require_once 'layout.inc.php';
require_once 'misc.inc.php';
require_once 'status_codes.inc.php';
myhead('Verbose Status of Services', 60);
echo '<p><a href="index.php">back to index</a></p>';
$me = $_SERVER['PHP_SELF'];
if (!game_has_started()) {
    die("game has not started, yet");
}
$term = '';
if (isset($_REQUEST['term'])) {
    $term = $_REQUEST['term'];
}
if (!($term == '' || $term == 'team' || $term == 'service')) {
    die("term '{$term}' not in whitelist");
}
$id = get_int('id');
//************************************************** SELECT
echo "<table border=1>\n\t<tr><th colspan=2>Select filter</th></tr>";
$rows = query("SELECT id,name FROM service,game_x_service\n               WHERE (service.id=game_x_service.fi_service)AND(game_x_service.fi_game={$GAMEID})\n               ORDER BY service.id");
echo '<tr><th>Services</th><td> <form method=get>
		<input type=hidden name=term value=service>
		<select name=id>';
while ($row = mysql_fetch_array($rows)) {
    $service[$row['id']] = $row['name'];
    $sel = '';