<?php
  
ECHO "<div class='navi'>";
ECHO "<a href='?'>".ICONS('home', 25)."</a>";
ECHO "".ICONS('angle-right', 22, 'fa-fw')."";
ECHO "<a href='?path=site'>".LG('Настройки сайта')."</a> ";
ECHO "".ICONS('angle-right', 22, 'fa-fw')."";
ECHO "".LG('Логи администрации')."";
ECHO "</div>";

$column = DB::GET_COLUMN("SELECT COUNT(*) FROM `PANEL_LOGS`");
$spage = SPAGE($column, $page_settings);
$page = PAGE($spage);
$limit = $page_settings * $page - $page_settings;

ECHO "<div class='list-body'>";

IF ($column == 0){ 
  
  HTML::EMPTY();
  
}

$data = DB::GET_STRING_ALL("SELECT * FROM `PANEL_LOGS` ORDER BY `TIME` DESC LIMIT ".$limit.", ".$page_settings."");
WHILE ($list = $data->FETCH())
{
  
  ECHO "<div class='list-menu'>";

  ECHO "".TEXT_ABSOLUTE($list['NAME'])."<br />";
  ECHO "<small><b>".STIME($list['TIME'])."</b></small><br /><br />";
  
  $us = DB::GET_STRING("SELECT `ID`,`LOGIN` FROM `USERS` WHERE `ID` = '".$list['USER_ID']."' LIMIT 1");
  
  ECHO "".LG('Действие совершил:')." <a href='/id".$us['ID']."' load='none'>".$us['LOGIN']."</a>";
  
  ECHO "</div>";

}

ECHO "</div>";

IF ($spage > 1){ ECHO "<div class='list-body'>"; ECHO STR_PAGE('/panel/?path=site&section=logs&', $spage, $page); ECHO "</div>"; }

?>