$logQ->close(); echo Msg::info(_("No logs in this date.")); include_once "../layout/footer.php"; exit; } $thead = array(_("#"), _("Access Date"), _("Login")); if ($table == 'record') { $thead[] = _("Table"); $thead[] = _("Operation"); $thead[] = _("Data"); } else { $thead[] = _("Profile"); } $options = array('align' => 'center', 0 => array('align' => 'right')); $tbody = array(); for ($i = 1; $log = $logQ->fetch(); $i++) { $row = $i . '.'; $row .= OPEN_SEPARATOR; $row .= I18n::localDate($log["access_date"]); $row .= OPEN_SEPARATOR; $row .= $log["login"]; $row .= OPEN_SEPARATOR; if ($table == 'record') { $row .= $log["table_name"]; $row .= OPEN_SEPARATOR; $row .= $log["operation"]; $row .= OPEN_SEPARATOR; $row .= htmlspecialchars(var_export(unserialize($log["affected_row"]), true)); } else { $row .= $profiles[$log["id_profile"]]; }
$links = array(_("Admin") => "../admin/index.php", _("Users") => $returnLocation, $title => ""); echo HTML::breadcrumb($links, "icon icon_user"); unset($links); echo HTML::section(2, sprintf(_("Access Logs List for user %s"), $login) . ":"); // Printing result stats and page nav echo HTML::para(HTML::tag('strong', sprintf(_("%d accesses."), $accessQ->getRowCount()))); $params = array('id_user='******'login='******'&', $params); $pageCount = $accessQ->getPageCount(); $pageLinks = Search::pageLinks($currentPage, $pageCount, $_SERVER['PHP_SELF'] . '?' . $params); echo $pageLinks; $profiles = array(OPEN_PROFILE_ADMINISTRATOR => _("Administrator"), OPEN_PROFILE_ADMINISTRATIVE => _("Administrative"), OPEN_PROFILE_DOCTOR => _("Doctor")); $thead = array(_("Access Date") => array('colspan' => 2), _("Login"), _("Profile")); $options = array(0 => array('align' => 'right'), 2 => array('align' => 'center'), 3 => array('align' => 'center')); $tbody = array(); while ($access = $accessQ->fetch()) { $row = $accessQ->getCurrentRow() . "."; $row .= OPEN_SEPARATOR; $row .= I18n::localDate($access["access_date"]); $row .= OPEN_SEPARATOR; $row .= $access["login"]; $row .= OPEN_SEPARATOR; $row .= $profiles[$access["id_profile"]]; $tbody[] = explode(OPEN_SEPARATOR, $row); } $accessQ->freeResult(); $accessQ->close(); echo HTML::table($thead, $tbody, null, $options); echo $pageLinks; unset($accessQ); unset($access);