mirror of
https://github.com/PurpleI2P/regi2p.git
synced 2025-02-11 15:54:13 +00:00
18 lines
572 B
PHP
18 lines
572 B
PHP
<?php
|
|
|
|
require_once __DIR__ . '/../lib/twig.php';
|
|
|
|
$all = false;
|
|
|
|
$pdo = (new App\DB($options))->pdo;
|
|
|
|
if (isset($_GET["all"]))
|
|
$all = true;
|
|
|
|
/* Get records with limit */
|
|
$STH = $pdo->query ("SELECT `host`, `base64`, `base32`, `add_date`, `last_seen` FROM `hosts` WHERE `disabled` = 0" . ($all ? "" : " AND `blacklisted` = 0") . " ORDER BY `add_date` DESC LIMIT " . $options["tableitems"]);
|
|
$rows = $STH->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
$template = $twig->load('latest.twig');
|
|
echo $template->render(['limit' => $options["tableitems"], 'hosts' => $rows, 'all' => $all]);
|