-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
139 lines (123 loc) · 5.84 KB
/
Copy pathindex.php
File metadata and controls
139 lines (123 loc) · 5.84 KB
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
<?php
session_start();
error_reporting(0);
include('includes/dbconn.php');
if(isset($_POST['signin'])){
$uname = $_POST['username'];
$password = md5($_POST['password']);
$sql = "SELECT SN,empCode,email,password,status FROM employee WHERE email=:uname and password=:password";
$query = $dbh -> prepare($sql);
$query -> bindParam(':uname', $uname, PDO::PARAM_STR);
$query -> bindParam(':password', $password, PDO::PARAM_STR);
$query -> execute();
$results = $query -> fetchAll(PDO::FETCH_OBJ);
if($query->rowCount() > 0)
{
foreach ($results as $result) {
$status = $result->status;
$_SESSION['eid'] = $result->SN;
$_SESSION['empcode'] = $result->empCode;
}
if($status == 0)
{
$msg = "In-Active Account. Please contact your administrator!";
} else {
$_SESSION['emplogin'] = $_POST['username'];
echo "<script type='text/javascript'> document.location = 'employees/leave.php'; </script>";
}
} else {
echo "<script>alert('Sorry, Invalid Details.');</script>";
}
}
?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Employee Leave Management System</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/png" href="assets/images/icon/favicon.ico">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/font-awesome.min.css">
<link rel="stylesheet" href="assets/css/themify-icons.css">
<link rel="stylesheet" href="assets/css/metisMenu.css">
<link rel="stylesheet" href="assets/css/owl.carousel.min.css">
<link rel="stylesheet" href="assets/css/slicknav.min.css">
<!-- amchart css -->
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
<!-- others css -->
<link rel="stylesheet" href="assets/css/typography.css">
<link rel="stylesheet" href="assets/css/default-css.css">
<link rel="stylesheet" href="assets/css/styles.css">
<link rel="stylesheet" href="assets/css/responsive.css">
<!-- modernizr css -->
<script src="assets/js/vendor/modernizr-2.8.3.min.js"></script>
</head>
<body>
<div id="preloader">
<div class="loader"></div>
</div>
<!-- Login start -->
<div class="login-area login-s2">
<div class="container">
<div class="login-box ptb--100">
<form method="POST" name="signin">
<div class="login-form-head">
<div class="logo">
<img src="https://tse3.mm.bing.net/th?id=OIP.aXJZ49qcluwKDwRciHj12wAAAA&pid=Api" alt="logo">
</div>
<h4>Employee Login</h4>
<p>Employee Leave Management System</p>
<?php if($msg){?><div class="errorWrap"><strong>Error</strong> : <?php echo htmlentities($msg); ?> </div><?php }?>
</div>
<div class="login-form-body">
<div class="form-gp">
<label for="exampleInputEmail1">Email address</label>
<input type="email" id="username" name="username" autocomplete="off" required>
<i class="ti-email"></i>
<div class="text-danger"></div>
</div>
<div class="form-gp">
<label for="exampleInputPassword1">Password</label>
<input type="password" id="password" name="password" autocomplete="off" required>
<i class="ti-lock"></i>
<div class="text-danger"></div>
</div>
<div class="row mb-4 rmber-area">
<div class="col-6">
<div class="custom-control custom-checkbox mr-sm-2">
<input type="checkbox" class="custom-control-input" id="customControlAutosizing">
<label class="custom-control-label" for="customControlAutosizing">Remember Me</label>
</div>
</div>
<div class="col-6 text-right">
<a href="password-recovery.php">Forgot Password?</a>
</div>
</div>
<div class="submit-btn-area">
<button id="form_submit" type="submit" name="signin">Login <i class="ti-arrow-right"></i></button>
</div>
<div class="form-footer text-center mt-5">
<p class="text-muted"><a href="admin/index.php">Go to Admin Panel</a></p>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- Login end -->
<!-- jquery latest version -->
<script src="assets/js/vendor/jquery-2.2.4.min.js"></script>
<!-- bootstrap 4 js -->
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/owl.carousel.min.js"></script>
<script src="assets/js/metisMenu.min.js"></script>
<script src="assets/js/jquery.slimscroll.min.js"></script>
<script src="assets/js/jquery.slicknav.min.js"></script>
<!-- others plugins -->
<script src="assets/js/plugins.js"></script>
<script src="assets/js/scripts.js"></script>
</body>
</html>