-
Notifications
You must be signed in to change notification settings - Fork 0
/
notifications.php
78 lines (68 loc) · 2.6 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
session_start();
if (!isset($_SESSION['user_id'])) {
header("Location: http://localhost/friendalize/signin");
exit();
} else {
require_once('includes/essentials.php');
require_once('includes/functions.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include("includes/head.php"); ?>
<title>Notifications | Friendalize</title>
<script type="text/javascript">
function myFunction() {
$.ajax({
url: "includes/notifications-p.php",
type: "POST",
processData: false,
success: function (data) {
$("#notification-count").remove();
$("#notification-latest").show();
$("#notification-latest").html(data);
},
error: function () {}
});
}
$(document).ready(function () {
$('body').click(function (e) {
if (e.target.id != 'notification-icon') {
$("#notification-latest").hide();
}
});
});
</script>
</head>
<body>
<div class="container-fluid">
<?php include("includes/navbar.php"); ?>
<div class="row cols">
<?php include("includes/nav-desktop.php"); ?>
<?php include("includes/nav-mobile.php"); ?>
<div class="col-sm-10 content">
<h1>Notifications</h1>
<div id="notification-header">
<div style="position:relative">
<button id="notification-icon" name="button" class='btn btn-default' onclick="myFunction()"><span id="notification-count"><?php
if ($notifications_count > 0) {
echo $notifications_count;
}
?><i class="fa fa-bell fa-fw" aria-hidden="true"></i> Click to see All notifications!!</span></button>
<div id="notification-latest"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="scripts/viewport-resize.js"></script>
<script>
$(document).ready(function () {
$('.navbar-right li:nth-child(2)').addClass("navbar-active");
});
</script>
</body>
</html>