Compare commits

..

No commits in common. "04e83dccf64250bf5254cb98c4d232aa3737cc35" and "66dc2a367015d5bc06a74bc60ee4aa27c98641bc" have entirely different histories.

5 changed files with 1 additions and 29 deletions

View File

@ -28,9 +28,6 @@ if (!empty ($_POST)){
if (!empty ($_POST['deviceName']) && !empty ($_POST['deviceId'])) {
$deviceManager->edit ($_POST['deviceId'], array ('name' => $_POST['deviceName']));
}
if (!empty ($_POST['deviceApproved']) && !empty ($_POST['deviceId'])) {
$deviceManager->edit ($_POST['deviceId'], array ('approved' => $_POST['deviceApproved']));
}
if (isset ($_POST['deviceHistory']) && !empty ($_POST['deviceId'])) {
$subDeviceManager->editSubDevicesByDevice($_POST['deviceId'], array ('history' => $_POST['deviceHistory']));
}

View File

@ -1,7 +1,6 @@
<?php
if (isset($_POST) && !empty($_POST)){
$userManager = new UserManager();
$roomManager = new RoomManager();
if (isset($_POST['submitPasswordChange']) && $_POST['submitPasswordChange'] != "") {
$oldPassword = $_POST['oldPassword'];
$newPassword = $_POST['newPassword1'];
@ -31,10 +30,6 @@ if (isset($_POST) && !empty($_POST)){
$userManager->setUserDataAdmin("permission", $_POST['userPermission'], $_POST['userID']);
header('Location: ' . BASEURL . 'setting');
die();
} if (isset ($_POST['roomName']) && !empty ($_POST['roomId'])) {
$roomManager->edit($_POST['roomId'], array("name" => $_POST['roomName']));
header('Location: ' . BASEURL . 'setting');
die();
} else {
foreach ($_POST as $key => $value) {
if ($key == 'submit') continue;

View File

@ -37,15 +37,6 @@ class RoomManager{
}
}
public static function edit ($roomId, $values = []) {
try {
Db::edit ('rooms', $values, 'WHERE room_id = ?', array($roomId));
} catch(PDOException $error) {
echo $error->getMessage();
die();
}
}
public static function delete ($roomId) {
Db::command ('DELETE FROM rooms WHERE room_id=?', array ($roomId));
}

View File

@ -115,12 +115,6 @@
<input type="hidden" name="deviceId" value="<?php echo (!empty($device['device_id']) ? $device['device_id'] : ""); ?>">
<button class="fa custom-file-input" <?php echo (!empty($device['command']) && $device['command'] == "reset" ? "style=\"color:red;\"" : ""); ?> type="submit" name="deviceCommand" value="reset" title="Reset">&#xf01e;</button>
<button class="fa custom-file-input" <?php echo (!empty($device['command']) && $device['command'] == "config" ? "style=\"color:red;\"" : ""); ?> type="submit" name="deviceCommand" value="config" title="Config">&#xf013;</button>
<?php if (isset($device['approved']) && $device['approved'] == 0) : ?>
<button class="fas fa custom-file-input" type="submit" name="deviceApproved" value="1" title="Approved">&#xf00c;</button>
<?php endif; ?>
<?php if (isset($device['approved']) && $device['approved'] < 2) : ?>
<button class="fas fa custom-file-input" type="submit" name="deviceApproved" value="2" title="Blocked">&#xf00d;</button>
<?php endif; ?>
<div style="float: clear;"></div>
</form>
<?php endif; ?>

View File

@ -177,12 +177,7 @@ $partial = new Partial('head');
<tbody>
<?php foreach ($ROOMS as $key => $room) { ?>
<tr>
<td>
<form method="post" action="">
<input type="hidden" name="roomId" value="<?php echo (!empty($room['room_id']) ? $room['room_id'] : ""); ?>">
<input class="input" type="text" onchange="this.form.submit();" name="roomName" value="<?php echo (!empty($room['name']) ? $room['name'] : ""); ?>">
</form>
</td>
<td><?php echo $room['name']; ?></td>
<td>
<button name="deleteRoom" type="button" class="button is-danger fa">&#xf1f8;</button>
<button name="defaultRoom" type="button" class="button fa" <?php echo ($room['default'] ? 'disabled' : ''); ?>>&#xf140;</button>