-
Notifications
You must be signed in to change notification settings - Fork 0
/
friends.php
69 lines (63 loc) · 2.4 KB
/
friends.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php require_once dirname(__FILE__).'/include/header.php'; ?>
<?php require_once dirname(__FILE__).'/include/api.php'; ?>
<?php require_once dirname(__FILE__).'/include/navbar.php'; ?>
<?php
if (isset($_GET['u']))
{
$username = $_GET['u'];
}
else
{
$username = $_SESSION['username'];
}
$api = new Api;
$reponseFriends = $api->getFriends($username);
if (!$reponseFriends->error)
{
$friends = $reponseFriends->friends;
$friendsCard = array();
foreach($friends as $friendList)
{
$friendHtml = <<<HERE
<div class="col l4 m6 s12">
<a href="$friendList->username"><ul class="collection">
<li class="collection-item avatar" style="padding-left: 90px;">
<img src="$friendList->image" alt="" width="" class="circle" style="width: 60px; height: 60px;">
<p class="title black-text" style="margin-top:6px;"><b>$friendList->name</b></p>
<p>@$friendList->username</p>
<a href="#!" class="secondary-content"><i class="material-icons">more_vert</i></a>
</li></ul></a></div>
HERE;;
array_push($friendsCard, $friendHtml);
}
}
else
{
}
?>
<div class="socialcodia">
<div class="row">
<!-- *********************************Main Row offset 1 on both side, total row size is 10**************************************** -->
<div class="col l12 m12 s12" style="padding:0px">
<!-- ***************************Left Side Row************************* -->
<div class="col s12 l12 m12">
<h5>Your Friends</h5>
<?php
if (!$reponseFriends->error)
{
foreach($friendsCard as $friends)
{
echo $friends;
}
}
else
{
echo '<h5 align="center">No Friends</h5>';
}
?>
</div>
</div>
</div>
</div>
<?php require_once dirname(__FILE__).'/include/sidenav.php'; ?>
<?php require_once dirname(__FILE__).'/include/footer.php'; ?>