Axel Nordh 2 роки тому
батько
коміт
db4a3dfaa8
2 змінених файлів з 18 додано та 3 видалено
  1. 2 1
      fiveserver.config.js
  2. 16 2
      index.php

+ 2 - 1
fiveserver.config.js

@@ -1,3 +1,4 @@
 module.exports = {
-    php: "D:\\Programming\\php-8\\php.exe"
+    // php: "D:\\Programming\\php-8\\php.exe"
+    php: "/usr/bin/php"
 }

+ 16 - 2
index.php

@@ -26,9 +26,10 @@ include_once 'WebFunctions.php';
 <?php
 $betAmount = 0.25;
 $bank = 500;
-echo '<label>Bank: </label><form><input type="number" id="bankInput" size="10" value="' .
+echo '<label for="bank">Bank: </label><input type="number" name="bank" id="bank" size="10" value="' .
     $bank .
-    '"></form>';
+    '">' .
+    '<output class="bank-output" for="bank"></output>';
 $database = new Database();
 $matches = $database->getTodaysPrioMatches();
 $wf = new WebFunctions();
@@ -48,6 +49,19 @@ $wf->createOutstandingBetsTable();
     } );
 </script>
 
+<script>
+    const bank = document.querySelector("#bank");
+    const output = document.querySelector(".bank-output");
+
+    output.textContent = bank.value;
+
+    bank.addEventListener("input", () => {
+        output.textContent = bank.value;
+        console.log("Bank updated " + output.textContent);
+    })
+
+</script>
+
 
 <!-- Script to handle submit button -->
 </body>