-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrecover.php
249 lines (242 loc) · 10.8 KB
/
recover.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<!DOCTYPE html>
<html>
<head>
<title>Student Record Managment</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/all.js"></script>
<link href="https://fonts.googleapis.com/css?family=Farsan|Indie+Flower|Itim|Mina|Sacramento|Nunito" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-grid.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-grid.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-reboot.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-reboot.min.css">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body style="background-color:aliceblue;">
<header class="fixed-top">
<nav class="navbar navbar-expand-lg navbar-light" style="background: linear-gradient(45deg, #1de099, #1dc8cd);">
<a class="navbar-brand" href="#" style="font-family: 'Itim', cursive; font-weight: bold; font-size: 20px;">Student Record Management System</a>
</nav>
</header>
<div class="main_div">
<div class="row">
<div class="col-lg-12 col-xl-12 col-md-12 col-sm-12 col-12">
<p class="maintext">Welcome<br>to<br>"Student Record Managment System"</p>
</div>
</div>
<div id="facultypagediv" class="container col-lg-8">
<?php
$output='';
if(isset($_GET["passkey"]))
{
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "majorproject";
$receivedcode=$_GET['passkey'];
$conn = new mysqli($servername, $username, $password, $dbname);
$decryptcode=base64_decode($receivedcode);
if ($conn->connect_error)
{
die("Connection failed: " . $conn->connect_error);
}
$checkadmin=" SELECT * FROM admincredentials
WHERE passkey='$decryptcode'";
$checkfaculty=" SELECT * FROM facultydetails
WHERE passkey='$decryptcode'";
$resultadmin=mysqli_query($conn,$checkadmin);
$resultfaculty=mysqli_query($conn,$checkfaculty);
$rowadmin = $resultadmin->fetch_assoc();
$rowfaculty = $resultfaculty->fetch_assoc();
$count_if_exsist_admin=mysqli_num_rows(mysqli_query($conn,$checkadmin));
$count_if_exsist_faculty=mysqli_num_rows(mysqli_query($conn,$checkfaculty));
if(($count_if_exsist_faculty>0)||($count_if_exsist_admin>0)){
?>
<center><br>
<div class="">
<p style="font-size: 18px; line-height: 18px; color: ghostwhite;">Please set new pass word here and remeber this one correctly!</p>
</div>
<div style="font-size: 18px; line-height: 18px; color: ghostwhite;" >
<p id="recoverpageerror"></p>
</div>
<form id="changerecoverform">
<?php
if ($count_if_exsist_faculty > 0) {
?>
<input type="hidden" name="uservalue" id="uservalue" value="faculty">
<?php
}
if ($count_if_exsist_admin > 0) {
?>
<input type="hidden" name="uservalue" id="uservalue" value="admin">
<?php
}
?>
<input type="hidden" name="recoverkey" id="recoverkey" value="<?php echo $decryptcode;?>">
<div class="form-group col-lg-6 col-xl-6 col-md-6 col-sm-12 col-12">
<input class="form-control" type="password" name="newpass" id="newpass" placeholder="Enter a new password" required>
</div>
<div class="form-group col-lg-6 col-xl-6 col-md-6 col-sm-12 col-12">
<input class="form-control" type="password" name="confrmpass" id="confrmpass" placeholder="Confirm password" required>
</div>
</form>
<button class="btn btn-sm dismissbtn" type="submit" title="Chnage Password" id="updatepass" name="updatepass">Change Password</button>
<?php
}else{
?>
<center>
<br>
<h4 class="card-title text-danger">WARNING!</h4>
<h4 class="card-text text-danger">The token has been expired please go back to home and try again !<h4>
</center>
<?php
}
?>
<a href="index.php"><button class="btn btn-sm dismissbtn" type="submit" title="Home">Back to home</button></a>
</center>
<br>
<?php
}else {
?>
<center>
<br>
<h4 class="card-title text-danger">WARNING!</h4>
<p class="card-text text-danger">ONLY SPECIFIC USERS ARE AUTHORIZED TO THIS PAGE. THANK YOU<p>
<div class="card-block">
<a class="btn btn-success dismissbtn" href="http://localhost/majorproject/index.php">Get Back</a>
</div>
<br>
</center>
<?php
}
?>
</div>
</div>
<br>
<footer id="footer_faculty">
<div class="site_footer">
<p class="copyrighttext text-center" style="padding-bottom: 10px; margin-bottom: 0px;">
© THDC IHET || <?php echo date('Y');?> || <a href="#developermodal" data-toggle="modal">Team</a>
</p>
</div>
</footer>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="main.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap.bundle.js"></script>
<script type="text/javascript" src="js/bootstrap.bundle.min.js"></script>
<!-- Modal -->
<div class="modal fade" id="facultylogin" tabindex="-1" role="dialog" aria-labelledby="facultyloginTitle" aria-hidden="true" style="background: linear-gradient(45deg, #1de099, #1dc8cd);">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header modalstyle">
<h5 class="modal-title" id="Facultyloginmodaltitle">Faculty Login</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="facultyloginform">
<div class="form-group">
<input class="form-control" type="text" name="faultyusername" id="faultyusername" placeholder="Your User Name" required>
</div>
<div class="form-group">
<input class="form-control" type="password" name="facultypassword" id="facultypassword" placeholder="Your Password" required>
</div>
</form>
<div class="text-danger" id="facultyloginalert">
</div>
</div>
<div class="modal-footer modalstyle">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" id="facultyloginbutton" href="faculty.php">Log In</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="adminlogin" tabindex="-1" role="dialog" aria-labelledby="adminloginTitle" aria-hidden="true" style="background: linear-gradient(45deg, #1de099, #1dc8cd);">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header modalstyle">
<h5 class="modal-title" id="adminloginmodaltitle">Admin Login</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="adminloginform">
<div class="form-group">
<input class="form-control" type="text" name="adminusername" id="adminusername" placeholder="Your User Name" required>
</div>
<div class="form-group">
<input class="form-control" type="password" name="adminpassword" id="adminpassword" placeholder="Your Password" required>
</div>
</form>
<div class="text-danger" id="adminloginalert">
</div>
</div>
<div class="modal-footer modalstyle">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" id="adminloginbutton" href='admin.php'>Log In</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="developermodal" tabindex="-1" role="dialog" aria-labelledby="developermodalTitle" aria-hidden="true" style="background: linear-gradient(45deg, #1de099, #1dc8cd);">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header modalstyle">
<h5 class="modal-title" id="developermodaltitle">Developers</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
<center>
<h3 style="padding-top: 40px; font-family: 'Indie Flower', cursive; font-weight:bolder;">Guide</h3>
<span class="sectiondivider"></span>
<img src="images/pspandey.jpg" class="img-thumbnail rounded-circle">
<p class="foocolext">Mr. P. S. Pandey<br>Assitant Prof. ECE Dept.</p>
</center>
</div>
</div>
<center>
<h3 style="padding-top: 40px; font-family: 'Indie Flower', cursive; font-weight:bolder;">Students</h3>
<span class="sectiondivider"></span>
</center>
<div class="row">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
<center>
<img src="images/ankuj.jpg" class="img-thumbnail rounded-circle">
<p class="foocolext">Ankuj Bisht</p>
</center>
</div>
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
<center>
<img src="images/nidhi.jpeg" class="img-thumbnail rounded-circle">
<p class="foocolext">Nidhi Gagat</p>
</center>
</div>
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
<center>
<img src="images/vkg.jpeg" class="img-thumbnail rounded-circle">
<p class="foocolext">Vivek Kumar Gupta</p>
</center>
</div>
</div>
</div>
</div>
<div class="modal-footer modalstyle">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</html>