Esempio n. 1
0
    while ($competition = $competitionResult->fetch_assoc()) {
        array_push($competitions, $competition);
    }
    $response["Error"] = false;
    $response["Competitions"] = $competitions;
    echoRespnse(200, $response);
});
/**
 * Gets the practice soccer matches of a team for a particular season
 * method GET
 */
$app->get('/teams/:teamID/seasons/:seasonID/practice-matches', function ($teamID, $seasonID) use($app) {
    $req = $app->request();
    $response = array();
    $db = new DbHandler();
    $soccerMatchesResult = $db->getTeamPracticeMatchesBySeason($teamID, $seasonID);
    $soccerMatches = array();
    while ($soccerMatch = $soccerMatchesResult->fetch_assoc()) {
        array_push($soccerMatches, $soccerMatch);
    }
    $response["Error"] = false;
    $response["SoccerMatches"] = $soccerMatches;
    echoRespnse(200, $response);
});
/**
 * Creates a new team player
 * method POST
 * url /teams/:teamID/players
 */
$app->post('/teams/:teamID/players', function ($teamID) use($app) {
    $response = array();