You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
2.0 KiB

6 years ago
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  5. <meta charset="UTF-8">
  6. <title>UserInterface</title>
  7. <link rel="stylesheet" href="style.css">
  8. </head>
  9. <body>
  10. <div id = "basics">
  11. <span class="inline"><img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Ftse4.mm.bing.net%2Fth%3Fid%3DOIP.ELnJq_JhiyfewhCMKOkNfwHaHa%26pid%3DApi&f=1" id="userpic" alt=""></span>
  12. <br>
  13. <span class="inline">
  14. <table>
  15. <tr>
  16. <td class="table-header"><solid>Name:</solid></td>
  17. <td id = "name"></td>
  18. <td class="table-header"><solid>TC:</solid></td>
  19. <td id = "tc"></td>
  20. </tr>
  21. <tr>
  22. <td class="table-header"><solid>Phone Number:</solid></td>
  23. <td id = "number"></td>
  24. <td class="table-header"><solid>E-Mail:</solid></td>
  25. <td id = "email"></td>
  26. </tr>
  27. <tr>
  28. <td class="table-header"><solid>Health info:</solid></td>
  29. <td id = "health"></td>
  30. </tr>
  31. </table>
  32. </span>
  33. <script>
  34. setInterval(function() {
  35. $.get("http://127.0.0.1:3000/get", function(data, status){
  36. userData = $.parseJSON(data)
  37. if (status == "success") {
  38. console.log(data)
  39. document.getElementById("userpic").src = "https://0.0.0.0:5000" + userData["avatar"];
  40. document.getElementById("name").innerHTML = userData["realname"];
  41. document.getElementById("tc").innerHTML = userData["TC"];
  42. document.getElementById("health").innerHTML = userData["health"].join(", ");
  43. document.getElementById("number").innerHTML = userData["tel"];
  44. document.getElementById("email").innerHTML = userData["email"];
  45. }
  46. });
  47. }, 2000);
  48. </script>
  49. </div>
  50. </body>
  51. </html>