-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewUser.html
251 lines (232 loc) · 9.31 KB
/
newUser.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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline'; style-src 'self' 'unsafe-inline'; media-src *" />
<!-- Good default declaration:
* gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
* https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
* Disables use of eval() and inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
* Enable eval(): add 'unsafe-eval' to default-src
* Create your own at http://cspisawesome.com
-->
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: 'unsafe-inline' https://ssl.gstatic.com; style-src 'self' 'unsafe-inline'; media-src *" /> -->
<title>School One</title>
<link rel="stylesheet" type="text/css" href="w3css/4/w3.css">
<link rel="stylesheet" href="ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style type="text/css">
@media screen and (max-width: 455px) {
.h3 {
font-size:16px;
}
body {
font-size:10px;
}
}
/* Hide all steps by default: */
.tab {
display: none;
}
/* Make circles that indicate the steps of the form: */
.step {
height: 15px;
width: 15px;
margin: 0 2px;
background-color: #bbbbbb;
border: none;
border-radius: 50%;
display: inline-block;
opacity: 0.5;
}
.step.active {
opacity: 1;
}
/* Mark the steps that are finished and valid: */
.step.finish {
background-color: #4CAF50;
}
</style>
<script type="text/javascript">
var url = window.location.pathname;
var filename = url.substring(url.lastIndexOf('/')+1);
if(localStorage.a_login=="true" && filename == 'login.html'){
window.location.href = "dashboard.html";
} else if (localStorage.a_login == null) {
window.location.href = "login.html";
}else if(localStorage.a_login=="false" && filename != 'login.html'){
window.location.href = "login.html";
}
</script>
</head>
<body>
<!-- Sidebar -->
<div class="w3-sidebar w3-light-grey w3-card-4 w3-animate-left" style="display:none;width:250px;" id="mySidebar">
<div id="menu">
</div>
<div class="w3-bar-block">
<a id="a_logout" class="w3-bar-item w3-button" href="javascript:;"><i class="fa fa-power-off"></i> Logout</a>
</div>
</div>
<!-- Page Content -->
<div id="main">
<div class="w3-green w3-display-container">
<button class="w3-button w3-green w3-xlarge" id="openNav" onclick="w3_open()"><i class="fa fa-bars"></i></button>
<div class="w3-container">
<img src="img/logo_white.png" style="width: 52px;height: 52px;margin-right:20px;" class="w3-right w3-margin-bottom">
<h1 class="h3" style="float: left;">User Management</h1>
</div>
</div>
</div>
<img src="img/sub_page_bg.jpg" alt="bg" style="width:100%;border-bottom: 5px solid #4CAF50 !important;">
<div class="w3-container w3-margin-bottom">
<form id="regForm">
<div class="w3-card-4 w3-margin-bottom w3-margin-top" style="border: 1px solid #4CAF50 !important;">
<div class="w3-container">
<div class="tab">
<p>
<label class="w3-text-teal"><b>Username</b></label>
<input class="w3-input w3-border w3-light-grey" type="text" id="user">
</p>
<p>
<label class="w3-text-teal"><b>Password</b></label>
<input class="w3-input w3-border w3-light-grey" type="password" id="pass">
</p>
</div>
<div class="tab">
<p>
<label class="w3-text-teal"><b>User Type</b></label>
<select class="w3-select w3-border w3-light-grey" id="type">
<option value="0" selected>Select option</option>
<option value="ADMIN">ADMIN</option>
<option value="USERS">USERS</option>
</select>
</p>
<p>
<label class="w3-text-teal"><b>User Role</b></label>
<select class="w3-select w3-border w3-light-grey" id="role">
<option value="0" selected>Select option</option>
<option value="SYSTEM ADMINISTRATOR">System Administrator</option>
<option value="GENERAL MANAGER">General Manager</option>
<option value="ADMIN OFFICER">Admin Officer</option>
<option value="ADMIN MANAGER">Admin Manager</option>
<option value="MANAGER">Admin Manager</option>
<option value="SECRETARY">Secretary</option>
<option value="ACCOUNTANT">Accountant</option>
<option value="HUMAN RESOURCES">Human Resource</option>
<option value="CASHIER">Cashier</option>
</select>
</p>
</div>
<div class="tab">
<p>
<label class="w3-text-teal"><b>First Name</b></label>
<input class="w3-input w3-border w3-light-grey" type="text" id="fname">
</p>
<p>
<label class="w3-text-teal"><b>Last Name</b></label>
<input class="w3-input w3-border w3-light-grey" type="text" id="lname">
</p>
<p>
<label class="w3-text-teal"><b>Email Address</b></label>
<input class="w3-input w3-border w3-light-grey" type="text" id="email">
</p>
<button style="width: 100%;font-weight: bolder;" class="w3-btn w3-blue-grey w3-round w3-right w3-margin-bottom w3-margin-top" type="button" id="save_user">SAVE</button>
</div>
</div>
</div>
<div style="overflow:auto;">
<button class="w3-btn w3-blue-grey w3-round w3-left" type="button" id="prevBtn" onclick="nextPrev(-1)">Previous</button>
<button class="w3-btn w3-blue-grey w3-round w3-right" type="button" id="nextBtn" onclick="nextPrev(1)">Next</button>
</div>
<!-- Circles which indicates the steps of the form: -->
<div style="text-align:center;margin-top:10px;">
<span class="step"></span>
<span class="step"></span>
<span class="step"></span>
</div>
</form>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script src="ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="js/sa_auth.js"></script>
<script type="text/javascript" src="js/constant.js"></script>
<script type="text/javascript" src="js/func.js"></script>
<script>
var currentTab = 0; // Current tab is set to be the first tab (0)
showTab(currentTab); // Display the crurrent tab
function showTab(n) {
// This function will display the specified tab of the form...
var x = document.getElementsByClassName("tab");
x[n].style.display = "block";
//... and fix the Previous/Next buttons:
if (n == 0) {
document.getElementById("prevBtn").style.display = "none";
} else {
document.getElementById("prevBtn").style.display = "inline";
}
if (n == (x.length - 1)) {
document.getElementById("nextBtn").style.display = "none";
} else {
document.getElementById("nextBtn").innerHTML = "Next";
}
//... and run a function that will display the correct step indicator:
fixStepIndicator(n)
}
function nextPrev(n) {
// This function will figure out which tab to display
var x = document.getElementsByClassName("tab");
// Exit the function if any field in the current tab is invalid:
if (n == 1 && !validateForm()) return false;
// Hide the current tab:
x[currentTab].style.display = "none";
// Increase or decrease the current tab by 1:
currentTab = currentTab + n;
// if you have reached the end of the form...
if (currentTab >= x.length) {
// ... the form gets submitted:
//document.getElementById("regForm").submit();
//return false;
}
// Otherwise, display the correct tab:
showTab(currentTab);
}
function validateForm() {
// This function deals with validation of the form fields
var x, y, i, valid = true;
x = document.getElementsByClassName("tab");
y = x[currentTab].getElementsByTagName("input");
// A loop that checks every input field in the current tab:
for (i = 0; i < y.length; i++) {
// If a field is empty...
if (y[i].value == "") {
// add an "invalid" class to the field:
y[i].className += " invalid";
// and set the current valid status to false
valid = false;
}
}
// If the valid status is true, mark the step as finished and valid:
if (valid) {
document.getElementsByClassName("step")[currentTab].className += " finish";
}
return valid; // return the valid status
}
function fixStepIndicator(n) {
// This function removes the "active" class of all steps...
var i, x = document.getElementsByClassName("step");
for (i = 0; i < x.length; i++) {
x[i].className = x[i].className.replace(" active", "");
}
//... and adds the "active" class on the current step:
x[n].className += " active";
}
</script>
<div style="margin-bottom: 40px;"></div>
<footer id="footer"></footer>
</body>
</html>