<?php

require "../functions/main_fns.php";
require "../functions/mrm_fns.php";
open_db();
if ($_SESSION["logged_in"]) {
    $current_match = now_match();
    admin_scoreboard($current_match);
} else {
    header('Location: ../madness.php');
}
Example #2
0
function view_matches($round)
{
    $query = get_query($round);
    $result = mysql_query($query);
    if (!$result) {
        echo "error: " . $query;
        die('Invalid');
    }
    for ($i = 1; $i <= mysql_num_rows($result); $i++) {
        $match = mysql_fetch_assoc($result);
        $live_match = now_match() == $match ? "id=\"live_match\"" : '';
        echo "<table class=\"bottom-spacer_20 table-center\"" . $live_match . ">\n\n      <tr>\n<td class='mrm_band" . winner($match['band1_id'], $match["id"]) . "'>" . get_band_name($match['band1_id']) . "</td>\n<td></td>\n<td class='mrm_band" . winner($match['band2_id'], $match["id"]) . "'>" . get_band_name($match['band2_id']) . "</td>\n</tr>\n" . "<tr>\n<td class='" . winner($match['band1_id'], $match["id"]) . "'><img src=\"" . get_band_pic_url($match['band1_id']) . "\" width=\"200px\"></td>\n<td " . timer_or_vs($match) . " class='middle'> VS </td>\n<td class='" . winner($match['band2_id'], $match["id"]) . "'>" . "<img src=\"" . get_band_pic_url($match['band2_id']) . "\" width=\"200px\"></td>\n</tr>\n";
        echo "<tr class=\"scoreboard\">";
        admin_scoreboard($match);
        echo "</tr>";
        voting_status_message_for($match);
        voting_buttons($match, $round);
        show_close_match($match, $round);
        echo "<tr>\n<td class=\"text-right\">Start Time:</td><td colspan=\"2\">" . date('F d @ g:i a', strtotime($match['start_time'])) . "</td></tr>";
        echo "<tr>\n<td class=\"text-right\">End Time:</td><td colspan=\"2\">" . date('F d @ g:i a', strtotime($match['end_time'])) . "</td></tr>";
        echo "</table>\n";
        echo "<table class=\"bottom-spacer_20 table-center\"" . $live_match . ">\n\n          <tr><td><strong>Match sponsored by: " . $match['sponsor'] . "</strong></td></tr>\n\n          <tr><td>" . $match['sponsor_msg'] . "</td></tr>\n\n          <tr><td><a href='/mrm_manage_sponsor.php?match=" . $match['id'] . "'>Edit</a></td></tr>";
        echo "</table>\n";
    }
}