-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview.php
73 lines (56 loc) · 2.01 KB
/
view.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
<?php include "session.php";
$id = $_GET['id'];
$query = "UPDATE `notifications` SET `status` = 'read' WHERE `id` = $id;";
//Perform the prepared query
try {
$stmt = $conn->prepare($query);
$stmt->execute();
//Row count will tell us the number of rows affected by the query
$rowCount = $stmt->rowCount();
} catch (PDOException $e) {
throw $e;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include "meta.php" ?>
<title>
Notifications || Unibooks
</title>
<!-- Fonts and icons -->
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900|Roboto+Slab:400,700" />
<!-- Nucleo Icons -->
<link href="assets/css/nucleo-icons.css" rel="stylesheet" />
<link href="assets/css/nucleo-svg.css" rel="stylesheet" />
<!-- Font Awesome Icons -->
<script src="https://kit.fontawesome.com/e9de02addb.js" crossorigin="anonymous"></script>
<!-- Material Icons -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons+Round" rel="stylesheet">
<!-- CSS Files -->
<link id="pagestyle" href="assets/css/material-dashboard.css?v=3.0.4" rel="stylesheet">
<link id="pagestyle" href="assets/css/profile.css" rel="stylesheet">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9952650109664010" crossorigin="anonymous"></script>
</head>
<body>
<div class="container">
<div class="card not text-center">
<div class="card-body">
<?php
$query = $conn->prepare("SELECT * from `notifications` where `id` = ? AND `type` = 'comment'");
$query->execute(array($id));
$result = $query->fetch();
if ($result > 0) {
// foreach ($result as $i) {
// print_r($result);
echo '<p class="pt-2 ">' . $result['message'] . '</p>';
// }
}
?>
<a href="notifications">Back<i class="material-icons opacity-10">arrow</i></a>
</div>
</div>
</div>
<?php include "footer.php" ?>
</body>
</html>