-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminCreateStaffForm.php
More file actions
235 lines (193 loc) · 8.5 KB
/
adminCreateStaffForm.php
File metadata and controls
235 lines (193 loc) · 8.5 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
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
<!-- staff register -->
<?php
ini_set("display_errors", 1);
require('patientSessions.php');
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>create employee</title>
<link rel="stylesheet" href="css/global.css" type="text/css" />
<link rel="stylesheet" href="css/mobile.css" type="text/css" media="only screen and (max-width : 620px)" />
<link rel="stylesheet" href="css/desktop.css" type="text/css" media="only screen and (min-width : 621px)" />
</head>
<body>
<div class="">
<div class="navbarContainer">
<?php
include("php/includes/navbar.php");
?>
</div>
<div class="header">
<?php
include("php/includes/header.php");
?>
</div>
<div class="container">
<div class="loginContainer">
<div class="login">
<Br>
<div class="LoginTitle">
<h1>Registration</h1>
</div><br><br>
<div class="loginError">
<?php
// Error messages
if (isset($_SESSION['regError'])) {
switch ($_SESSION['regError']) {
case 1:
echo "<p class=\"error\">Invalid Email Address</p>";
break;
case 2:
echo "<p class=\"error\">Please confirm your password</p>";
break;
case 3:
echo "<p class=\"error\">Already Registered</p>";
break;
}
}
?>
</div>
<!-- form for admin to fill out staff members details to create a new staff member on the system -->
<div class="LoginForm">
<form action="adminCreateStaffReplacement.php" method="post">
<div class="createStaffForm">
<input type="text" name="firstName" placeholder="firstName"><br>
</div>
<div class="createStaffForm">
<input type="text" name="lastName" placeholder="lastName"><br>
</div>
<div class="createStaffForm">
<input type="text" name="phoneNumber" placeholder="phoneNumber"><br>
</div>
<div class="createStaffForm">
<input type="text" name="gender" placeholder="gender"><br>
</div>
<div class="createStaffForm">
<input type="text" name="staffRole" placeholder="staffRole"><br>
</div>
<div class="createStaffForm">
<input type="text" name="salary" placeholder="salary"><br>
</div>
<div class="createStaffForm">
<input type="date" name="hireDate" placeholder="hireDate"><br>
</div>
<div class="createStaffForm">
<input type="text" name="department_id" placeholder="department_id"><br>
</div>
<div class="createStaffForm">
<input type="text" name="email" placeholder="email"><br>
</div>
<div class="createStaffForm">
<input type="password" name="staffPassword" placeholder="password"><br><br>
</div>
<div class="patientSignupForm">
<label for="passwordConfirm">Confirm Password:</label>
<input type="password" name="staffPasswordConfirm" id="passwordConfirm">
</div><br><br>
<div>
<input type="submit" value="Register">
</div>
</form>
</div><br>
<!-- Password message box requirements -->
<div id="message" class="passwordMessage">
<h4>Password must contain:</h4>
<p id="letter" class="invalid">A <b>lowercase</b> letters</p>
<p id="capital" class="invalid">A <b>capital (uppercase)</b> letters</p>
<p id="number" class="invalid">A <b>number</b> letters</p>
<p id="length" class="invalid">Minimum <b>8 characters</b> </p>
</div><br><br>
</div>
</div>
</div>
</div>
<?php
// require('testDebugger.php');
?>
<div class="footer">
<?php
include("php/includes/footer.php");
?>
</div>
<!-- password require -->
<script>
var myInput = document.getElementById("staffPassword");
var letter = document.getElementById("letter");
var capital = document.getElementById("capital");
var number = document.getElementById("number");
var length = document.getElementById("length");
// when password input clicked, show message
myInput.onfocus = function(){
document.getElementById("message").style.display = "block";
}
//when user clicks off password input, hide message
myInput.onblur = function(){
document.getElementById("message").style.display = "none";
}
//when user starts typing in password input
myInput.onkeyup =function(){
//validate lowercase letters
var lowerCaseLetters = /[a-z]/g;
if(myInput.value.match(lowerCaseLetters)) {
letter.classList.remove("invalid");
letter.classList.add("valid");
} else{
letter.classList.remove("valid");
letter.classList.add("invalid");
}
//validate capital letters
var upperCaseLetters = /[A-Z]/g;
if(myInput.value.match(upperCaseLetters)) {
capital.classList.remove("invalid");
capital.classList.add("valid");
} else{
capital.classList.remove("valid");
capital.classList.add("invalid");
}
//validate numbers
var numbers = /[0-9]/g;
if(myInput.value.match(numbers)){
number.classList.remove("invalid");
number.classList.add("valid");
} else{
number.classList.remove("valid");
number.classList.add("invalid");
}
//validate length
if(myInput.value.length >= 8){
length.classList.remove("invalid");
length.classList.add("valid");
} else{
length.classList.remove("valid");
length.classList.add("invalid");
}
}
</script>
<!-- scroll to top button -->
<script>
// Get button
let mybutton = document.getElementById("myBtn");
// When the user scrolls down by 20px from the top of the page, show 'scroll back to top' button
window.onscroll = function() {
scrollFunction()
};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
mybutton.style.display = "block";
} else {
mybutton.style.display = "none";
}
}
// When user clicks on 'scroll back to top' button, scroll to top of the webpage
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>
</body>
</html>
<!-- tester
Daisy@test.com -->