| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?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><input hidden id='gameId' name='gameIdName' value='" . $match['id'] . "'/>";
- 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' 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>";
- echo "<td><input id='button' type='submit'/></td>";
- echo "</form>";
- echo "</tr>";
- }
- ?>
- </tbody>
- </table>
- </body>
|