Pher0x

Untitled

Apr 2nd, 2019
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4. if(!isset($_SESSION['userid'])) {
  5. header('Location: login.php');
  6. exit();
  7. }
  8.  
  9. include("config.php");
  10. //Abfrage der Nutzer ID vom Login
  11. $userid = $_SESSION['userid'];
  12.  
  13. $statement = $pdo->prepare("SELECT * FROM device");
  14. $statement->execute();
  15. $devices = $statement->fetchAll();
  16.  
  17. $statement2 = $pdo->prepare("SELECT * FROM firmware");
  18. $statement2->execute();
  19. $firmwares = $statement2->fetchAll();
  20.  
  21. ?>
  22.  
  23. <h2>Geräte</h2>
  24.  
  25. <table class="table table-striped">
  26. <thead>
  27. <tr>
  28. <th>Name</th>
  29. <th>current_firmware_version</th>
  30. <th>supposed_firmware_version</th>
  31. <th>edit</th>
  32. </tr>
  33. </thead>
  34.  
  35. <tbody>
  36. <?php
  37.  
  38. foreach ($devices as $esp) {
  39. echo "<tr>";
  40. echo "<tr><td>" . $esp['name'] . "</td><td>" . $esp['current_fw_version'] . "</td><td>" . $esp['supposed_fw'] . "</td><td> <a href='edit.php?id=" . $esp['device_id'] . "'>edit</a></td><tr>";
  41. echo "<tr>";
  42. }
  43.  
  44. ?>
  45. </table>
  46.  
  47.  
  48.  
  49. <h2>Firmware</h2>
  50.  
  51. <table class="table table-striped">
  52. <thead>
  53. <tr>
  54. <th>Version</th>
  55. <th>Firmware Path</th>
  56. <th>Signature Path</th>
  57. </tr>
  58. </thead>
  59.  
  60. <tbody>
  61.  
  62. <?php
  63.  
  64. foreach ($firmwares as $firmware) {
  65. echo "<tr>";
  66. echo "<tr><td>" . $firmware['fw_version'] . "</td><td>" . $firmware['fwpath'] . "</td><td>" . $firmware['signaturepath'] . "</td>";
  67. echo "<tr>";
  68. }
  69.  
  70. ?>
  71. </table>
  72. <br>
  73.  
  74.  
  75.  
  76. <a href='upload.php'>Firmware hochladen</a>
  77.  
  78. <a href='logout.php'>Ausloggen</a>
Add Comment
Please, Sign In to add comment