'; echo ''; echo ''; echo 'GameDate'; echo 'League'; echo 'Home Team'; echo 'Away Team'; echo 'Odds 1'; echo 'Odds X'; echo 'Odds 2'; echo 'Bet On'; echo 'Bet Amount'; echo 'Submit'; echo ''; echo ''; echo ''; foreach ($matches as $match) { $this->createMatchRow($match, $betLevel, $bankValue); } echo ''; echo ''; } function createMatchRow( SoccerMatch $match, float $betLevel, float $bankValue ) { $analysisValue = $this->getAnalysisValue($match); if ($analysisValue != 'No bet') { echo ''; echo '' . $match->getGameDate() . ''; echo '' . $match->getHomeTeam()->getTeamLeague() . ''; echo '' . $match->getHomeTeam()->getTeamName() . ''; echo '' . $match->getAwayTeam()->getTeamName() . ''; echo '
' . $match->getOdds1() . '
'; echo '
' . $match->getOddsX() . '
'; echo '
' . $match->getOdds2() . '
'; echo '' . $analysisValue; echo '' . ($bankValue * $betLevel) / 100 . ''; echo ''; echo ''; } } private function getAnalysisValue(SoccerMatch $match) { $database = new Database(); $result = 'No bet'; $analysis = new SoccerMatchAnalysis($match); $leagueInfo = $database->getLeagueInfo( $match->getHomeTeam()->getTeamLeagueId() ); if ($leagueInfo != null) { $homeWinsCount = $analysis->winLossRatio( $leagueInfo->getWinLossRatio(), true ); $awayWinsCount = $analysis->winLossRatio( $leagueInfo->getWinLossRatio(), false ); $homeWinLossRatioCount = $analysis->winLossRatioHomeAndAway( true, $leagueInfo->getWinLossRatioHomeAndAway() ); $awayWinLossRatioCount = $analysis->winLossRatioHomeAndAway( false, $leagueInfo->getWinLossRatioHomeAndAway() ); $homeScoringTotal = $analysis->scoringTotal( $leagueInfo->getScoringTotal(), true ); $awayScoringTotal = $analysis->scoringTotal( $leagueInfo->getScoringTotal(), false ); $scoringDiffLastGames = $analysis->getScoringDiffLastGames( $leagueInfo->getScoringDiffLastGame() ); $winsCountDiff = $homeWinsCount - $awayWinsCount; $winLossRatioDiff = $homeWinLossRatioCount - $awayWinLossRatioCount; $scoringTotalDiff = $homeScoringTotal - $awayScoringTotal; if ( $scoringDiffLastGames < 0 && $winsCountDiff < 0 && $winLossRatioDiff < 0 && $scoringTotalDiff < 0 ) { $result = ($scoringDiffLastGames + $winsCountDiff + $winLossRatioDiff + $scoringTotalDiff) / 4; } elseif ( $scoringDiffLastGames > 0 && $winsCountDiff > 0 && $winLossRatioDiff > 0 && $scoringTotalDiff > 0 ) { $result = ($scoringDiffLastGames + $winsCountDiff + $winLossRatioDiff + $scoringTotalDiff) / 4; } } return $result; } public function createOutstandingBetsTable() { $database = new Database(); $bets = $database->getOutstandingBets(); if ($bets == null) { return; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; foreach ($bets as $bet) { $this->createOutstandingBetsRow($bet); } echo ''; echo '
Game dateLeagueTeamsBet OnBet AmountOddsStatus
'; } private function createOutstandingBetsRow(Bet $bet) { echo ''; echo '' . $bet->getGameDate() . ''; echo '' . $bet->getLeagueName() . ''; echo '' . $bet->getTeams() . ''; echo '' . $bet->getBetOn() . ''; echo '' . $bet->getBetAmount() . ''; echo '' . $bet->getOdds() . ''; echo '' . $bet->getStatus() . ''; echo ''; } }