-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
132 lines (109 loc) · 3.78 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
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 session_start();?>
<?php include("includes/connection.php");?>
<?php include("includes/functions.php");?>
<?php //after the student has been loged in, his information will be fetch from the Student_clearnace table and the clearance status plus the
//issues associated with his clearance for each unit will be displayed.
if(isset($_POST['login'])){
$user = mysql_real_escape_string(htmlentities($_POST['user']));
$password = mysql_real_escape_string(htmlentities($_POST['password']));
$qr = "SELECT * FROM administrators WHERE Username = '$user' AND Password = '$password'";
$sql = mysql_query($qr);
Confirm_query($sql, "crab", "");
$t = mysql_num_rows($sql);
if($t == "1")//if login is valid
{
$row = mysql_fetch_assoc($sql);
if( $user == "super" && $password == "super")
{
$_SESSION['title'] = $row['Department'];
$_SESSION['user'] = $row['Usernaame'];
header("location:admin.php?add");
}
else
{
$_SESSION['title'] = $row['Department'];
$_SESSION['user'] = $row['Usernaame'];
header("location:DeptAdmin.php?addP");
}
}
else//login not valid
{
$qr = "SELECT * FROM supervisors WHERE Username = '$user' AND Password = '$password'";
$sql = mysql_query($qr);
$t = mysql_num_rows($sql);
Confirm_query($sql, "crab", "");
if($t == "1")//if login is valid
{
$row = mysql_fetch_assoc($sql);
$_SESSION['title'] = $row['Department'];
$_SESSION['superId'] = $row['Id'];
$_SESSION['name'] = $row['Tittle'] . " " . $row['Fullname'];
header("location:super.php");
}
else {
$E = "Incorrect Username or Password";
}
}
}
?>
<?php
?>
<!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" />
<title>Login</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
</style>
</head>
<body>
<div class="container">
<nav class="navbar navbar-expand-lg nav-tabs nav-fill navbar-light bg-light">
<div class="container">
<img src="images/logo.png" height="70" width="100" />
<span class="fs-4">Computer Science e-Project Archive</span>
<ul class="nav nav-pills">
<li class="nav-item"><a href="#" class="nav-link" aria-current="page">Home</a></li>
<li class="nav-item"><a href="about_us.php" class="nav-link">About Us</a></li>
<li class="nav-item"><a href="#" class="nav-link">Contact</a></li>
<li class="nav-item"><a href="#" class="nav-link">FAQs</a></li>
</ul>
</div>
</div>
</nav> <div class="b-example-divider"></div>
<div class="b-example-divider"></div>
<div class="content">
<div class="clear"> </div>
<center>
<div class="loginInclude">
<?php include("login.php");?>
</div>
</center>
</div>
<<div class="b-example-divider"></div>
<!-- Footer -->
<footer class=" text-center fixed-bottom" >
<!-- Copyright -->
<div class="text-center p-3" style="background-color: rgba(0, 0, 0, 0.2);">
© 2022 Copyright:
<a href="#!">Bn Hassan</a>
</div>
<!-- Copyright -->
</footer>
</div>
</body>
</html>