Update to show zone ID on device list
This commit is contained in:
parent
a6feddf8c3
commit
e4dc7b69f2
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require "../header.php";
|
||||
|
||||
$query = "SELECT mac, ipaddress, label, board, firmware, service, lastupdate FROM devices ORDER BY label, lastupdate DESC";
|
||||
$query = "SELECT mac, ipaddress, label, board, firmware, service, zoneid, lastupdate FROM devices ORDER BY label, lastupdate DESC";
|
||||
$sth = $globaldbh->prepare($query);
|
||||
$sth->execute();
|
||||
|
||||
|
|
@ -15,6 +15,7 @@ while ( $row = $sth->fetch(PDO::FETCH_ASSOC) ) {
|
|||
$d["board"] = $row["board"];
|
||||
$d["firmware"] = $row["firmware"];
|
||||
$d["service"] = $row["service"];
|
||||
$d["zoneid"] = $row["zoneid"];
|
||||
$d["lastupdate"] = $row["lastupdate"];
|
||||
$data[] = $d;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,4 +27,16 @@ $sth->bindValue(":firmware", $firmware, PDO::PARAM_STR);
|
|||
$sth->bindValue(":service", $service, PDO::PARAM_STR);
|
||||
$sth->execute();
|
||||
|
||||
$query = "SELECT zoneid FROM devices WHERE mac=:mac";
|
||||
$sth = $globaldbh->prepare($query);
|
||||
$sth->bindValue(":mac", $mac, PDO::PARAM_STR);
|
||||
$sth->execute();
|
||||
|
||||
$zoneid = 0;
|
||||
if ( $row = $sth->fetch(PDO::FETCH_ASSOC) ) {
|
||||
$zoneid = $row["zoneid"];
|
||||
}
|
||||
echo($zoneid);
|
||||
|
||||
|
||||
exit();
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ function getDevices() {
|
|||
html += "<div class='device-container'>";
|
||||
html += "<div class='device-property'><span class='device-property-label'>Service:</span>" + escapeHTML(device.service) + "</div>";
|
||||
html += "<div class='device-property'><span class='device-property-label'>Label:</span>" + escapeHTML(device.label) + "</div>";
|
||||
html += "<div class='device-property'><span class='device-property-label'>ZoneId:</span>" + device.zoneid + "</div>";
|
||||
html += "<div class='device-property'><span class='device-property-label'>Board:</span>" + escapeHTML(device.board) + "</div>";
|
||||
html += "<div class='device-property'><span class='device-property-label'>IP Address:</span>" + escapeHTML(device.ipaddress) + "</div>";
|
||||
html += "<div class='device-property'><span class='device-property-label'>Last Update:</span>" + escapeHTML(device.lastupdate) + "</div>";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user