-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoasts.php
More file actions
59 lines (55 loc) · 1.8 KB
/
toasts.php
File metadata and controls
59 lines (55 loc) · 1.8 KB
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
<?php
require 'includes/header.php';
$id=0;
if(isset($_GET['id']) and isset($_GET['type'])) {
$id = $_GET['id'];
$type = $_GET['type'];
}else{
header("Location:index.php");
exit; //in case redirection failed
}
?>
<title><?php echo $user->getFullName()." - Polygon"?></title>
<!-- <link rel="stylesheet" type="text/css" href="assets/css/main.css"/> -->
<link rel="stylesheet" type="text/css" href="assets/css/index.css"/>
<main>
<div class='userProfileCard'>
<div class="user_details column">
<a href="profile.php?user=<?php echo $user->getUsername()?>">
<img class="user_profile_pic_main" src="<?php echo $user->getProfilePic()?>">
</a>
<span class="name_field">
<a href="profile.php?user=<?php echo $user->getUsername()?>"><?php echo $user->getFullName()?></a>
</span>
<div class='profile_user_data'>
<span class='data_username'>(@<?php echo $user->getUsername()?>)</span>
<div class="other_details">
<i class="fa fa-users"></i> <?php echo $user->getNumFriends()?>
<i class="fa fa-edit"></i> <?php echo $user->getNumPosts()?>
<i class="fa fa-heart"></i> <?php echo $user->getNumLikes()?>
</div>
<div id='friendBtnContainer'>
<button class='redButton' style="color:#908b8b"><i class="fa fa-share-square"></i> Sign Out</button>
</div>
</div>
</div></div>
<div class='column newsfeed'>
<?php
$toast_obj = new Toast($pdo, $user);
if ($toast_obj->toastExists($id)){
$toast_obj->getSingleToast($id);
$notif_obj = new Notification($pdo, $user);
$notif_obj->openNotification($type,$id,$user->getUsername());
}else{
echo "<div style='text-align: center;'>Sorry but it seems the toast doesn't exist</div>";
}
?>
</div>
<hr/>
</main>
<script>
$('button.redButton').on('click',function(){
window.location='includes/functions/logout.php'
})
</script>
</body></html>