-
Notifications
You must be signed in to change notification settings - Fork 6
/
change_pwd.php
110 lines (106 loc) · 5.32 KB
/
change_pwd.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
<?php
include_once 'header_h.php';
?>
<?php
include_once 'roles.php';
?>
<script language="javascript" src="validation.js"></script>
<script language="javascript">
function validate_form(f1) {
if (isEmpty(f1.eid.value, "Employee Id")) {
alert(errMsg);
f1.eid.focus();
return false;
}
if (isEmpty(f1.opwd.value, "Old Password")) {
alert(errMsg);
f1.opwd.focus();
return false;
}
if (isEmpty(f1.npwd.value, "New Password")) {
alert(errMsg);
f1.npwd.focus();
return false;
}
if (isEmpty(f1.cpwd.value, "Confirm Password")) {
alert(errMsg);
f1.cpwd.focus();
return false;
}
if (f1.npwd.value != f1.cpwd.value) {
alert("Your password and confirmation password do not match.");
f1.cpwd.focus();
return false;
}
}
</script>
<form action="pwd.php" method="post" onSubmit="return validate_form(this)">
<section class="content">
<div class="container-fluid">
<div class="block-header">
<h2>CHANGE PASSWORD</h2>
</div>
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="card">
<div class="body">
<h2 class="card-inside-title">Employee Id:</h2>
<div class="row clearfix">
<div class="col-sm-12">
<div class="form-group">
<div class="form-line">
<input type="text" name="eid" class="form-control"
value="<?php echo $_SESSION['employee_id']; ?>" />
</div>
</div>
<h2 class="card-inside-title">Old Password:</h2>
<div class="row clearfix">
<div class="col-sm-12">
<div class="form-group">
<div class="form-line">
<input type="password" name="opwd" class="form-control" />
</div>
</div>
<h2 class="card-inside-title">New Password:</h2>
<div class="row clearfix">
<div class="col-sm-12">
<div class="form-group">
<div class="form-line">
<input type="password" name="npwd" class="form-control"
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}"
title="Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters" />
</div>
</div>
<h2 class="card-inside-title">Confirm Password:</h2>
<div class="row clearfix">
<div class="col-sm-12">
<div class="form-group">
<div class="form-line">
<input type="password" name="cpwd"
class="form-control"
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}"
title="Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters" />
</div>
</div>
</div>
</div>
</div>
</div>
<center>
<input class="btn btn-primary waves-effect" name="add" type="submit"
value="SUBMIT">
</center>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</form>
<?php
include_once 'footer_h.php';
?>