PHP_SMART_HOME_V3/app/templates/part/automationCreateFinal.phtml

41 lines
2.2 KiB
PHTML
Raw Normal View History

2019-08-23 11:39:42 +00:00
<div class="modal-container" id="modal">
<div class="modal">
<a href=""><i class="fa fa-times close"></i></a>
2019-10-11 12:12:05 +00:00
<h4 class="mb-4"><?php $LANGMNG->echo('t_createAutomation'); ?></h4>
2019-08-23 11:39:42 +00:00
<form method="post">
<div class="field">
2019-08-24 11:07:07 +00:00
<input type="hidden" name="atSelector" value="<?php echo $_POST['atSelector']; ?>" required/>
2019-10-08 16:23:57 +00:00
<input type="hidden" name="name" value="<?php echo $_POST['name']; ?>" required/>
2019-08-24 11:07:07 +00:00
<input type="hidden" name="atSelectorValue" value="<?php if (isset($_POST['atTime'])) {
2019-08-23 11:39:42 +00:00
echo $_POST['atTime'];
} else if (isset($_POST['atDeviceValue'])) {
$subDeviceId = $_POST['atDeviceValue'];
$subDeviceValue = $_POST['atDeviceValueInt'];
$subDevice = SubDeviceManager::getSubDevice($subDeviceId);
$subDeviceMaster = SubDeviceManager::getSubDeviceMaster($subDeviceId,$subDevice['type']);
2019-10-08 16:23:57 +00:00
2019-08-23 11:39:42 +00:00
$json = json_encode([
'deviceID' => $subDeviceMaster['device_id'],
'type'=> htmlspecialchars($subDevice['type']),
'value'=> $subDeviceValue,
]);
echo htmlspecialchars($json);
}
else {
echo $_POST['atSelector'];
} ?>" required/>
<input type="hidden" name="atDays" value="<?php echo htmlspecialchars(($_POST['day'] != '' ? json_encode($_POST['day']) : '')); ?>" required/>
<?php foreach ($_POST['devices'] as $value) { ?>
<?php $deviceData = DeviceManager::getDeviceById($value); ?>
<div class="label"><?php echo $deviceData['name'];?></div>
<select class="input" name="device[<?php echo $deviceData['device_id'];?>]">
<option value="1">ON</option>
<option value="0">OFF</option>
</select>
<?php } ?>
</div>
2019-10-11 12:12:05 +00:00
<input type="submit" class="button" name="modalFinal" value="<?php $LANGMNG->echo('b_finish'); ?>"/>
2019-08-23 11:39:42 +00:00
</form>
</div>
2019-10-08 16:23:57 +00:00
</div>