예제 #1
0
<?php 
require_once 'lib/db.php';
require_once 'lib/competition.php';
require_once 'lib/team.php';
require_once 'lib/game.php';
include 'authenticate.php';
include 'title.php';
$con = DB::connect();
$matchid = $_GET["match"];
$teamnumber = $_GET["team"];
$match = match::select($con, $matchid);
$game = game::select($con, $matchid, $teamnumber);
if ($game == null) {
    $game = new game();
}
// useful for setting checkboxes...
function check($val)
{
    if ($val) {
        echo "checked";
    }
}
$red = $match->RedAlliance;
$blue = $match->BlueAlliance;
$color = 'red';
// figure out if we're scoring a blue or red team, to adjust the color
if ($teamnumber == $blue->TeamOne || $teamnumber == $blue->TeamTwo || $teamnumber == $blue->TeamThree) {
    $color = 'blue';
}
// so we can scout the team in the same position in the next match.
if ($teamnumber == $blue->TeamOne || $teamnumber == $red->TeamOne) {
예제 #2
0
if ($match == null) {
    die("match not found.");
}
if ($team == null) {
    die("team not found.");
}
// reportMatch($match);
printf("match = %s, team = %s\n", $match->ID, $match->Number);
/*
$game = new game();
$game->MatchID = $match->ID;
$game->MatchNumber = $match->Number;
$game->TeamNumber = $team->Number;
$game->Autonomous = 9;
$game->Teleop = 42;
$game->Climbing = 20;
$game->ColoredFrisbees = 1;
$game->Offensive = true;
$game->Disqualified = false;
$game->TippedOver = false;
$game->MechanicalFailure = false;
$game->LostCommunication = true;
$game->DidNotMove = false;
$game->Comment = "A really good robot with a long comment.";

$game->insert($con);
*/
$game = game::select($con, $match->ID, $team->Number);
reportGames(array($game));
// $games = $match->selectGames($con);
// reportGames($games);