__DIR__ . '/../cache', 'auto_reload' => true, ]); $offset = $options["tableitems"] * ($page - 1); $pdo = (new App\DB($options))->pdo; /* Get records amount */ $STH = $pdo->query ("SELECT COUNT(*) FROM `hosts` " . "WHERE `approved` = 1 AND `blacklisted` = 1"); $records = $STH->fetchColumn(); $pages = intdiv($records, $options["tableitems"]) + 1; /* Get records with limit */ $STH = $pdo->query ("SELECT `host`, `base64`, `base32`, `last_seen` FROM `hosts` " . "WHERE `approved` = 1 AND `blacklisted` = 1 " . "LIMIT " . $offset . ", " . $options["tableitems"]); $rows = $STH->fetchAll(PDO::FETCH_ASSOC); $template = $twig->load('hidden.twig'); echo $template->render(['current' => $page, 'total' => $pages, 'hosts' => $rows, 'all' => $all]);