mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
Add function on change room
This commit is contained in:
1 parent
32521d0ed3
commit
2c6e7e2ecc
2 files changed
+18
-10
No files matched your search
@@ -15,12 +15,15 @@ if (!empty ($_POST)){
|
||||
}
|
||||
if (isset ($_POST['deviceCommand']) && !empty ($_POST['deviceId'])) {
|
||||
$deviceManager->edit ($_POST['deviceId'], array ('command' => $_POST['deviceCommand']));
|
||||
}else if (!empty ($_POST['deviceCommand'])) {
|
||||
} else if (!empty ($_POST['deviceCommand'])) {
|
||||
$devices = $deviceManager->getAllDevices();
|
||||
foreach ($devices as $key => $device) {
|
||||
$deviceManager->edit ($device['device_id'], array ('command' => $_POST['deviceCommand']));
|
||||
}
|
||||
}
|
||||
if (!empty ($_POST['deviceRoomId']) && !empty ($_POST['deviceId'])) {
|
||||
$deviceManager->edit ($_POST['deviceId'], array ('room_id' => $_POST['deviceRoomId']));
|
||||
}
|
||||
header('Location: ./device');
|
||||
die();
|
||||
}
|
||||
Reference in new issue
Block a user