-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobserver.php
More file actions
62 lines (52 loc) · 1.71 KB
/
observer.php
File metadata and controls
62 lines (52 loc) · 1.71 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
<?php
// Require the configuration before any PHP code as the configuration controls error reporting
require('./pw99-config.php');
// A settings page requires form functions
require_once('./includes/form_functions.inc.php');
// Include the header file
$active_obsvwrits = '';
$active_observees = '';
$active_binder = '';
$active_locker = '';
$active_admin = '';
$active_editor = '';
$active_observer = 'activedash';
$active_dash = '';
$page_title = "Observatory :: $siteTitle";
include('./includes/header.html');
// Logged in or not?
if (isset($_SESSION['user_id'])) {
$userid = $_SESSION['user_id'];
$q = "SELECT name, type, email FROM users WHERE id='$userid'";
$r = mysqli_query ($dbc, $q);
$row = mysqli_fetch_array($r, MYSQLI_NUM);
$u_name = "$row[0]";
$u_type = "$row[1]";
$u_email = "$row[2]";
// Proper user types
if ( ($_SESSION['user_is_editor'] != true) && ($_SESSION['user_is_supervisor'] != true) && ($_SESSION['user_is_admin'] != true) && ($_SESSION['user_is_observer'] != true) ) {
header("Location: " . PW99_HOME);
exit(); // Quit the script
} elseif ($_SESSION['user_is_admin'] == true) {
$usr_type = "Admin";
} elseif ($_SESSION['user_is_supervisor'] == true) {
$usr_type = "Supervisor";
} elseif ($_SESSION['user_is_editor'] == true) {
$usr_type = "Editor";
} elseif ($_SESSION['user_is_observer'] == true) {
$usr_type = "Observer";
}
} else {
header("Location: " . PW99_HOME);
exit(); // Quit the script
}
// Dashboard
$dashgreeting = "Observer Dash for $u_name";
include('./inserts/dash_observer.ins.php');
// Observees tables
$term_status = 'current';
$where_am_i = "observer.php";
include('inserts/list_observees.ins.php');
// Include the HTML footer
include('./includes/footer.html');
?>