/
index.php
156 lines (89 loc) · 3.53 KB
/
index.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?php include 'session.php'; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php
include 'connection.php';
include 'functions.php';
include 'header.php';
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);
include 'checkloggedin.php';
?>
</head>
<body>
<div class="bg">
<?php
include 'navback.php';
?>
<div class="container">
<div class="row indexborder">
<h4 class="col-12">Notifications</h4>
<?php
include 'checknotifications.php';
if(sizeof($notifications) > 0) {
for($x=0; $x<sizeof($notifications); $x++){
// loop through all notifications
echo '<div class="topBottom click alert alert-'.$notiLevel[$x].' col-12" role="alert">';
echo $notifications[$x];
echo '</div>';
}
} else {
//no notifications
echo '<div class="topBottom alert alert-success col-12" role="alert">';
echo 'No Notifications';
echo '</div>';
}
?>
</div>
<!-- display the current TOTY league table -->
<div class="row indexborder">
<h4 class="col-12">Current TOTY Table</h4>
<div class="col-12 topBottom">
<?php include 'leaguetable.php'; ?>
</div>
</div>
<?php
if(canCheck($_SESSION['userData']['employee'])) {
?>
<div class="row indexborder">
<h4 class="col-12">Main Menu</h4>
<div class="topBottom col-12">
<a href="record.php" class="btn btn-light btn-block btn-lg" role="button">Record</a>
</div>
<div class="topBottom col-12">
<a href="reports.php" class="btn btn-light btn-block btn-lg" role="button">Reports</a>
</div>
<?php
}
?>
<div class="topBottom col-12">
<a href="duty.php" class="btn btn-light btn-block btn-lg" role="button">Duty</a>
</div>
<?php
?>
<div class="topBottom col-12">
<a href="admin.php" class="btn btn-light btn-block btn-lg" role="button">Admin</a>
</div>
</div>
<?php
include 'footer.php';
?>
<script type="text/javascript">
$("form").submit(function(e) {
var error = "";
if ($("#search").val() == "") {
error += "Please enter a name or employee number to search.<br>"
}
if (error != "") {
$("#error").html('<div class="alert alert-danger" role="alert">' + error + '</div>');
return false;
} else {
return true;
}
})
</script>
</div>
</body>
</html>