14.11.2019, 09:47
Via .lp file:
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Alerts</title>
<link rel="stylesheet" href="/apps/css/bootstrap.css">
</head>
<body>
<table class="table">
<tr>
<th>Date/time</th>
<th>Script name</th>
<th>Message</th>
</tr>
<?
require('apps')
items = db:getall('SELECT * FROM alerts ORDER BY id DESC')
for _, item in ipairs(items) do
datetime = os.date('%c', item.alerttime)
?>
<tr>
<td><?=escape(datetime)?></td>
<td><?=escape(item.scriptname)?></td>
<td><?=escape(item.alert)?></td>
<td></td>
</tr>
<? end ?>
</table>
</body>
</html>