2019-08-23 11:39:42 +00:00
|
|
|
<?php
|
|
|
|
if (isset($_POST) && !empty($_POST)){
|
|
|
|
if (isset($_POST['modalFinal']) && $_POST['modalFinal'] == "Next") {
|
2019-08-24 11:07:07 +00:00
|
|
|
$doCode = json_encode($_POST['device'], JSON_PRETTY_PRINT);
|
|
|
|
$ifCode = json_encode([
|
|
|
|
"type" => $_POST['atSelector'],
|
|
|
|
"value" => $_POST['atSelectorValue'],
|
|
|
|
], JSON_PRETTY_PRINT);
|
2019-08-23 11:39:42 +00:00
|
|
|
$onDays = $_POST['atDays'];
|
|
|
|
|
|
|
|
AutomationManager::create('name', $onDays, $doCode, $ifCode);
|
|
|
|
|
2019-08-23 12:30:46 +00:00
|
|
|
header('Location: /vasek/home/' . strtolower(basename(__FILE__, '.php')), TRUE);
|
|
|
|
die();
|
|
|
|
}
|
2019-08-23 11:39:42 +00:00
|
|
|
}
|
|
|
|
?>
|