PHP_SMART_HOME_V3/app/views/templates/automation.phtml
2021-03-01 16:02:21 +01:00

99 lines
2.7 KiB
PHTML

<!DOCTYPE html>
<html lang="en">
<head>
<?php
$partial = new Partial('head');
$partial->prepare('baseDir', $BASEDIR);
$partial->prepare('baseUrl', $BASEURL);
$partial->render();
?>
<title><?php echo $TITLE ?></title>
</head>
<body class="no-transitions">
<div class="row no-gutters main">
<div class="col-md-3 d-sm-none"></div>
<div class="col-md-3 nav-container">
<?php
$partial = new Partial('menu');
$partial->prepare('item','automation');
$partial->prepare('langMng',$LANGMNG);
$partial->prepare('debugMod',$DEBUGMOD);
$partial->render();
?>
</div>
<div class="col-md-9 main-body">
<a class="button is-primary m-1" onClick="$('#modal').removeClass('modal-container-hiden').show();"><?php $LANGMNG->echo('t_createAutomation'); ?></a>
<div class="row no-gutters">
<?php
foreach ($AUTOMATIONS as $automationId => $automationData) {
//BUTTON
$partial = new Partial('automationButton');
$partial->prepare('langMng',$LANGMNG);
$partial->prepare('automationId',$automationId);
$partial->prepare('automationData',$automationData);
$partial->render();
//EDIT
$partial = new Partial('automationEdit');
$partial->prepare('langMng',$LANGMNG);
$partial->prepare('userManager',$USERMANAGER);
$partial->prepare('automationId',$automationId);
$partial->prepare('automation',$automationData);
$partial->prepare('subDevices',$SUBDEVICES);
$partial->render();
} ?>
</div>
</div>
</div>
<?php
if (isset($_POST['modalNext'])) {
$partial = new Partial('automationCreateFinal');
$partial->prepare('langMng',$LANGMNG);
$partial->prepare('userManager',$USERMANAGER);
$partial->prepare('subDevices',$SUBDEVICES);
$partial->render();
} else {
$partial = new Partial('automationCreate');
$partial->prepare('langMng',$LANGMNG);
$partial->prepare('subDevices',$SUBDEVICES);
$partial->render();
$form = new Form('Automation', 'automation-1', 'POST', '');
$form->addInput('text','name', 'name', '', true, true);
$form->addSelect('run-condition', 'run-condition', 'l_run_condition', [
'test' => 'test',
'test1' => 'test',
'test2' => 'test',
'test3' => 'test',
'test4' => 'test',
'test5' => 'test',
], true, true, true);
$form->addInput('button','add-condition', 'add-condition', 'l_condition', true, true);
$form->addSelect('active-time', 'active-time', 'l_run_schedule', [
'all' => 'l_all',
'day' => 'l_day',
'night' => 'l_night',
'custome' => 'l_custome',
], true, true, true);
$form->render();
}?>
<script src="./app/templates/js/automation.js"></script>
<?php
$partial = new Partial('footer');
$partial->prepare('baseDir', $BASEDIR);
$partial->render();
?>
</body>
</html>