matchTable.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. include_once __DIR__ . '/webDbConnection.php';
  3. $conn = new WebDbConnection( );
  4. $countryId = $_POST['countrySelector'];
  5. $leagueId = $_POST['leagueSelector'];
  6. $matches = $conn->getMatches($countryId, $leagueId);
  7. ?>
  8. <head>
  9. <link rel="stylesheet" href="style.css">
  10. </head>
  11. <body>
  12. <table id="matchTable">
  13. <thead>
  14. <tr>
  15. <th>Datum</th>
  16. <th>Hemma lag</th>
  17. <th>Borta lag</th>
  18. <th>Odds 1</th>
  19. <th>(Odds X)</th>
  20. <th>Odds 2</th>
  21. <th>Bet home (true)/away (false)</th>
  22. <th>Bet Odds</th>
  23. <th>Bet Amount</th>
  24. <th>&nbsp;</th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. <?php
  29. foreach ($matches as $match) {
  30. echo "<form action='makeBet.php' method='post'>";
  31. echo "<tr>";
  32. echo "<td>".$match['gameDate'] . "</td>";
  33. echo "<td>".$match['homeTeamName'] . "</td>";
  34. echo "<td>".$match['awayTeamName'] . "</td>";
  35. echo "<td>". round(100 / $match['homeWinPercent'], 2) . "</td>";
  36. echo "<td>". round(100 / $match['drawPercent'], 2) . "</td>";
  37. echo "<td>". round(100 / $match['awayWinPercent'], 2) . "</td>";
  38. echo "<td><input id='betHome' type='checkbox'/></td>";
  39. echo "<td><input id='betOdds' type='number'/></td>";
  40. echo "<td><input id='betAmount' type='number'/></td>";
  41. echo "<td><input id='button' type='submit'/></td>";
  42. echo "</form>";
  43. echo "</tr>";
  44. }
  45. ?>
  46. </tbody>
  47. </table>
  48. </body>