add name to automatization

This commit is contained in:
unknown
2019-10-08 18:23:57 +02:00
parent 9ae039a4b5
commit 68da935592
8 changed files with 38 additions and 18 deletions

View File

@@ -8,7 +8,7 @@ if (isset($_POST) && !empty($_POST)){
], JSON_PRETTY_PRINT);
$onDays = $_POST['atDays'];
AutomationManager::create('name', $onDays, $doCode, $ifCode);
AutomationManager::create($_POST['name'], $onDays, $doCode, $ifCode);
header('Location: /vasek/home/' . strtolower(basename(__FILE__, '.php')), TRUE);
die();
@@ -23,7 +23,7 @@ if (isset($_POST) && !empty($_POST)){
$json = json_encode([
'deviceID' => $subDeviceMaster['device_id'],
'type'=> htmlspecialchars($subDevice['type']),
'type'=> $subDevice['type'],
'value'=> $subDeviceValue,
]);
}
@@ -36,7 +36,7 @@ if (isset($_POST) && !empty($_POST)){
], JSON_PRETTY_PRINT);
$onDays = ($_POST['day'] != '' ? json_encode($_POST['day']) : '');
AutomationManager::create('name', $onDays, $doCode, $ifCode, (isset ($_POST['automation_id']) ? $_POST['automation_id'] : ""));
AutomationManager::create($_POST['name'], $onDays, $doCode, $ifCode, (isset ($_POST['automation_id']) ? $_POST['automation_id'] : ""));
header('Location: /vasek/home/' . strtolower(basename(__FILE__, '.php')), TRUE);
die();