$log->logError($e . " - " . basename(__FILE__)); } echo "<div class=\"page-header\"><h1>" . _("Access Logs") . "</h1></div>"; echo "<h6>" . _("Options") . " : <a href=\"{$website}/" . ADMIN_DIRECTORY . "/settings#/misc\">" . _("Access Settings") . "</a></h6><br/>"; echo "<ul class=\"breadcrumb\">\n\t\t<li><a href=\"{$website}/" . ADMIN_DIRECTORY . "/settings\">" . _("Home") . "</a> <span class=\"divider\">/</span></li>\n\t\t<li class=\"active\">" . _("Access Logs") . "</li>\n\t\t</ul>"; if (!empty($number)) { /* initializing the ip2country class for converting ip address to country. */ $ip2country = new ip2country($db); $p = new pagination(); $p->items($number); $p->limit($max_show); $p->currentPage($page); $p->parameterName("p"); $p->urlFriendly(); $p->target("{$website}/" . ADMIN_DIRECTORY . "/access/%"); $from2 = $page * $max_show; if ($from2 > $number) { $diff = $number % $max_show; $from2 = $number; $from1 = $from2 - $diff; } else { $from1 = $from2 - $max_show; } echo "<table class=\"table table-condensed\">"; echo "<thead><tr>\n\t\t\t<th>" . _("ID") . "</th>\n\t\t\t<th>" . _("IP Address") . "</th>\n\t\t\t<th>" . _("Username") . "</th>\n\t\t\t<th>" . _("Country") . "</th>\n\t\t\t<th>" . _("Access") . "</th>\n\t\t\t</tr></thead>"; /* loading all the tags data in arrays. */ while ($row = $q_do->fetch(PDO::FETCH_ASSOC)) {
function create_paginator($currentpage, $nb_items, $path) { require_once ROOT_DIR . '/' . INC_DIR . '/paginator-digg/pagination.php'; $p = new pagination(); $p->items($nb_items); $p->currentPage($currentpage); $p->limit(1); $p->urlFriendly(); $p->target(URL . "/{$path}/page/%"); if ("" === $path) { $p->target(URL . "/page/%"); } $p->adjacents(1); if (!$p->calculate) { if ($p->calculate()) { return "<div class=\"{$p->className}\">{$p->pagination}</div>"; } } }