Axel Nordh пре 4 година
родитељ
комит
8c91b10314

+ 1 - 17
OddsJavaFx/src/web/index.php

@@ -41,23 +41,7 @@ $leagues = $conn->getLeagues();
 </br>
 </br>
 
-    <table id="matchTable" hidden>
-        <thead>
-            <tr>
-                <th>Datum</th>
-                <th>land</th>
-                <th>liga</th>
-                <th>Hemma lag</th>
-                <th>Borta lag</th>
-                <th>Odds 1</th>
-                <th>(Odds X)</th>
-                <th>Odds 2</th>
-            
-            </tr>
-        </thead>
-    
-    
-    </table>
+  
 
 </body>
 

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

@@ -12,8 +12,30 @@ echo "Country id: " . $countryId . " leagueId: " . $leagueId;
 
 $matches = $conn->getMatches($countryId, $leagueId);
 
-foreach ($matches as $m) {
-    var_dump($m);
-}
+?>
 
-?>
+
+<table id="matchTable" hidden>
+    <thead>
+        <tr>
+            <th>Datum</th>
+            <th>Hemma lag</th>
+            <th>Borta lag</th>
+            <th>Odds 1</th>
+            <th>(Odds X)</th>
+            <th>Odds 2</th>
+        
+        </tr>
+    </thead>
+    <tbody>
+<?php 
+    foreach ($matches as $match) {
+        echo "<tr>";
+        echo "<td>".$match['gameDate'] . "</td>";
+        echo "<td>".$match['homeTeamName'] . "</td>";
+        echo "<td>".$match['awayTeamName'] . "</td>";
+        echo "<td>".$match[''] . "</td>";
+    }
+?>
+</tbody>
+</table>

+ 3 - 3
OddsJavaFx/src/web/webDbConnection.php

@@ -91,9 +91,9 @@ class WebDbConnection {
             $drawPercent = round((($homeTeamResults['draws'] + $awayTeamResults['draws']) / ($homeTeamCount + $awayTeamCount)) * 100, 2);
             $awayWinPercent = round((($awayTeamResults['wins'] + $homeTeamResults['lost']) / ($homeTeamCount + $awayTeamCount)) * 100, 2);
             
-            $match['homeWinPercent'] = $homeWinPercent;
-            $match['drawPercent'] = $drawPercent;
-            $match['awayWinPercent'] = $awayWinPercent;
+            $match[] = $homeWinPercent;
+            $match[] = $drawPercent;
+            $match[] = $awayWinPercent;
             
         }
         return $matches;