-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
57 lines (55 loc) · 1.69 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
<?php session_start(); ?>
<?php require_once(dirname(__FILE__) . "/lib/std.php"); ?>
<!Doctype html>
<?php require_once(dirname(__FILE__) . "/config.php"); ?>
<html>
<head>
<meta charset="utf8">
<title>國立東華大學 通識教育中心 TA系統</title>
<link rel="stylesheet" href="<?php echo $URLPv; ?>lib/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="<?php echo $URLPv; ?>index.css">
<script src="<?php echo $URLPv; ?>lib/jquery/jquery-1.11.2.js"></script>
<script src="<?php echo $URLPv; ?>lib/bootstrap/js/bootstrap.js"></script>
<script src="<?php echo $URLPv; ?>lib/validator.min.js"></script>
</head>
<body>
<?php
require_once(dirname(__FILE__) . "/lib/header.php");
?>
<div class="body container">
<?php
$has_require = 0;
if(isset($_GET['module'])){
$sites = array(
array("select", "list.php"),
array("rule", "rule.php"),
array("apply", "apply.php"),
array("list", "list.php"),
array("diary", "diaryform.php"),
array("showD", "printDiary.php"),
array("showA", "printApply.php"),
);
foreach ($sites as $site){
if($_GET['module'] == $site[0]){
if(isset($_SESSION['loginID']) && isset($_SESSION['loginToken'])){
if(checkExist($DBmain, $_SESSION['loginID'], $_SESSION['loginToken'])){
require_once(dirname(__FILE__) . "/" . $site[1]);
$has_require = 1;
}
else if(isset($_SESSION['admin']) && isset($_SESSION['loginToken'])){
require_once(dirname(__FILE__) . "/" . $site[1]);
$has_require = 1;
}
}
}
}
}
if($has_require == 0){
//session_destroy();
require_once(dirname(__FILE__) . "/login.php");
}
?>
</div>
<?php
require_once(dirname(__FILE__) . "/lib/footer.php");
?>