<?php
  
ECHO "<div class='navigation'>";
ECHO "<a href='/'>".ICONS('home', 25, 'fa-fw')."</a>";
ECHO "".ICONS('angle-right', 22, 'fa-fw')."";
ECHO "<a href='/id".$account['ID']."'>".TEXT_ABSOLUTE($account['LOGIN'])."</a>";
ECHO "".ICONS('angle-right', 22, 'fa-fw')."";
ECHO "".LG('Подписчики')."";
ECHO "</div>";

ECHO "<div class='tmenu_body'>";

ECHO "<a href='/users/profile/?path=subscribers&id=".$account['ID']."' class='tmenu-50 tmenu-50-o'>".LG('Подписчики')."</a>";
ECHO "<a href='/users/profile/?path=subscribers&id=".$account['ID']."&section=subscriptions' class='tmenu-50'>".LG('Подписки')."</a>";

ECHO "</div>";

$column = DB::GET_COLUMN("SELECT COUNT(`ID`) FROM `SUBSCRIBERS` WHERE `USER_ID` = '".$account['ID']."'");
$spage = SPAGE($column, $page_settings);
$page = PAGE($spage);
$limit = $page_settings * $page - $page_settings;

IF ($column == 0){
  
  HTML::EMPTY();
  
}ELSE{
  
  ECHO "<div class='list-body'>";
  
}

$data = DB::GET_STRING_ALL("SELECT * FROM `SUBSCRIBERS` WHERE `USER_ID` = '".$account['ID']."' ORDER BY `ID` DESC LIMIT ".$limit.", ".$page_settings."");

WHILE ($list = $data->FETCH()){
  
  ECHO "<div class='list-menu'>";
  
  ECHO "<a href='/id".$list['MY_ID']."'><table style='width: 100%;'><tr>";
  
  ECHO "<td class='us-avatar'>";
  ECHO USER::AVATAR($list['MY_ID'], 50, 0, 1)."";
  ECHO "</td>";
  
  ECHO "<td class='us-info'>";
  ECHO "".USER::LOGIN($list['MY_ID'])."";
  ECHO "</td>";
  
  ECHO "</tr></table></a>";
  
  IF ($user['ID'] == $account['ID']){
    
    ECHO "<div id='subscribers".$list['ID']."'>";
    
    ECHO "<br />";
    
    REQUIRE (ROOT.'/users/profile/subscribers/plugins/inc.php');
    
    IF (DB::GET_COLUMN("SELECT COUNT(`ID`) FROM `SUBSCRIBERS` WHERE `USER_ID` = '".$account['ID']."' AND `MY_ID` = '".$list['MY_ID']."'")){
      
      ?><a class="btn" onclick="request('subscribers<?=$list['ID']?>', '/users/profile/?path=subscribers&id=<?=$account['ID']?>&id_subscribe=<?=$list['MY_ID']?>&id_list=<?=$list['ID']?>&get=subscribe_delete2', '#subscribers<?=$list['ID']?>')" load="none"><?=ICONS('times', 15, 'fa-fw')?> <?=LG('Удалить')?></a><?
      
    }ELSE{
      
      ECHO "<font color='green'>".ICONS('check', 15, 'fa-fw')." ".LG('Пользователь удален из подписчиков')."</font>";
    
    }
    
    ECHO "</div>";
    
  }
  
  ECHO "</div>";
  
}

IF ($column > 0){
  
  ECHO "</div>";
  
}

IF ($spage > 1){ ECHO STR_PAGE('/users/profile/?path=subscribers&id='.$account['ID'].'&', $spage, $page); }

ECHO "<div class='navigation'>";
ECHO "<a href='/'>".ICONS('home', 25, 'fa-fw')."</a>";
ECHO "".ICONS('angle-right', 22, 'fa-fw')."";
ECHO "<a href='/id".$account['ID']."'>".TEXT_ABSOLUTE($account['LOGIN'])."</a>";
ECHO "".ICONS('angle-right', 22, 'fa-fw')."";
ECHO "".LG('Подписчики')."";
ECHO "</div>";
  
?>