forked from afnan2013/cseku_wpl_2018_scholarship_management
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.php
132 lines (98 loc) · 3.86 KB
/
index2.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
<?php
include_once 'path.php';
include_once UTILITY.'class.xml.inc';
//including the common file
include_once COMMON.'class.common.inc';
include_once COMMON.'class.common.course.inc';
include_once COMMON.'class.common.result.inc';
include_once COMMON.'class.common.user.inc';
//current template path
$template_link= TEMPLATE.'basic/';
ob_start(); //converts php output to a buffer and later publish it
// start session always
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
//browser request
$_URI = $_SERVER['REQUEST_URI'];
//get the previous link if it is a php file request
if(isset($_SESSION['globalPage']) && strpos($_URI, '.php')!==false){
$_SESSION['previousPage']=$_SESSION['globalPage'];
$_SESSION['globalPage']=$_URI;
}
elseif (strpos($_URI, '.php')!==false) {
$_SESSION['globalPage']=$_URI; //store current php link in the sessions
}
//finding the page description such as login.php, index.php, user.php, home.php etc.
$page = unparse_url(parse_url($_URI));
//////// check whether current user has permission to access the browser entered link
//if the page is not accessible by everyone
if(isset($_SESSION["globalPermission"])&& !every_one_has_access($page) ){
// or the page access permission is not given to current user
if(userHasAccessToLink($page)==false)
$page=PageUtil::$ERROR;
}
/////////////////
if(isset($page)){
//TODO: check whether middleware application is active
//apply middleware
$page = apply_middleware($page);
}
if(!(isset($_GET['ajax']))){
include_once $template_link.'menu.inc';
// adding menu code here
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Digital University</title>
<link rel="stylesheet" href="resources/css/bootstrap.min.css">
<link rel="stylesheet" href="resources/css/style.css" type="text/css" />
<link rel="stylesheet" href="resources/css/result.css" type="text/css" />
<script src="resources/js/jquery.min.js"></script>
<script src="resources/js/bootstrap.min.js"></script>
<script src="resources/js/myscript.js"></script>
<script src="resources/js/registrationScript.js" rel="script"></script>
<script src="resources/js/question_js_2.js" rel="script"></script>
<script src="resources/js/task.main.js"></script>
</head>
<body>
<div class="container-fluid" >
<div class="row">
<div class="col-sm-12">
<div id="menu" style="background-color:LightSteelBlue">
<?php
//do not show the menu for pages like login, new user, forget password, print regs etc
if(!no_layout_page($page))
echo print_top_menu($globalMenu,$logoutMenu);
?>
</div>
<div id="header">
<?php
//do not show the header for login page
if(!no_layout_page($page))
include $template_link.'header.inc';
}
?>
</div>
<div id="body" style="background-color:AliceBlue">
<?php
include $template_link.'body.inc';
?>
</div>
<div id="footer" style="background-color:LightSteelBlue">
<?php
if(!(isset($_GET['ajax']))){
if(strcasecmp($page, PageUtil::$PRINT_REGISTRATION)!=0){
include $template_link.'footer.inc';
}
}
?>
</div>
</div>
</div>
</div>
</body>
</html>