matchTable.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. include_once __DIR__ . '/webDbConnection.php';
  3. $conn = new WebDbConnection( );
  4. var_dump($_POST);
  5. $countryId = $_POST['countrySelector'];
  6. $leagueId = $_POST['leagueSelector'];
  7. echo "Country id: " . $countryId . " leagueId: " . $leagueId;
  8. $matches = $conn->getMatches($countryId, $leagueId);
  9. ?>
  10. <head>
  11. <link rel="stylesheet" href="style.css">
  12. </head>
  13. <body>
  14. <table id="matchTable">
  15. <thead>
  16. <tr>
  17. <th>Datum</th>
  18. <th>Hemma lag</th>
  19. <th>Borta lag</th>
  20. <th>Odds 1</th>
  21. <th>(Odds X)</th>
  22. <th>Odds 2</th>
  23. </tr>
  24. </thead>
  25. <tbody>
  26. <?php
  27. foreach ($matches as $match) {
  28. echo "<tr>";
  29. echo "<td>".$match['gameDate'] . "</td>";
  30. echo "<td>".$match['homeTeamName'] . "</td>";
  31. echo "<td>".$match['awayTeamName'] . "</td>";
  32. echo "<td>".$match['homeWinPercent'] . "</td>";
  33. echo "<td>".$match['drawPercent'] . "</td>";
  34. echo "<td>".$match['awayWinPercent'] . "</td>";
  35. }
  36. ?>
  37. </tbody>
  38. </table>
  39. </body>