Exemplo n.º 1
0
require_once 'lib/db.php';
require_once 'lib/team.php';
require_once 'lib/robot.php';
require_once 'lib/competition.php';
$con = DB::connect();
$number = $_GET["number"];
$team = team::selectTeam($con, $number);
session_start();
$compid = $_SESSION["competitionid"];
$comp = competition::select($con, $compid);
$robot = robot::select($con, $number);
if ($robot == null) {
    // make a new robot if necessary
    $robot = new robot();
    $robot->TeamNumber = $number;
    $robot->insert($con);
}
function makeSelector($enum, $value)
{
    print "<select>\n";
    foreach ($enum as $val => $name) {
        print "<option value='{$val}'>{$name}</option>\n";
    }
    print "</select>\n";
}
function makeRoleSelector($value)
{
    makeSelector(array('offensive' => 'Offensive', 'defensive' => 'Defensive', 'climber' => 'Climber'), $value);
}
function makeLocationSelector($value)
{