public function getPlayers($teamId) { $soccerData = new SoccerData(); return $soccerData->getPlayers(); }
$players[$i]['ID'] = rand(1000, 1200); } for ($i = 100; $i < 120; $i++) { $availableTeams[] = new Team(generateRandomString(8), 'TestLogo', rand(100, 120)); } foreach ($players as $teamID => $teamMember) { $playersList[] = new Player($teamMember['firstName'], $teamMember['LastNameName'], 'test', $teamMember['TeamID'], $teamMember['ID']); } // echo '<pre>'; // print_r(var_dump($availableTeams)); // echo'</pre>'; //if ($_SERVER['REQUEST_METHOD'] == 'GET') try { if (!isset($_REQUEST['id'])) { if (class_exists('SoccerData') && method_exists('SoccerData', 'getListTeams')) { $soccerData = new SoccerData(); $availableTeams = $soccerData->getListTeams(); } include_once getcwd() . '/views/ViewTeams.php'; } else { if (class_exists('SoccerData') && method_exists('SoccerData', 'getPlayers')) { $soccerData = new SoccerData(); $playersList = $soccerData->getPlayers(); include_once getcwd() . '/views/ViewPlayers.php'; } include_once getcwd() . '/views/ViewPlayers.php'; } } catch (Exception $e) { $message = $e->getMessage(); include_once getcwd() . '/views/ErrorMessage.php'; }