Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if(!isset($_SESSION['userid'])) {
- header('Location: login.php');
- exit();
- }
- include("config.php");
- //Abfrage der Nutzer ID vom Login
- $userid = $_SESSION['userid'];
- $statement = $pdo->prepare("SELECT * FROM device");
- $statement->execute();
- $devices = $statement->fetchAll();
- $statement2 = $pdo->prepare("SELECT * FROM firmware");
- $statement2->execute();
- $firmwares = $statement2->fetchAll();
- ?>
- <h2>Geräte</h2>
- <table class="table table-striped">
- <thead>
- <tr>
- <th>Name</th>
- <th>current_firmware_version</th>
- <th>supposed_firmware_version</th>
- <th>edit</th>
- </tr>
- </thead>
- <tbody>
- <?php
- foreach ($devices as $esp) {
- echo "<tr>";
- 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>";
- echo "<tr>";
- }
- ?>
- </table>
- <h2>Firmware</h2>
- <table class="table table-striped">
- <thead>
- <tr>
- <th>Version</th>
- <th>Firmware Path</th>
- <th>Signature Path</th>
- </tr>
- </thead>
- <tbody>
- <?php
- foreach ($firmwares as $firmware) {
- echo "<tr>";
- echo "<tr><td>" . $firmware['fw_version'] . "</td><td>" . $firmware['fwpath'] . "</td><td>" . $firmware['signaturepath'] . "</td>";
- echo "<tr>";
- }
- ?>
- </table>
- <br>
- <a href='upload.php'>Firmware hochladen</a>
- <a href='logout.php'>Ausloggen</a>
Add Comment
Please, Sign In to add comment