$todisplay2 = 'false';
    $todisplay3 = 'false';
    if ($i < sizeof($myfriends)) {
        $todisplay1 = 'true';
        $imgpath1 = Profile::findBySql('select profile_picture from profile where user_name ="' . $myfriends[$i]->customer_user_name2 . '"')->one();
        $name1 = CustomerSocialLogin::findBySql('select customer_first_name, customer_last_name from customer where customer_user_name ="' . $myfriends[$i]->customer_user_name2 . '"')->one();
    }
    if ($i + 1 < sizeof($myfriends)) {
        $todisplay2 = 'true';
        $imgpath2 = Profile::findBySql('select profile_picture from profile where user_name ="' . $myfriends[$i + 1]->customer_user_name2 . '"')->one();
        $name2 = CustomerSocialLogin::findBySql('select customer_first_name, customer_last_name from customer where customer_user_name ="' . $myfriends[$i + 1]->customer_user_name2 . '"')->one();
    }
    if ($i + 2 < sizeof($myfriends)) {
        $todisplay3 = 'true';
        $imgpath3 = Profile::findBySql('select profile_picture from profile where user_name ="' . $myfriends[$i + 2]->customer_user_name2 . '"')->one();
        $name3 = CustomerSocialLogin::findBySql('select customer_first_name, customer_last_name from customer where customer_user_name ="' . $myfriends[$i + 2]->customer_user_name2 . '"')->one();
    }
    ?>
			
			<div class="row row-list">
			<?php 
    if ($todisplay1 == 'true') {
        ?>
			<div class="col-xs-3">
			<?php 
        echo Html::img($imgpath1->profile_picture, ['width' => 100, 'height' => 100]);
        echo "<br/>";
        ?>
			<a href="index.php?r=site/viewprofile&username=<?php 
        echo $myfriends[$i]->customer_user_name2;
        ?>
 public function getCustomerInfo($username)
 {
     $name = CustomerSocialLogin::findBySql('select customer_first_name, customer_last_name from customer where customer_user_name ="' . $username . '"')->one();
     return $name;
 }