-
Notifications
You must be signed in to change notification settings - Fork 4
/
notifications.php
74 lines (53 loc) · 2.14 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
<?php
ob_start();
session_start();
$title = "Notifications";
include "init.php";
if(isset($_SESSION["id"])){
$userID = isset($_GET['userID']) && is_numeric($_GET['userID']) ? intval($_GET['userID']):0 ;
if($_SESSION["id"] == $userID ){
$stmt = $conn->prepare("SELECT * FROM notification WHERE userID = ?");
$stmt->execute(array($userID));
$notif = $stmt->fetchAll();
$count = $stmt->rowCount();
if($count > 0){ ?>
<div class="w3-container w3-content" style="min-height: -webkit-fill-available;">
<h5 class="w3-margin"><?php echo lang("RECENT-NOTIF") ?></h5>
<ul class="w3-ul w3-hoverable w3-margin w3-padding w3-card-4 w3-white">
<?php foreach ($notif as $notification){ ?>
<a class="" href="<?php echo $func .'updateSeen.php?notifID=' . $notification["notifID"] . '&link=' . $notification["url"] ?>">
<li class="w3-padding-16">
<i class="fa fa-fw fa-<?php echo $notification["type_notif"] ?>"></i>
<span class="w3-large">
<?php if($language == "fr") echo $notification["fr_content"]; else echo $notification["en_content"];
?>
</span><br>
<span class="w3-right w3-text-grey w3-small"><?php echo proDate($notification["notif_date"]) ?></span>
</li>
</a>
<?php } ?>
</ul>
</div>
<?php
}
else{ ?>
<div class="w3-container" style="min-height: -webkit-fill-available;">
<div class='alert-msg w3-center w3-margin-left w3-margin-right' style='margin-top:40px'><?php echo lang("NO-NOTIF") ?>
</div>
</div>
<?php } ?>
<?php
}
else{
header("location:main.php");
exit();
}
}
else
{
header("location:login.php");
exit();
}
include $tmp . "footer.php";
ob_end_flush();
?>