<?php 

$profile_uid=$uid;
// Take the following list
$followerarray=$Mat->Chat_Friends_List($profile_uid);
if($followerarray) {
   $last_letter = "";
   // For each array following list
   foreach($followerarray as $data) {
       $list_username=$data['username'];
       $friend_uid=$data['uid'];
	   $check_verif=$data['verified'];
	   $loggedTime=time()-120;	//2 minutes
       $loginTime=$data['last_login'];
       if($loginTime>$loggedTime) {
	      $online='#1de9b6';
       } else {
	     $online='#9e9e9e';
       }
	   // Following user profile imge check
       $userface=$Mat->User_Lister($friend_uid,$base_url);
	   // Following user full name
       $userfullname = $Mat->UserFullName($list_username);
       $letter = mb_strtoupper(mb_substr($userfullname,0,1 , "UTF-8"), "UTF-8");
       if($letter != $last_letter) {
		   // alphabetically the knee
		  echo '<div class="list-alphabet">'.$letter.'</div>';
          $last_letter = $letter;
        }
?>
<div class="follower-md">
<a href="<?php echo $base_url.'messages/'.$list_username;?>">
<div class="follower md-ripple" data-wow-offset="300">
  <div class="follower-img"><img src="<?php echo $userface;?>" border="0"><div class="user_status" style="background-color:<?php echo $online;?>"></div></div>
  <div class="follower-name"><?php echo htmlspecialchars($userfullname); ?><?php if($check_verif == 1){ echo '<img src="'.$base_url.'mat_icons/verified.png" width="23px" height="23px">';}?></div>
</div>
</a>
</div>
<?php 
}
}
?>