コード例 #1
0
ファイル: mrm_fns.php プロジェクト: ynotradio/site
function show_match($match_id)
{
    if ($match_id != 8888) {
        $match_status = get_match_status($match_id);
        $query = "SELECT * FROM mrm_matches WHERE id =" . $match_id;
        $result = mysql_query($query);
        if (!$result) {
            echo $update . "<br>";
            die('Error Querying Database. Code: sm123');
        }
        $match = mysql_fetch_assoc($result);
        echo '<table id="mrm_current_match" border="0">
      <tr>
        <td> ' . get_band_name($match['band1_id']) . '</td>
        <td></td>
        <td> ' . get_band_name($match['band2_id']) . '</td>
      </tr>
      <tr>
        <td> <img src="' . get_band_pic_url($match['band1_id']) . '"></td>
        <td class="middle" id="mrm_timer">';
        if ($match_status == 'over') {
            echo 'Match Over';
        }
        echo '</td>
      <td> <img src="' . get_band_pic_url($match['band2_id']) . '"></td></tr>
      <tr>';
        echo "<td class=\"hidden\">";
        countdown_values($match_id);
        echo "</td>";
        echo "</tr>\n<tr>";
        if ($match_status == 'early') {
            echo '<td colspan=3 class="center">Voting has not started yet</td>';
        } elseif ($match_status == 'running') {
            if (has_voted($match_id) == false) {
                echo '<td class="center">';
                vote_form($match["id"], 1);
                echo "</td>\n\n          <td></td>\n\n          <td class='center'>";
                vote_form($match["id"], 2);
                echo '</td>';
            } else {
                echo '<td colspan=3 class="center">Thanks for Voting!</td>';
            }
        } elseif ($match_status == 'over') {
            echo '<td colspan=3></td>';
        }
        echo "\n</tr>\n</table>\n";
        if ($match_status != "early") {
            echo '<table id="mrm_scoring" border="0">';
            scoreboard($match);
            echo '</table>';
        }
    }
    if (end_of_madness()) {
        winner_banner();
    } elseif (waiting_for_final()) {
        echo "<div class=\"top-spacer_20 center\"><strong>Hang in there, we are still counting up all of the votes...</strong></div>";
    } else {
        next_match();
    }
}
コード例 #2
0
/**
 * Created by PhpStorm.
 * User: Sal
 * Date: 5/7/2015
 * Time: 8:23 AM
 */
if (!isset($_REQUEST['cmd'])) {
    echo '{"result": 0, "message": "unknown command"}';
    exit;
}
//store command here
$cmd = $_REQUEST['cmd'];
switch ($cmd) {
    case 1:
        next_match();
        break;
    case 2:
        add_manager();
        break;
    case 3:
        get_players_byDivision();
        break;
    case 4:
        get_slide_picture();
        break;
    case 5:
        get_latest_news();
        break;
    case 6:
        get_latest_video();