This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

How to export / print alerts
#1
How to export or print all alerts given in the alerts tab?
Reply
#2
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>
Reply


Forum Jump: