| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- include_once __DIR__ . '/webDbConnection.php';
- $conn = new WebDbConnection( );
- $countryId = $_POST['countrySelector'];
- $leagueId = $_POST['leagueSelector'];
- $matches = $conn->getMatches($countryId, $leagueId);
- ?>
- <head>
- <link rel="stylesheet" href="style.css">
- </head>
- <body>
- <table id="matchTable">
- <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>
- <th>Bet home (true)/away (false)</th>
- <th>Bet Odds</th>
- <th>Bet Amount</th>
- <th> </th>
- </tr>
- </thead>
- <tbody>
- <?php
- foreach ($matches as $match) {
- echo "<form action='makeBet.php' method='post'>";
- echo "<tr>";
- 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><input id='betHome' type='checkbox'/></td>";
- echo "<td><input id='betOdds' type='number'/></td>";
- echo "<td><input id='betAmount' type='number'/></td>";
- echo "<td><input id='button' type='submit'/></td>";
- echo "</form>";
- echo "</tr>";
- }
- ?>
- </tbody>
- </table>
- </body>
|