Axel Nordh hace 4 años
padre
commit
8e9bf23d3d
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  1. 4 3
      OddsJavaFx/src/web/matchTable.php

+ 4 - 3
OddsJavaFx/src/web/matchTable.php

@@ -7,6 +7,7 @@ $countryId = $_POST['countrySelector'];
 $leagueId = $_POST['leagueSelector'];
 
 $matches = $conn->getMatches($countryId, $leagueId);
+$leagueInfo = $conn->getLeagueInfo($leagueId);
 
 ?>
 <head>
@@ -41,9 +42,9 @@ $matches = $conn->getMatches($countryId, $leagueId);
         echo "<td>".$match['gameDate'] . "</td>";
         echo "<td>".$match['homeTeamName'] . "</td>";
         echo "<td>".$match['awayTeamName'] . "</td>";
-        echo "<td>". round(100 / $match['homeWinPercent'], 2) . "</td>";
-        echo "<td>". round(100 / $match['drawPercent'], 2) . "</td>";
-        echo "<td>". round(100 / $match['awayWinPercent'], 2) . "</td>";
+        echo "<td>". round((100 / $match['homeWinPercent']) * $leagueInfo['betMargin'], 2) . "</td>";
+        echo "<td>". round((100 / $match['drawPercent']) * $leagueInfo['betMargin'], 2) . "</td>";
+        echo "<td>". round((100 / $match['awayWinPercent']) * $leagueInfo['betMargin'], 2) . "</td>";
         echo "<td><input id='betHome' name='betHomeName' type='checkbox'/></td>";
         echo "<td><input id='betOdds' name='betOddsName' type='number' step='.01'/></td>";
         echo "<td><input id='betAmount' name='betAmountName' type='number' step='.01'/></td>";