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.

game.php 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <html>
  2. <head>
  3. <link rel="stylesheet" href="style.css">
  4. </head>
  5. <?php
  6. require_once "ships.inc";
  7. require_once "dbase.inc";
  8. require_once "login.inc";
  9. require_once "gamefunction.inc";
  10. require_once "gamevisual.inc";
  11. session_start();
  12. logoutUser();
  13. checkLogin();
  14. loginTimout();
  15. ?>
  16. <body class="game">
  17. <?php $inputResult = validateInput(); ?>
  18. <main class="gamemain">
  19. <h1> Welkom <?= $_SESSION["spelerNaam"]; ?></h1>
  20. <!-- visual table shows hits/misses -->
  21. <table>
  22. <thead>
  23. <tr>
  24. <?php theadVisualTable(); ?>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. <tr>
  29. <?php tbodyVisualTable(); ?>
  30. </tr>
  31. </tbody>
  32. </table>
  33. <!-- put in coordinate shot or try again-->
  34. <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="POST">
  35. <?php
  36. shotForm();
  37. difficultyForm();
  38. ?>
  39. <input type="submit" class="difficulty__selection" <?php submitButtonValue(); ?>>
  40. </form>
  41. <?php
  42. showGameResult();
  43. echo $inputResult;
  44. ?>
  45. <p> <?php showShotsLeft(); ?> </p>
  46. <!-- logout button -->
  47. <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="POST">
  48. <input type="submit" value="logout" name="logout" class="difficulty__selection">
  49. </form>
  50. <!-- high score table -->
  51. <table>
  52. <caption>
  53. High Scores
  54. </caption>
  55. <thead>
  56. <tr>
  57. <th>Naam</th>
  58. <th>Score</th>
  59. </tr>
  60. </thead>
  61. <tbody>
  62. <?php tbodyHighScores(); ?>
  63. </tbody>
  64. </table>
  65. <!-- User score table -->
  66. <table>
  67. <caption>
  68. History results <?= $_SESSION['spelerNaam']; ?>
  69. </caption>
  70. <thead>
  71. <tr>
  72. <th>Datum</th>
  73. <th>Score</th>
  74. <th>Difficulty</th>
  75. </tr>
  76. </thead>
  77. <tbody>
  78. <?php tbodyUserScores(); ?>
  79. </tbody>
  80. </table>
  81. </main>
  82. </body>
  83. </html>