diff --git a/ajax/getdevices.php b/ajax/getdevices.php index f64a071..3c6ae55 100644 --- a/ajax/getdevices.php +++ b/ajax/getdevices.php @@ -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; } diff --git a/boardstatus.php b/boardstatus.php index 3b1a556..6744c42 100644 --- a/boardstatus.php +++ b/boardstatus.php @@ -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(); diff --git a/js/minimal.js b/js/minimal.js index d97da5f..bbef413 100755 --- a/js/minimal.js +++ b/js/minimal.js @@ -75,6 +75,7 @@ function getDevices() { html += "