PHP_SMART_HOME_V3/app/views/templates/automation.phtml

99 lines
2.7 KiB
PHTML
Raw Permalink Normal View History

2020-05-16 15:18:27 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<?php
$partial = new Partial('head');
2020-05-16 15:18:27 +00:00
$partial->prepare('baseDir', $BASEDIR);
$partial->prepare('baseUrl', $BASEURL);
2020-05-16 15:18:27 +00:00
$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">
2021-03-01 15:02:21 +00:00
<?php
foreach ($AUTOMATIONS as $automationId => $automationData) {
2020-05-16 15:18:27 +00:00
//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();
2021-03-01 15:02:21 +00:00
$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();
2020-05-16 15:18:27 +00:00
}?>
<script src="./app/templates/js/automation.js"></script>
<?php
$partial = new Partial('footer');
2020-06-26 14:58:08 +00:00
$partial->prepare('baseDir', $BASEDIR);
2020-05-16 15:18:27 +00:00
$partial->render();
?>
</body>
</html>