-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
100 lines (88 loc) · 4.24 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ProTracker | Login</title>
<link rel="icon" type="image/png" href="assets/img/favicon.ico">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link rel="stylesheet" href="assets/css/index.css">
</head>
<body>
<div class="login-logo">
<b>Pro</b>Tracker
</div>
<div class="container login-container">
<div class="row">
<div class="col-md-6 login-form-1">
<h3>Login for Manager</h3>
<form name="mangform" id="mangForm">
<div class="form-group">
<input type="text" class="form-control" name="email" placeholder="Your Email *" id="MangUname" required />
</div>
<div class="form-group">
<input type="password" class="form-control" name="password" placeholder="Your Password *" id="MangPw" required />
</div>
<div class="form-group">
<input type="submit" class="btnSubmit" value="Login" onclick="checkMang()" />
</div>
<!-- put username = himanshu <br>
password can be anything -->
<!-- <div class="form-group">
<a href="#" class="ForgetPwd">Forget Password?</a>
</div> -->
</form>
</div>
<div class="col-md-6 login-form-2">
<h3>Login for Employee</h3>
<form name="empform" id="empForm">
<div class="form-group">
<input type="text" class="form-control" name="email" placeholder="Your Email *" id="EmpUname" required />
</div>
<div class="form-group">
<input type="password" class="form-control" name="password" placeholder="Your Password *" id="EmpPw" required />
</div>
<div class="form-group">
<input type="submit" class="btnSubmit" value="Login" onclick="checkEmp()" />
</div>
<!-- put username = RamKumar <br>
password = employee -->
<!-- <div class="form-group">
<a href="#" class="ForgetPwd" value="Login">Forget Password?</a>
</div> -->
</form>
</div>
</div>
</div>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<!-- <script src="/__/firebase/6.0.2/firebase-app.js"></script> -->
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#reserved-urls -->
<!-- Initialize Firebase -->
<!-- <script src="/__/firebase/init.js"></script> -->
<script type="text/javascript">
function checkEmp(){
var userName = document.getElementById('EmpUname').value;
var Pw = document.getElementById('EmpPw').value;
var getUsers =JSON.parse(localStorage.getItem("users")) ;
for (var i = 0; i < getUsers.length; i++) {
if (getUsers[i].username == userName && getUsers[i].password == Pw) {
document.getElementById('empForm').action = "../employee.html";
var loggedUserId = getUsers[i].id;
localStorage.setItem('loggedUserId', JSON.stringify(loggedUserId));
}
}
}
function checkMang(){
var userName = document.getElementById('MangUname').value;
var Pw = document.getElementById('MangPw').value;
if (userName == 'Himanshu') {
document.getElementById('mangForm').action = "../manager.html";
var managerName = userName;
localStorage.setItem('managerName',JSON.stringify(managerName));
}
}
</script>
</body>
</html>