|
|
@@ -11,10 +11,11 @@ $matches = $conn->getMatches($countryId, $leagueId);
|
|
|
?>
|
|
|
<head>
|
|
|
<link rel="stylesheet" href="style.css">
|
|
|
- <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
|
|
|
</head>
|
|
|
<body>
|
|
|
|
|
|
+<iframe name="hiddenFrame" class="hide"></iframe>
|
|
|
+
|
|
|
<table id="matchTable">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
@@ -34,7 +35,7 @@ $matches = $conn->getMatches($countryId, $leagueId);
|
|
|
<tbody>
|
|
|
<?php
|
|
|
foreach ($matches as $match) {
|
|
|
- echo "<form action='makeBet.php' method='post'>";
|
|
|
+ echo "<form action='makeBet.php' method='post' target='hiddenFrame'>";
|
|
|
echo "<tr>";
|
|
|
echo "<td hidden><input hidden id='gameId' name='gameIdName' value='" . $match['id'] . "'/>";
|
|
|
echo "<td>".$match['gameDate'] . "</td>";
|
|
|
@@ -54,18 +55,4 @@ $matches = $conn->getMatches($countryId, $leagueId);
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
-<script>
|
|
|
-$(document).ready(function(){
|
|
|
- var $form = $('form');
|
|
|
- $('form').live('submit', function() {
|
|
|
- $.post($(this).attr('action'), $(this).serialize(), function(response) {
|
|
|
- // here on success
|
|
|
- console.log("Sent bet to db");
|
|
|
- }, 'json');
|
|
|
- return false;
|
|
|
- });
|
|
|
-});
|
|
|
-
|
|
|
-</script>
|
|
|
-
|
|
|
</body>
|