-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
96 lines (95 loc) · 2.95 KB
/
header.php
File metadata and controls
96 lines (95 loc) · 2.95 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
if(!isset($_SESSION)) {
session_start();
}
require_once 'database.php';
$isLog = !empty($_SESSION["uid"]);
if ($isLog) {
$db = new Database();
$stmt = $db->prepare("SELECT realname FROM users WHERE userID = :uid");
$stmt->bindValue(":uid", $_SESSION["uid"], SQLITE3_INTEGER);
$result = $stmt->execute();
$temp = $result->fetchArray();
$name = $temp["realname"];
}
?>
<!DOCTYPE html>
<html class="no-js" lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cooperative Billing Initiative</title>
<link rel="icon" href="images/logo200.png">
<link rel="stylesheet" href="css/foundation.css">
<link rel="stylesheet" href="css/app.css">
<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/push.min.js"></script>
<script src="js/qrcode.min.js"></script>
</head>
<body>
<div class="large-12 columns row">
<div class="top-bar">
<div class="top-bar-left">
<ul class="dropdown menu" data-dropdown-menu>
<li class="menu-text">
<a href="index.php">
<img src="images/logo.svg" alt="rip off logo" style="height:50px"/>
Cooperatvie Billing Initiative</a></li>
<?php if (!$isLog) echo '<li><a href="login.php#login">Login/Register</a></li>';?>
<li>
<a href="bills.php">Bills</a>
<ul class="menu vertical">
<li><a href="newBill.php">New Bill</a></li>
</ul>
</li>
<li>
<a href="groups.php">Groups</a>
<ul class="menu vertical">
<li><a href="newGroup.php">New Group</a></li>
</ul>
</li>
</ul>
</div>
<?php if ($isLog) echo '
<input type="hidden" id="seshUser" value="'.$_SESSION["uid"].'" />
<script>
$(function() {
var id = $("#seshUser").attr("value");
var firstRound = true;
function checkNoti() {
$.post("getNotifications.php", {uid: id}, function(data, status) {
if($("#notinumber").html() != data) {
if ($("#notinumber").html() < data) {
Push.create("Cooperative Billing Initiative", {
body: "You have " + data + " notification(s).",
timeout: 3000,
icon: "images/logo32.png",
onClick: function() {
window.focus();
window.location.replace("notifications.php");
this.close();
}
});
}
$("#notinumber").html(data);
firstRound = false;
}
});
}
checkNoti();
setInterval(checkNoti, 2000);
});
</script>
<div class="top-bar-right">
<ul class="menu">
<li><a href="notifications.php">Notifications (<span id="notinumber">0</span>)</a></li>
<li><a href="profile.php?uid='.$_SESSION["uid"].'">'.$name.'</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</div>';?>
</div>
</div>
<div class="row">
<div class="columns large-12">