-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
98 lines (91 loc) · 3.01 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
<?php
require ("databaseserver.php");
$Error_Message=NULL;
if(isset($_POST['login'])){
$loginFormUserID = input_filter($_POST['userID']);
$loginFormPassword = input_filter($_POST['userPassword']);
if($DB->validate_login($loginFormUserID, $loginFormPassword)){
$DB->initialize_user($loginFormUserID);
}
else{
$Error_Message=$SM->strings['invalid_id_or_password'];
}
}
if(isset($_GET['logout'])){
session_destroy();
header("Location:/");
return;
}
if(isset($_SESSION['DCMS_user'])){
if($_SESSION['DCMS_user']->user_type=="student")
header("Location:student/");
else if($_SESSION['DCMS_user']->user_type=="admin")
header("Location:admin/");
else if($_SESSION['DCMS_user']->user_type=="superAdmin")
header("Location:admin-panel/");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=0.9">
<title><?php echo $SM->strings['site_title'];?></title>
<link rel="icon" href="images/icon/duet_icon.ico">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="fonts/font-awesome.min.css">
</head>
<body>
<!-- Main Section Start -->
<!-- Header Start -->
<div class="header">
<div class="mainmenu">
<center><div class="siteTitle"><a href="/"><img src="images/icon/duet_icon.ico" height="25"> <?php echo $SM->strings['site_title'];?></a></div></center>
</div>
</div><!-- /.header -->
<?php if(!isset($_SESSION['DCMS_user'])) {?>
<div class="landing_page">
<!-- Header End -->
<div class="logInForm">
<br>
<center><img src="images/icon/duet_icon.ico" height="80px"></center>
<h3><?php echo $SM->strings['login_form_title'];?></h3>
<form method="POST" action="">
<i class="fa fa-user" style="font-size:22px;"></i> <input type="text" name="userID" value="" placeholder="<?php echo $SM->strings['login_form_username_placeholder'];?>" minlength="3" autofocus required />
<div class="clearFix"></div>
<i class="fa fa-shield" style="font-size:20px;"></i> <input type="password" name="userPassword" value="" placeholder="<?php echo $SM->strings['login_form_password_placeholder'];?>" minlength="6" required />
<br><br>
<button type="submit" name="login"><i class="fa fa-sign-in" style="font-size:20px;"></i> <?php echo $SM->strings['login_form_submit_button'];?></button>
</form>
<br>
<center>
<?php
if($Error_Message != NULL)
echo "<center><b>".$Error_Message."</b></center>";
?>
<a href="" style="font-size:12px">Forgot Password?</a>
</center>
</div>
<div class="clearFix"></div>
<br>
<br><br>
<!-- Mission and Vision Section End -->
</div><!-- /.main -->
<!-- Main Section End -->
<?php }
else{ ?>
<div class="main">
<center><h3>.......</h3></center>
</div>
<?php }
?>
<!-- Footer Section Start -->
<?php
require ("include/footer.php");
?>
<!-- Footer Section End -->
<script src="js/jquery-2.x-git.min.js"></script>
<script src="js/function.js"></script>
</body>
</html>