index.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. include_once 'Database.php';
  3. include_once 'WebFunctions.php';
  4. ?>
  5. <!DOCTYPE html>
  6. <html lang="en">
  7. <head>
  8. <meta charset='utf-8'>
  9. <meta http-equiv='X-UA-Compatible'>
  10. <title>Odds webspace</title>
  11. <meta name='viewport' content='width=device-width, initial-scale=1'>
  12. <link rel='stylesheet' type='text/css' media='screen' href='styles.css'>
  13. <link href="https://cdn.datatables.net/1.13.3/css/jquery.dataTables.css">
  14. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
  15. <script src="https://cdn.datatables.net/1.13.3/js/jquery.dataTables.js"></script>
  16. </head>
  17. <body>
  18. <h1> Odds better </h1>
  19. <?php
  20. $betAmount = 0.25;
  21. $bank = 500;
  22. echo '<label for="bank">Bank: </label><input type="number" name="bank" id="bank" size="10" value="' .
  23. $bank .
  24. '">' .
  25. '<output class="bank-output" for="bank"></output>';
  26. $database = new Database();
  27. $matches = $database->getTodaysPrioMatches();
  28. $wf = new WebFunctions();
  29. $wf->createMatchTable($matches, $betAmount, $bank);
  30. $wf->createOutstandingBetsTable();
  31. ?>
  32. <p>Another test p tag 3</p>
  33. <script>
  34. $(document).ready( function () {
  35. $('#soccerMatchTable').DataTable();
  36. } );
  37. </script>
  38. <script>
  39. $(document).ready( function () {
  40. $('#outstandingBetsTable').DataTable();
  41. } );
  42. </script>
  43. <script>
  44. const bank = document.querySelector("#bank");
  45. const output = document.querySelector(".bank-output");
  46. output.textContent = bank.value;
  47. bank.addEventListener("input", () => {
  48. output.textContent = bank.value;
  49. console.log("Bank updated " + output.textContent);
  50. })
  51. </script>
  52. <!-- Script to handle submit button -->
  53. </body>
  54. </html>