Add approve changer in actions in device list

This commit is contained in:
haitem 2021-03-01 17:24:24 +01:00
parent fe1247fdaf
commit 5f03295ad3
2 changed files with 5 additions and 0 deletions

View File

@ -28,6 +28,9 @@ 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

@ -115,6 +115,8 @@
<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>
<button class="fas fa custom-file-input" <?php echo (!empty($device['approved']) && $device['approved'] == 1 ? "style=\"color:Green;\"" : ""); ?> type="submit" name="deviceApproved" value="1" title="Approved">&#xf00c;</button>
<button class="fas fa custom-file-input" <?php echo (!empty($device['approved']) && $device['approved'] == 2 ? "style=\"color:red;\"" : ""); ?> type="submit" name="deviceApproved" value="2" title="Blocked">&#xf00d;</button>
<div style="float: clear;"></div>
</form>
<?php endif; ?>