PHP_SMART_HOME_V3/app/templates/setting.phtml
2019-10-25 18:48:48 +02:00

133 lines
4.8 KiB
PHTML

<!DOCTYPE html>
<html lang="en">
<head>
<?php
$partial = new Partial('head');
$partial->prepare('baseDir', $BASEDIR);
$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', 'setting');
$partial->prepare('langMng',$LANGMNG);
$partial->render();
?>
</div>
<div class="col-md-9 main-body">
<div class="col-12 col-sm-9 mx-auto mt-4">
<h4 class="mb-4">
<?php $LANGMNG->echo('t_pageAfterLogIn') ?>
</h4>
<form method="post" enctype="multipart/form-data">
<div class="">
<div class="field">
<select class="input" name="loadPage">
<option value="0" <?php echo (UserManager::getUserData("startPage") == 0 ? "selected" : ""); ?>>Default</option>
<option value="1" <?php echo (UserManager::getUserData("startPage") == 1 ? "selected" : ""); ?>>Dashboard</option>
</select>
</div>
<input type="submit" name="submit" class="button" value="<?php $LANGMNG->echo('b_save') ?>"/>
</div>
</div>
</form>
<div class="col-12 col-sm-9 mx-auto mt-4">
<h4 class="mb-4"><?php $LANGMNG->echo('t_profile') ?></h4>
<div class="field">
<a href="logout" class="button is-primary"><?php $LANGMNG->echo('b_logOut') ?></a>
</div>
</div>
<div class="col-12 col-sm-9 mx-auto mt-4">
<h4 class="mb-4"><?php $LANGMNG->echo('t_notification') ?></h4>
<input id="notifications" type="checkbox" onChange="toggleNotificationPermissions(this);" />
<div class="label"><?php $LANGMNG->echo('l_notificationStatus') ?></div>
<div class="field">
<a onClick="sendTestNotification();" class="button"><?php $LANGMNG->echo('b_sendTestNotification');?></a>
</div>
</div>
<div class="col-12 col-sm-9 mx-auto mt-4">
<h4 class="mb-4"><?php $LANGMNG->echo('t_experimental') ?></h4>
<div class="field">
<a href="rooms" class="button"><?php $LANGMNG->echo('b_rooms') ?></a>
</div>
</div>
<div class="col-12 col-sm-9 mx-auto mt-4">
<h4 class="mb-4"><?php $LANGMNG->echo('t_changePassword') ?></h4>
<form method="post">
<div class="field">
<div class="label"><?php $LANGMNG->echo('l_oldPassword') ?>:</div>
<input type="password" class="input" name="oldPassword" value="" data-cip-id="cIPJQ342845639">
</div>
<div class="field">
<div class="label"><?php $LANGMNG->echo('l_newPassword') ?>:</div>
<input type="password" class="input" name="newPassword1" value="" data-cip-id="cIPJQ342845639">
</div>
<div class="field">
<div class="label"><?php $LANGMNG->echo('l_newPassword') ?>:</div>
<input type="password" class="input" name="newPassword2" value="" data-cip-id="cIPJQ342845639">
</div>
<div class="field">
<input type="submit" name="submitPasswordChange" class="button" value="Uložit">
</div>
</form>
</div>
<div class="col-12 col-sm-9 mx-auto mt-4">
<h4 class="mb-4"><?php $LANGMNG->echo('t_ota') ?></h4>
<?php if (!empty($QRURL)) {?>
<img src="<?php echo $QRURL;?>" />
<?php } else {?>
<button name="deactivateOta" type="button" class="button is-danger fa"><?php $LANGMNG->echo('b_disable');?> <?php $LANGMNG->echo('b_ota'); ?></button>
<?php }?>
</div>
<div class="col-12 col-sm-9 mx-auto mt-4">
<h4 class="mb-4"><?php $LANGMNG->echo('t_createuser') ?></h4>
<table class="table is-fluid">
<thead>
<tr>
<th><?php $LANGMNG->echo('t_userName');?></th>
<th><?php $LANGMNG->echo('t_ota');?></th>
<th><?php $LANGMNG->echo('t_action');?></th>
</tr>
</thead>
<tbody>
<?php foreach ($USERS as $key => $user) { ?>
<tr>
<td><?php echo $user['username']; ?></td>
<td><?php echo ($user['ota'] ? '<span class="fa">&#xf00c;</span>' : ''); ?></td>
<td><button name="deleteUser" type="button" class="button is-danger fa">&#xf1f8;</button></td>
</tr>
<?php } ?>
</tbody>
</table>
<form method="post">
<div class="field">
<div class="label"><?php $LANGMNG->echo('l_userName') ?>:</div>
<input type="text" class="input" name="userName" value="" data-cip-id="cIPJQ342845639">
</div>
<div class="field">
<div class="label"><?php $LANGMNG->echo('l_password') ?>:</div>
<input type="password" class="input" name="userPassword" value="" data-cip-id="cIPJQ342845639">
</div>
<div class="field">
<input type="submit" name="submitCreateUser" class="button" value="Uložit">
</div>
</form>
</div>
</div>
</div>
<?php
$partial = new Partial('footer');
$partial->render();
?>
<script src="./app/templates/js/setting.js"></script>
</script>
</body>
</html>