-
Notifications
You must be signed in to change notification settings - Fork 0
/
notifications.php
57 lines (50 loc) · 2.21 KB
/
notifications.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
<?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
$api = new Api;
$responseNotifications = $api->getNotifications();
if (!$responseNotifications->error)
{
// print_r($responseNotifications);
$notifications = $responseNotifications->notifications;
$userArray = array();
foreach ($notifications as $notification)
{
$card = <<<HERE
<div class="col l6 m6 s12" id="divNotification$notification->notificationId">
<ul class="collection">
<li class="collection-item avatar" style="padding-left: 90px;">
<a href="#">
<img src="$notification->userImage" alt="" width="" class="circle" style="width: 60px; height: 60px;">
<div style="margin-top: 9px;">
<span class="title">$notification->userName</span>
<p>$notification->notificationText</p>
</div>
</a>
<div style="margin-top: 14px;" class="secondary-content right">
<button id="btnDeleteNotification$notification->notificationId" onclick="alertDeleteNotification(this.value)" value="$notification->notificationId" class="red btn" style="border: 1px solid white; border-radius: 90%;"><i class="material-icons white-text">delete</i></button>
</div>
</li>
</ul>
</div>
HERE;
array_push($userArray, $card);
}
}
?>
<div class="socialcodia">
<div class="row" style="margin-top: 20px;">
<?php
if (!$responseNotifications->error)
{
foreach ($userArray as $users)
{
echo $users;
}
}
?>
</div>
</div>
<?php require_once dirname(__FILE__).'/include/sidenav.php'; ?>
<?php require_once dirname(__FILE__).'/include/footer.php'; ?>