PHP_SMART_HOME_V3/app/templates/log.phtml

64 lines
2.2 KiB
PHTML
Raw Normal View History

2019-09-01 13:55:33 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<?php
$partial = new Partial('head');
$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">
2019-09-19 12:48:31 +00:00
<?php
$partial = new Partial('menu');
$partial->prepare('item', 'log');
$partial->prepare('lang',$LANG);
$partial->render();
?>
2019-09-01 13:55:33 +00:00
</div>
<div class="col-md-9 main-body">
<div class="col-12 col-sm-9 mx-auto mt-4">
<form method="post" action="">
<div class="field">
<div class="label">LOG:CZ</div>
<select class="input" name="LogFile">
<?php foreach ($LOGSFILES as $key => $value) { ?>
<option value="<?php echo $value; ?>"><?php echo $value; ?></option>
<?php } ?>
</select>
<input type="submit" class="button" name="selectFile" value="file"/>
</div>
</form>
2019-09-19 12:48:31 +00:00
<?php
if (isset($_POST['LogFile'])) {
$file_lines = file('./app/logs/' . $_POST['LogFile']);
echo '<pre style="overflow: auto;">';
2019-09-19 12:48:31 +00:00
foreach ($file_lines as $line) {
echo $line;
}
echo '</pre>';
2019-09-01 13:55:33 +00:00
}
2019-09-19 12:48:31 +00:00
?>
2019-09-01 13:55:33 +00:00
</div>
</div>
<?php
$partial = new Partial('footer');
$partial->render();
//TODO js do main.js
?>
<script>
$( "#enable-features" ).click(function(e) {
var selectRoomId = localStorage.getItem("enableFeature");
if (selectRoomId){
localStorage.setItem("enableFeature", true);
}else {
localStorage.setItem("enableFeature", false);
}
});
</script>
</body>
</html>