Compare commits

..

No commits in common. "c6189ea7bd91494aec5a6dda3c8cb1b7f517bcba" and "e890afb4f57a01f970b5c1f97b33c61771980731" have entirely different histories.

8 changed files with 1 additions and 47 deletions

3
.gitignore vendored
View File

@ -11,9 +11,6 @@ Thumbs.db
# The active config file copied from config-dist.php
config.php
# The button log
buttonlog.txt
# Vim
*.swp
*.swo

View File

@ -5,7 +5,6 @@ $targets = [1, 2, 3];
$command = 0x00;
//file_put_contents("buttonlog.txt", date('Y-m-d H:i:s')."\n", FILE_APPEND);
foreach ( $targets as $target ) {
$target = intval($target);
$unique = mt_rand(1, 2000000000);

View File

@ -2,7 +2,7 @@
require "../header.php";
$query = "SELECT mac, ipaddress, label, board, firmware, service, zoneid, lastupdate FROM devices ORDER BY label, lastupdate DESC";
$query = "SELECT mac, ipaddress, label, board, firmware, service, lastupdate FROM devices ORDER BY label, lastupdate DESC";
$sth = $globaldbh->prepare($query);
$sth->execute();
@ -15,7 +15,6 @@ 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;
}

View File

@ -27,16 +27,4 @@ $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();

View File

@ -36,7 +36,6 @@ input[type=button] {
border-radius: 0.25em;
margin-left: 0;
margin-top: 0;
height: 2.5em;
}
.bc_red {
background-color: red;

View File

@ -28,7 +28,6 @@ CREATE TABLE `devices` (
`board` varchar(255) NOT NULL DEFAULT '',
`firmware` varchar(255) NOT NULL DEFAULT '',
`service` varchar(255) NOT NULL DEFAULT '',
`zoneid` int unsigned NOT NULL DEFAULT 0,
`lastupdate` datetime NOT NULL,
PRIMARY KEY (`mac`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

View File

@ -75,7 +75,6 @@ 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>";

View File

@ -1,26 +0,0 @@
<?php
require "header.php";
function usage() {
echo "Usage: requeststatus.php <idmask>\n";
echo "";
exit();
}
if ( php_sapi_name() != "cli" ) exit();
if ( $argc != 2 ) usage();
$idmask = intval($argv[1]);
if ( ($idmask <= 0) || ($idmask > 31) ) usage();
$command = 0x04;
$target = $idmask;
$unique = mt_rand(1, 2000000000);
$data = pack("LLLCL", PACKETFILTER[0], PACKETFILTER[1], $unique, $command, $target);
transmitMessage($data);
exit();