PHP_SMART_HOME_V3/app/views/templates/log.phtml

94 lines
2.6 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', 'log');
$partial->prepare('langMng',$LANGMNG);
$partial->prepare('debugMod',$DEBUGMOD);
$partial->render();
?>
</div>
<div class="col-md-9 main-body">
<div class="col-12 col-sm-9 mx-auto mt-4">
<h1><?php echo $LANGMNG->get('t_Logs'); ?></h1>
<div class="row mb-4">
<div class="col-6 col-lg-3">
<div class="panel alert alert-danger p-4 is-danger">
<h5><?php $LANGMNG->echo('error'); ?></h5>
<?php echo $LOGSTATS['ERROR'];?>
</div>
</div>
<div class="col-6 col-lg-3">
<div class="panel alert alert-warning p-4">
<h5><?php $LANGMNG->echo('warning'); ?></h5>
<?php echo $LOGSTATS['WARNING'];?>
</div>
</div>
<div class="col-6 col-lg-3">
<div class="panel alert alert-warning p-4">
<h5 ><?php $LANGMNG->echo('exeption'); ?></h5>
<?php echo $LOGSTATS['EXEPTION'];?>
</div>
</div>
<div class="col-6 col-lg-3">
<div class="panel alert p-4">
<h5><?php $LANGMNG->echo('log'); ?></h5>
<?php echo $LOGSTATS['INFO'];?>
</div>
</div>
</div>
<label><?php echo $LANGMNG->get('l_logMaxLiveTime') . " " . $LOGTOLIVETIME . " days";?></label></br>
<form method="post" action="">
<div class="field">
<select class="input" name="LogFile">
<?php foreach ($LOGSFILES as $key => $value) { ?>
<optgroup label="<?php echo str_replace("../", "", $key); ?>">
<?php foreach ($value as $valueSub) { ?>
<option value="<?php echo $key . $valueSub; ?>"><?php echo $valueSub; ?></option>
<?php } ?>
</optgroup>
<?php } ?>
</select>
</div>
<div class="field">
<input type="submit" class="button" name="selectFile" value="<?php $LANGMNG->echo('b_select');?>"/>
</div>
</form>
<?php
if (isset($_POST['LogFile'])) {
$file_lines = file($_POST['LogFile']);
echo '<pre style="overflow: auto;">';
foreach ($file_lines as $line) {
echo $line;
}
echo '</pre>';
}
?>
</div>
</div>
<?php
$partial = new Partial('footer');
$partial->prepare('baseDir', BASEDIR);
$partial->render();
//TODO js do main.js
?>
</body>
</html>