-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
561 lines (478 loc) · 21.3 KB
/
login.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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
<?php
require_once "include/initialize.php";
include_once "inactive.php";
if (isset($_SESSION['ACCOUNT_ID'])) {
// redirect(web_root . "m.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="">
<meta name="author" content="">
<title>EZEMS </title>
<!-- Bootstrap core CSS -->
<link href="<?php echo web_root; ?>css/css/bootstrap.min.css" rel="stylesheet">
<link href="<?php echo web_root; ?>css/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
<link href="<?php echo web_root; ?>css/css/index_background.css" rel="stylesheet" media="screen">
<link href="<?php echo web_root; ?>css/css/easypiechart/jquery.easy-pie-chart.css" rel="stylesheet" media="screen">
<link href="<?php echo web_root; ?>css/css/my_style.css" rel="stylesheet" media="screen">
<link href="<?php echo web_root; ?>css/css/styles.css" rel="stylesheet" media="screen">
<link href="<?php echo web_root; ?>css/css/index.css" rel="stylesheet" media="screen">
<link href="<?php echo web_root; ?>css/css/DT_bootstrap.css" rel="stylesheet" media="screen">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<link href="<?php echo web_root; ?>css/css/fullcalendar/fullcalendar.css" rel="stylesheet" media="screen">
<link href="<?php echo web_root; ?>css/css/bootstrap-wysihtml5/src/bootstrap-wysihtml5.css" rel="stylesheet"
media="screen">
<link href="<?php echo web_root; ?>fonts/font-awesome.min.css" rel="stylesheet" media="screen">
<link href="<?php echo web_root; ?>css/css/jGrowl/jquery.jgrowl.css" rel="stylesheet" media="screen">
<link rel="shortcut icon" href="img/favicon-color.png">
<link rel="stylesheet" type="text/css" href="admin/css/bootstrap.css" media="screen, projection" />
<link rel="stylesheet" href="admin/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="admin/css/Home.css" media="screen, projection" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="assets/js/p.js"></script>
<!-- <link rel="stylesheet" href="styles.css"> -->
<link rel="stylesheet" href="styles.css"> <!-- Link to your CSS file -->
<!-- <script src="https://www.google.com/recaptcha/api.js" async defer></script> -->
<!-- <script src="https://www.google.com/recaptcha/enterprise.js?render=6LeDmaQpAAAAAEwsQjBGVQQhg9Z4aUXqRoWdlfaL"></script> -->
<div class="marque">
<marquee style="color:white">Welecome to ETD kindly insert your personal Details Corectly. Thank You!</marquee>
</head>
<div class="navbar">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<style>
.attendance-icon {
font-size: 28px;
color: #007bff;
/* Change color as needed */
}
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-image: url('images/bg/bg-3-full.jpg');
background-size: cover;
/* Cover the entire container */
background-position: auto;
/* Center the background image */
height: 100vh;
/* Set the height of the body to viewport height */
display: auto;
/* justify-content: center; */
/* align-items: center; */
}
/* Define styles for the header */
header {
background-color: #333;
color: #fff;
text-align: center;
padding: 20px 0;
}
.content {
text-align: center;
color: #fff;
}
/* Define styles for the main content */
.container {
max-width: 800px;
/* Adjust as needed */
margin: 0 auto;
padding: 20px;
}
/* Define styles for the footer */
footer {
background-color: #333;
color: #fff;
text-align: center;
padding: 20px 0;
position: fixed;
bottom: 0;
width: 100%;
}
@media screen and (max-width: 768px) {
.container {
max-width: 90%;
max-height: fit-content;
/* Adjust as needed for smaller screens */
}
body {
background-size: contain;
/* Ensure the entire image is visible */
}
}
/* The typing effect */
@keyframes typing {
from {
width: 0;
}
to {
width: 100%;
}
}
/* The blinking cursor effect */
@keyframes blink {
50% {
border-color: gold;
}
}
/* The container for the text */
.typewriter-container {
overflow: hidden;
border-right: .17em solid white;
/* The typewriter cursor */
white-space: nowrap;
/* Keeps the content on a single line */
margin: 0 auto;
/* Center the container */
letter-spacing: .15em;
/* Adjust letter spacing for a typewriter effect */
animation: typing 6s steps(45) infinite, .90s step-end infinite;
font-size: 28px;
}
@keyframes rotate180 {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.rotate-image {
animation: rotate180 2s linear forwards;
/* Animation lasts for 2 seconds and stops at the end */
}
@keyframes blink {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.blink {
animation: blink 1s infinite;
color: red;
}
.animation-container {
text-align: center;
}
.please-login {
display: inline-block;
font-size: 24px;
}
.icon-locked::before {
content: "\1F512";
/* Unicode for locked symbol */
font-family: Arial, sans-serif;
/* Use a font that supports the locked symbol */
font-size: 24px;
/* Adjust size as needed */
display: inline-block;
}
</style>
<?php include "social.html";?>
<h2>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav" id="footer_nav">
<!-- <li class="divider-vertical"></li> -->
<li class="active"><a href="attendance/check_attendance.php">
<h3><i class="attendance-icon">📅</i> ATTENDANCE</h3>
</a></li>
<li class="divider-vertical"></li>
<li class="active"><a href="vote/index.php">
<h3><i class="fas fa-vote-yea"></i> VOTE</h3>
</a></li>
<li class="divider-vertical"></li>
<li class="active"><a href="add.php">
<h3><i class="fas fa-vote-yea"></i> VOTER REGISTRATION</h3>
</a></li>
<li class="divider-vertical"></li>
<li class="active"><a href="candadd.php">
<h3><i class="icon-group"></i> CANDIDATE REGISTRATION</h3>
</a></li>
<!-- <li class="divider-vertical"></li> -->
</ul>
</div>
<!--/.nav-collapse -->
</div>
</div>
</div>
<body id="login" style="background:url(images/bg/mainbg.png)">
<div class="container">
<div class="row-fluid">
<div class="span6">
<div class="title_index">
<div class="row-fluid">
<div class="span12"></div>
<div class="row-fluid">
<div class="span10">
<!-- <img class="index_logo" src="img/santotomas.png"> -->
<img src="img/logo-no-background.png" alt="Rotating Image" class="rotate-image">
</div>
<div class="span12">
<div class="motto">
<h2>
<div class="marque">
<marquee>Welcome to Ezems Tech Developers</marquee>
</div>
</h2>
</div>
</div>
</div>
</div>
<?php //include('title_index.php'); ?>
</div>
</div>
<?php
if (isset($_GET['status']) && $_GET['status'] == 'inactive') {
echo "<h3 style='color:red;text-align: center;'>You have been log out due to inactivity!</h3>";
}
// If form submitted, insert values into the database.
if (isset($_POST['ACCOUNT_USERNAME'])) {
$username = stripslashes($_REQUEST['ACCOUNT_USERNAME']); // removes backslashes
$username = mysqli_real_escape_string($mysqli, $ACCOUNT_USERNAME); //escapes special characters in a string
$password = stripslashes($_REQUEST['ACCOUNT_PASSWORD']);
$password = mysqli_real_escape_string($mysqli, $ACCOUNT_PASSWORD);
//Checking is user existing in the database or not
$query = "SELECT * FROM `useraccounts ` WHERE ACCOUNT_NAME='$ACCOUNT_NAME' and ACCOUNT_PASSWORD='" . md5($ACCOUNT_PASSWORD) . "'";
$result = mysqli_query($con, $query) or die(mysqli_error($con));
$rows = mysqli_num_rows($result);
if ($rows == 1) {
$_SESSION['ACCOUNT_USERNAME'] = $ACCOUNT_USERNAME;
$_SESSION['last_timestamp'] = time(); // Set the last activity timestamp
header("Location: index.php"); // Redirect user to index.php
exit();
} else {
echo "<div class='form'><h3>Username/password is incorrect.</h3><br/>Click here to <a href='login.php'>Login</a></div>";
}
} else {}
?>
<div class="span6">
<div class="pull-right">
<?php check_message();?>
<div id="home">
<!--/. tells about what would be the log-in appearance -->
<div class="overlay">
<!--/. Starting code for the log-in interface appearance -->
<fieldset>
<form action="" id="login_form1" class="form-signin" method="post">
<h3 class="form-signin-heading" style="color:#fff">
<div class="animation-container">
<span class=""></span>
<span class="Please Login blink">Please Login</span>
<span class="icon-locked"></span>
</div>
</h3>
<input type="text" autofocus="autofocus" class="input-block-level" id="username"
name="username" placeholder="Username" required>
<input type="password" autofocus="autofocus" class="input-block-level" id="password"
name="password" placeholder="Password" required>
<button data-placement="right" title="Click Here to Sign In" id="signin"
name="btnLogin" class="btn btn-info" type="submit"><i
class="icon-signin icon-large"></i> Log
in</button>
</form>
</fieldset>
<div class="row-fluid">
<div class="col-md-12 ">
<h4 style="color:black"><span id="tick2">
</span> |
<script>
// <!--/. tells about the time -->
function show2() {
if (!document.all && !document.getElementById)
return
thelement = document.getElementById ? document.getElementById("tick2") :
document.all.tick2
var Digital = new Date()
var hours = Digital.getHours()
var minutes = Digital.getMinutes()
var seconds = Digital.getSeconds()
var dn = "PM"
if (hours < 12)
dn = "AM"
if (hours > 12)
hours = hours - 12
if (hours == 0)
hours = 12
if (minutes <= 9)
minutes = "0" + minutes
if (seconds <= 9)
seconds = "0" + seconds
var ctime = hours + ":" + minutes + ":" + seconds + " " + dn
thelement.innerHTML = ctime
setTimeout("show2()", 1000)
}
window.onload = show2
//-->
</script>
<!--/. Script where the format of the interface time,month,day and year relies -->
<?php
$date = new DateTime();
echo $date->format('l, F jS, Y');
?>
<h4>
</div>
</div>
</div>
</div>
<!--/. END -->
</div>
<?php //include('login_form.php'); ?>
</div>
</div>
</div>
<div class="row-fluid">
<div class="offset3">
<div class="span11">
<div class="index-footer">
<div class="navbar">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span
class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<style>
ul {
float: left;
text-align: left;
}
</style>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav" id="footer_nav">
<!-- <li class="divider-vertical"></li> -->
<li class="active"><a href="<?php echo web_root; ?>m.php"><i
class="icon-home"></i> Home</a></li>
<li class="divider-vertical"></li>
<li class="active"><a href="about.php"><i
class="icon-info-sign"></i> Mission & Vision</a></li>
<li class="divider-vertical"></li>
<li class="active"><a href="history.php"><i class="icon-file"></i> Company
History</a></li>
<li class="divider-vertical"></li>
<li class="active"><a href="developers.php"><i
class="icon-group"></i> Developers</a></li>
<!-- <li class="divider-vertical"></li> -->
</ul>
</div>
<!--/.nav-collapse -->
</div>
</div>
</div>
<?php //include('link.php'); ?>
</div>
</div>
</div>
</div>
<?php //include('footer.php'); ?>
</div>
<script src="../vote/script.js"></script> <!-- Link to your JavaScript file -->
</body>
<?php
if (isset($_POST['btnLogin'])) {
$email = trim($_POST['username']);
$upass = trim($_POST['password']);
$h_upass = sha1($upass);
if ($email == '' or $upass == '') {
message("Invalid Username and Password!", "error");
redirect("login.php");
} else {
//it creates a new objects of member
$user = new User();
//make use of the static function, and we passed to parameters
$res = $user::userAuthentication($email, $h_upass);
if ($res == true) {
message("You logon as " . $_SESSION['ACCOUNT_TYPE'] . ".", "success");
$sql = "INSERT INTO `tbllogs` (`USERID`, `LOGDATETIME`, `LOGROLE`, `LOGMODE`)
VALUES (" . $_SESSION['ACCOUNT_ID'] . ",'" . date('Y-m-d H:i:s') . "','" . $_SESSION['ACCOUNT_TYPE'] . "','Logged in')";
$mydb->setQuery($sql);
$mydb->executeQuery();
if ($_SESSION['ACCOUNT_TYPE'] == 'Administrator') {
redirect(web_root . "index.php");
} elseif ($_SESSION['ACCOUNT_TYPE'] == 'Registrar') {
redirect(web_root . "index.php");
} else {
redirect(web_root . "login.php");
}
} else {
message("Account does not exist! Please contact Administrator.", "error");
redirect(web_root . "login.php");
}
}
}
?>
</head>
<center>
<footer>
<p style="color: #fff">EZEMS Copyright 2024</p>
</footer>
</center>
<script src="<?php echo web_root; ?>js/js/vendors/jquery-1.9.1.min.js"></script>
<script src="<?php echo web_root; ?>js/js/vendors/modernizr-2.6.2-respond-1.1.0.min.js"></script>
<script src="<?php echo web_root; ?>css/css/jGrowl/jquery.jgrowl.js"></script>
<script>
$(function() {
$('.tooltip').tooltip();
$('.tooltip-left').tooltip({
placement: 'left'
});
$('.tooltip-right').tooltip({
placement: 'right'
});
$('.tooltip-top').tooltip({
placement: 'top'
});
$('.tooltip-bottom').tooltip({
placement: 'bottom'
});
$('.popover-left').popover({
placement: 'left',
trigger: 'hover'
});
$('.popover-right').popover({
placement: 'right',
trigger: 'hover'
});
$('.popover-top').popover({
placement: 'top',
trigger: 'hover'
});
$('.popover-bottom').popover({
placement: 'bottom',
trigger: 'hover'
});
$('.notification').click(function() {
var $id = $(this).attr('id');
switch ($id) {
case 'notification-sticky':
$.jGrowl("Stick this!", {
sticky: true
});
break;
case 'notification-header':
$.jGrowl("A message with a header", {
header: 'Important'
});
break;
default:
$.jGrowl("Hello world!");
break;
}
});
});
</script>
</html>