-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdd Supervisor.php
456 lines (315 loc) · 13.3 KB
/
Add Supervisor.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
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
<?php session_start() ?>
<?php
if (empty($_SESSION["NIC"]) or empty($_SESSION["Name"])){
session_unset();
session_destroy ();
header('location:index.html');
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Parking Reservation System</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="b.css" >
<link rel="stylesheet" type="text/css" href="fontawesome-free-5.3.1-web/css/all.css">
<link rel="stylesheet" type="text/css" href="sidebar.CSS">
<link rel="stylesheet" href="pretty-checkbox.min.css" />
<link rel="stylesheet" type="text/css" href="my-login.css">
<script src="jq.js" ></script>
<script src="pop.js"> </script>
<script src="b.js"> </script>
<style type="text/css">
.btn-success{
background-image: linear-gradient(to bottom,#00A300 0,#339266 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFE85B54', endColorstr='#FFB22520', GradientType=0);
border-color: #00A300;
box-shadow: inset 0 1px 0 rgba(242,164,162,.6), 0 1px 2px rgba(0,0,0,.05);
}
.btn-outline-success{
box-shadow:0 0 0 2px #00CC00;
}
.btn-success{
background-image: linear-gradient(to bottom,#00A300 0,#339266 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFE85B54', endColorstr='#FFB22520', GradientType=0);
border-color: #00A300;
box-shadow: inset 0 1px 0 rgba(242,164,162,.6), 0 1px 2px rgba(0,0,0,.05);
}
</style>
</head>
<body>
<nav style="height: 54px;" class="navbar navbar-expand-sm bg-dark navbar-dark justify-content-end pl-1 fixed-top">
<i style="padding: .25rem .5rem;color: white;
font-size: .875rem;
line-height: 1.5;" id="toggle-sidebar" class="fas fa-bars pl-0 bar"></i><i class="fas fa-car-alt fa-2x " style="color: white;"></i>
<a class="navbar-brand mr-auto ml-2"
style="font-size: large;" href="#">Parking Reservation System</a>
<button onclick="window.location.href = 'Log_Out.php';" class="btn btn-sm btn-success mr-2 ml-auto">Log Out <i class="fas fa-sign-out-alt" style="color: white;"></i></button> <!-- <button class="btn btn-sm btn-success mr-4 ml-auto">Log Out <i class="fas fa-sign-out-alt" style="color: white;"></i></button>
<button class="navbar-toggler btn-sm" type="button" data-toggle="collapse" data-target="#navbarSupportedContent">
<span class="navbar-toggler-icon btn-sm"></span>
</button>
<div class="collapse navbar-collapse flex-grow-0" id="navbarSupportedContent">
<ul class="navbar-nav text-right">
<li class="nav-item">
<i class="fas fa-people-carry" style="color: white;"></i> <a class="navbar-text" style="color: white;">Mr. L.S. Jayawardana.</a>
</li>
</ul>
</div>-->
</nav>
<div class="page-wrapper chiller-theme mt-5">
<nav id="sidebar" class="sidebar-wrapper" style="margin-top: 54px;">
<div class="sidebar-content">
<div class="sidebar-header">
<div class="user-pic">
<img class="img-responsive img-rounded" src="https://raw.githubusercontent.com/azouaoui-med/pro-sidebar-template/gh-pages/bootstrap4/assets/img/user.jpg" alt="User picture">
</div>
<div class="user-info">
<span class="user-name">
<strong><?php echo $_SESSION['NameF'] ?></strong>
</span>
<span class="user-role"><?php echo $_SESSION['Type'] ?></span>
<span class="user-status">
<i class="fa fa-circle"></i>
<span >Online</span>
</span>
</div>
</div>
<div class="sidebar-menu">
<ul>
<li class="header-menu">
<span>Services</span>
</li>
<?php
if ($_SESSION['Type']=="Admin"){
echo '<li >
<a href="Add Supervisor.php">
<i class="fas fa-user-plus"></i>
<span style="font-size: 17px;color: white;">Add Supervisor</span>
</a>
</li> <li >
<a href="Manage Slot.php" >
<i class="far fa-edit"></i>
<span>Manage Parking Slots</span>
</a>
</li><li >
<a href="Manage Supervisor.php">
<i class="fas fa-user-tie"></i>
<span>Manage Supervisor</span>
</a>
</li>';
}
?>
<li >
<a href="Manage Customer.php">
<i class="fas fa-user-edit"></i>
<span>Manage Customer</span>
</a>
</li>
<li >
<a href="Parking Details.php">
<i class="fas fa-parking"></i>
<span>Parking Details</span>
</a>
</li>
<li >
<a href="View Map.php">
<i class="fas fa-eye"></i>
<span>View Map</span>
</a>
</li>
<li >
<a href="Bill Payment.php">
<i class="fas fa-file-invoice-dollar"></i>
<span>Pending Bills</span>
</a>
</li>
</ul>
</div>
<!-- sidebar-menu -->
</div>
<!-- sidebar-content -->
<div class="sidebar-footer">
<a href="Manage System Settings.php" data-toggle="tooltip" data-placement="top" title="Manage System Settings">
<i class="fa fa-cog"></i>
<span class="badge-sonar"></span>
</a>
<a href="Log_Out.php" data-toggle="tooltip" data-placement="top" title="Log Out">
<i class="fa fa-power-off" ></i>
</a>
</div>
</nav>
<!-- sidebar-wrapper -->
<main class="page-content pb-5" style="overflow: visible;">
<body class="my-login-page">
<section class="h-100">
<div class="container h-100" style="display: flex;justify-content: space-around; ">
<div class="row justify-content-md-center h-100">
<div class="card-wrapper">
<div class="card fat">
<div class="card-body">
<h4 class="card-title">Supervisor Registration Form</h4>
<form name="myform">
<div class="form-group row" >
<div class="col-xs-12 col-sm-6 col-md-6" >
<label for="First">First Name</label>
<input id="First" type="text" class="form-control input-lg" name="First" maxlength="20" required autofocus></div>
<div class="col-xs-12 col-sm-6 col-md-6" ><label for="Last">Last Name</label>
<input id="Last" type="text" class="form-control input-lg" maxlength="20" name="Last" required></div>
</div>
<div class="form-group">
<label for="NIC">NIC</label>
<input id="NIC" type="text" class="form-control" maxlength="10" name="NIC" required>
</div>
<div class=" row" >
<div class="form-group col-xs-12 col-sm-6 col-md-6">
<label for="password">Password</label>
<input id="password" type="password" class="form-control" maxlength="10" name="Password" required data-eye>
</div>
<div class="form-group col-xs-12 col-sm-6 col-md-6">
<label for="Confirm Password">Confirm Password</label>
<input id="confirm_password" type="password" class="form-control" name="CPassword" required data-eye >
</div>
</div>
<div class="form-group">
<label for="email">E-Mail Address</label>
<input id="email" type="email" class="form-control" maxlength="40" name="Email" required>
</div>
<div class="form-group">
<label for="Cont_No">Contact No</label>
<input id="Cont_No" type="number" class="form-control" maxlength="10" name="Cont_No" required>
</div>
<div class="form-group">
<label for="Address">Address</label>
<textarea id="Address" type="text" class="form-control" rows="2" name="Address" ></textarea>
</div>
<div class="form-group">
<?php include("PHP.php");
$getcustomer = new Database();
$query= "SELECT MAX(Super_ID) AS maxid FROM user;";
$result = $getcustomer->Query($query) ;
if ($result) {
$row=mysqli_fetch_array($result);
echo '<label for="">Supervisor ID</label>
<div id="">
<input id="" readonly="readonly" type="number" class="form-control" name="superid" required="required" value="'. ($row['maxid'] + 1) .'" > </div>';
}
?>
</div>
<div class="form-group">
<label>
<input type="checkbox" name="agree" value="1" required="required"> I agree to the Terms and Conditions
</label>
</div>
<div class="form-group no-margin">
<button type="submit" name="regsubmit" class="btn btn-primary btn-block" id="reg"
>
Register
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
</body>
</main>
<!-- page-content" -->
</div>
</body>
<script src="my-login.js"></script>
<script>
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
jQuery(function ($) {
$(".sidebar-dropdown > a").click(function () {
$(".sidebar-submenu").slideUp(200);
if ($(this).parent().hasClass("active")) {
$(".sidebar-dropdown").removeClass("active");
$(this).parent().removeClass("active");
} else {
$(".sidebar-dropdown").removeClass("active");
$(this).next(".sidebar-submenu").slideDown(200);
$(this).parent().addClass("active");
}
});
$("#toggle-sidebar").click(function () {
$(".page-wrapper").toggleClass("toggled");
});
});
$(".blink").each(function(){
console.log($(this).css('border-width') );
if (parseInt($(this).css('border-width')) <=0){
var ff= $(this).css('background-color');
console.log(ff);
$(this).css('border-color',ff) ;
}
});
$(function() {
/* "return validation()" */
$('form').on('submit', function (e) {
console.log($('form').serialize());
e.preventDefault();
$b= validation();
if ($b){
$.ajax({
dataType: 'json',
cache: false,
type:'POST',
beforeSend: function(){
loading(true);
},
url:'Add_Registration.php',
data: $('form').serialize(),
success:function(data){
if(data.errno==1062){
alert("Sorry ! Your Email or NIC were already used.");
}else if(data.success=="Registration successfully"){
alert("Registration successfully!");
window.location.href = "Add Supervisor.php";
exit();
}else{
alert("Sorry ! Something Wrong ! .");
}
} , error: function(xhr,stat , error){
alert("An error occured: " + xhr.status + " " + error);
}
,
complete: function(){
loading(false);
}
});
}
});
});
function loading(b){
if (b==true){
$("#reg").prop('disabled', true);
$('.form-control').prop('disabled', true);
$("#reg").html("<i class='fa fa-circle-o-notch fa-spin'></i>Sending Data..");
/* setTimeout(function() {
$("#reg").prop('disabled', false);
$('.form-control').prop('disabled', false);
$("#reg").html("Register");
}, 15000);*/
}else{
$("#reg").prop('disabled', false);
$('.form-control').prop('disabled', false);
$("#reg").html("Register");
}
}
function validation(){
var x= document.forms["myform"]["Password"].value ;
var y = document.forms["myform"]["CPassword"].value ;
if(x != y) {
alert("Your Passsword is not matched");
return false;
} else{
return true;
}
}
</script>
</html>