forked from nisiya/MaristIDCP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
118 lines (118 loc) · 5.48 KB
/
header.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
<!DOCTYPE html>
<html lang="en">
<?php
ob_start();
session_start();
$user_id = $_SESSION['user_id'];
$user_role = $_SESSION['user_role'];
$order = "";
if(!isset($user_id)){
$page = 'index.php';
header("Location: $page");
exit();
}
//Taken from GraphicNarrative
function checkForIdleSession() {
$time = $_SERVER['REQUEST_TIME'];
/**
* for a 30 minute timeout, specified in seconds
*/
$timeout_duration = 1800;
// $timeout_duration = 5;
/**
* if last activity longer than timeout, reset session
*/
if (isset($_SESSION['LAST_ACTIVITY']) && ($time - $_SESSION['LAST_ACTIVITY']) > $timeout_duration) {
session_unset();
session_destroy();
session_start();
}
$_SESSION['LAST_ACTIVITY'] = $time;
}
checkForIdleSession();
?>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, shrink-to-fit=no, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title><?php echo $title ?></title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/sb-admin.css" rel="stylesheet">
<link href="css/banner.css" rel="stylesheet">
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="css/to-top.css" rel="stylesheet">
<link rel="shortcut icon" href="https://my.marist.edu/myMarist62-theme/images/favicon.ico"/>
</head>
<body>
<img src='placeholder.png' style="visibility: hidden;" id="banner">
<!--Navigation Bars-->
<div id="wrapper">
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<img src="IDCPlogo.PNG" id="banner">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="home.php">Home</a>
</div>
<!-- Top Menu Items -->
<ul class="nav navbar-right top-nav">
<li <?php if ($page == 'help') echo 'style="background-color: black"'; ?>>
<a href="help_page.php<?php if (isset($page_name)) echo "#$page_name";?>"><i class="glyphicon glyphicon-question-sign"></i> Help</a>
</li>
<li class="dropdown" <?php if ($page == 'user_settings' || $page == 'idcp_settings' || $page == 'report_bug') echo 'style="background-color: black"'; ?>>
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i>
<?php
echo $user_id;
?>
<b class="caret"></b></a>
<ul class="dropdown-menu">
<li <?php if ($page == 'user_settings') echo 'class="active"'?>>
<a href="user_settings.php"><i class="fa fa-fw fa-user"></i> User Settings</a>
</li>
<li <?php if ($page == 'idcp_settings') echo 'class="active"'?>>
<a href="idcp_settings.php"><i class="fa fa-fw fa-gear"></i> IDCP Settings</a>
</li>
<li class="divider"></li>
<li <?php if ($page == 'report_bug') echo 'class="active"'?>>
<a href="report_bug.php"><i class="fa fa-fw fa-wrench"></i> Report a Bug</a>
</li>
<li class="divider"></li>
<li>
<a href="user_logout.php"><i class="fa fa-fw fa-power-off"></i> Log Out</a>
</li>
</ul>
</li>
</ul>
<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav" style="margin-top:7%;">
<li <?php if ($page == 'student') echo 'class="active"'?>>
<a href="student.php">Students</a>
</li>
<li <?php if ($page == 'program') echo 'class="active"'?>>
<a href="program.php">Programs</a>
</li>
<li <?php if ($page == 'course') echo 'class="active"'?>>
<a href="course.php">Courses</a>
</li>
<li <?php if ($page == 'certificate') echo 'class="active"'?>>
<a href="certificate.php">Certificates</a>
</li>
<li class="divider"></li>
<li <?php if ($page == 'report') echo 'class="active"'?>>
<a href="generate_report.php">Generate a Report</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</nav>