} 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"]]; } $tbody[] = explode(OPEN_SEPARATOR, $row); } // end for $logQ->freeResult(); $logQ->close(); unset($logQ); unset($log); echo HTML::rule(); echo HTML::table($thead, $tbody, null, $options); require_once "../layout/footer.php";
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); unset($profiles); echo HTML::para(HTML::link(_("Return to users list"), $returnLocation)); require_once "../layout/footer.php";