diff --git a/app/controllers/deviceController.php b/app/controllers/deviceController.php index bc367f3..0958618 100644 --- a/app/controllers/deviceController.php +++ b/app/controllers/deviceController.php @@ -24,6 +24,9 @@ if (!empty ($_POST)){ if (!empty ($_POST['deviceRoomId']) && !empty ($_POST['deviceId'])) { $deviceManager->edit ($_POST['deviceId'], array ('room_id' => $_POST['deviceRoomId'])); } + if (!empty ($_POST['deviceName']) && !empty ($_POST['deviceId'])) { + $deviceManager->edit ($_POST['deviceId'], array ('name' => $_POST['deviceName'])); + } header('Location: ./device'); die(); } diff --git a/app/views/templates/device.phtml b/app/views/templates/device.phtml index b0396ca..db37436 100644 --- a/app/views/templates/device.phtml +++ b/app/views/templates/device.phtml @@ -42,9 +42,14 @@ &#x - -
+ + "> + "> +
+ + +
">