-
Notifications
You must be signed in to change notification settings - Fork 2
/
signup.php
507 lines (470 loc) · 21.8 KB
/
signup.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
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
<!DOCTYPE html>
<?php
/**
* CodeWork : Freelancing Platform
* Copyright (c) CodeWork (https://github.com/gaurangkumar/codework).
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) CodeWork (https://github.com/gaurangkumar/codework)
*
* @link http://codework.ml/
* @since 1.0.0
*
* @license MIT License (https://opensource.org/licenses/mit-license.php)
* @auther GaurangKumar Parmar <gaurangkumarp@gmail.com>
* Krunal Bhavsar
* @filename index.php
*/
require 'include/config.php';
require 'include/db.php';
if (isset($_SESSION['USER_ID']) && !empty($_SESSION['USER_ID'])) {
header('Location: '.$_SESSION['USER_TYPE'].'.php');
exit;
}
?>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="IE=11.0000" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Signup - CodeWork</title>
<link href="<?=$favicon?>" rel="shortcut icon">
<link href="<?=$favicon?>" rel="icon" type="image/x-icon" />
<!-- Bootstrap Core CSS -->
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
<link href="vendor/simple-line-icons/css/simple-line-icons.css" rel="stylesheet">
<!-- page css -->
<link href="asset/dist/css/pages/login-register-lock.css" rel="stylesheet">
<!-- page css -->
<link href="asset/dist/css/pages/file-upload.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="asset/css/stylish-portfolio.min.css" rel="stylesheet">
<style>
.help {
font-size: 16px
}
.navbar-brand {
font-size: 24px;
text-shadow: 1px 1px 2px #FFFFFF, 0 0 1em #005500, 0 0 0.2em blue;
}
.nav-link {
font-size: 20px;
text-shadow: 1px 1px 2px #FFFFFF, 0 0 1em #005500, 0 0 0.2em blue;
}
.btn-rounded{border-radius:60px;padding:7px 18px}.btn-group-lg>.btn-rounded.btn,.btn-rounded.btn-lg{padding:.75rem 1.5rem}.btn-group-sm>.btn-rounded.btn,.btn-rounded.btn-sm{padding:.25rem .5rem;font-size:12px}.btn-rounded.btn-xs{padding:.25rem .5rem;font-size:10px}.btn-rounded.btn-md{padding:12px 35px;font-size:16px}
.form-material .form-group{overflow:hidden}.form-material .form-control{background-color:rgba(0, 0, 0, 0);background-position:center bottom, center calc(100% - 1px);background-repeat:no-repeat;background-size:0 2px, 100% 1px;padding:0;-webkit-transition:background 0s ease-out 0s;-o-transition:background 0s ease-out 0s;transition:background 0s ease-out 0s}.form-material .form-control,.form-material .form-control.focus,.form-material .form-control:focus{background-image:-webkit-gradient(linear, left top, left bottom, from(#fb9678), to(#fb9678)), -webkit-gradient(linear, left top, left bottom, from(#e9ecef), to(#e9ecef));background-image:-webkit-linear-gradient(#fb9678, #fb9678), -webkit-linear-gradient(#e9ecef, #e9ecef);background-image:-o-linear-gradient(#fb9678, #fb9678), -o-linear-gradient(#e9ecef, #e9ecef);background-image:linear-gradient(#fb9678, #fb9678), linear-gradient(#e9ecef, #e9ecef);border:0 none;border-radius:0;-webkit-box-shadow:none;box-shadow:none;float:none}.form-material .form-control.focus,.form-material .form-control:focus{background-size:100% 2px, 100% 1px;outline:0 none;-webkit-transition-duration:0.3s;-o-transition-duration:0.3s;transition-duration:0.3s}
.form-control-line .form-group {
overflow:hidden
}
.form-control-line .form-control {
border:0px;
border-radius:0px;
padding-left:0px;
border-bottom:1px solid #e9ecef
}
.form-control-line .form-control:focus {
border-bottom:1px solid #fb9678
}
</style>
</head>
<body id="page-top">
<!-- Header -->
<?php
require 'include/header.php';
?>
<header class="masthead">
<div class="container text-center">
<!--<h2 class="mx-auto mb-5"></h2>-->
<div class="sinup-box card">
<div class="card-body">
<form class="form-material form-horizontal m-t-40 needs-validation" id="signupForm" action="include/add-user.php" method="post" novalidate enctype="multipart/form-data">
<h3 class="text-center m-b-20">Sign Up</h3>
<div class="form-group">
<?php
if (!isset($_SESSION['msg']) || $_SESSION['msg'] == '') {
} else {
?>
<div class="alert alert-<?=$_SESSION['msg']['type']?> alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?=$_SESSION['msg']['msg']?>
</div>
<?php
$_SESSION['msg'] = '';
unset($_SESSION['msg']);
}
?>
</div>
<div class="form-group">
<div class="col-xs-12 text-danger text-left">
<input type="text" id="name" name="name" class="form-control form-control-line form-control-success" placeholder="Name" required value="">
<div class="invalid-feedback help text-left">
Please enter your full name.
</div>
</div>
</div>
<div class="form-group">
<div class="col-xs-12 text-danger text-left" id="eml">
<input type="email" id="email" name="email" class="form-control form-control-line" placeholder="Email" required="" value="" autocomplete="off" >
<div class="invalid-feedback help text-left">
Please enter your email.
</div>
</div>
</div>
<div class="form-group">
<div class="col-xs-12 text-danger text-left">
<input type="password" id="password" name="password" class="form-control form-control-line" placeholder="Password" required="" value="">
<div class="invalid-feedback help text-left">
Please enter your password.
</div>
</div>
</div>
<div class="form-group">
<div class="col-xs-12 text-danger text-left">
<input type="password" id="cpassword" name="cpassword" class="form-control form-control-line" placeholder="Confirm Password" required="" value="">
<div class="invalid-feedback help text-left">
Please enter your password again.
</div>
</div>
</div>
<div class="form-group">
<div class="col-xs-12 text-danger text-left">
<select class="form-control form-control-line custom-select" id="usertype" name="usertype" required>
<option value="">User Type </option>
<option value="freelancer">Freelancer</option>
<option value="client">Client</option>
</select>
<div class="invalid-feedback help text-left">
Please select your user type.
</div>
</div>
</div>
<div class="form-group" id="langInput" style="display: none">
<div class="col-xs-12 text-danger text-left">
<input type="text" id="lang" name="lang" class="form-control form-control-line form-control-success" placeholder="Programming Langauge" required value="">
<div class="invalid-feedback help text-left">
Please enter your Programming Langauge.
</div>
</div>
</div>
<div class="form-group" id="cvInput" style="display: none">
<div class="col-xs-12 text-danger text-left">
<label class="pull-left text-primary" for="cv">Resume Upload</label>
<input type="file" id="cv" name="cv" class="form-control form-control-line" required>
<div class="invalid-feedback help text-left">
Please upload your resume.
</div>
</div>
</div>
<div class="form-group" id="idInput" style="display: none">
<div class="col-xs-12 text-danger text-left">
<label class="pull-left text-primary" for="id">ID-Proof Upload</label>
<input type="file" id="id" name="id" class="form-control form-control-line" required>
<div class="invalid-feedback help text-left">
Please upload your ID-Proof.
</div>
</div>
</div>
<div class="form-group">
<div class="col-xs-12">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="agree" name="agree" value="agree" required>
<label class="custom-control-label" for="agree">
I agree to all <a href="javascript:void(0)">Terms</a>
</label>
<div class="invalid-feedback help">
Please agree our policy.
</div>
</div>
<!--div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="agree" name="agree" value="agree" required>
<label class="custom-control-label" for="agree">I agree to all <a href="javascript:void(0)">Terms</a></label>
<div class="invalid-feedback help">
Please agree our policy.
</div>
</div-->
</div>
</div>
<div class="form-group text-center p-b-20">
<div class="col-xs-12">
<button class="btn btn-info btn-lg btn-block btn-rounded text-uppercase waves-effect waves-light" type="submit" id="signupBtn">Sign Up</button>
</div>
</div>
<div class="form-group m-b-0">
<div class="col-sm-12 text-center">
Already have an account? <a href="login.php" class="text-info m-l-5"><b>Login</b></a>
</div>
</div>
</form>
</div>
</div>
</div>
</header>
<!-- Footer -->
<?php
require 'include/footer.php';
?>
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded js-scroll-trigger" href="#page-top">
<i class="fa fa-angle-up"></i>
</a>
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="/vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<!-- Bootstrap tether Core JavaScript -->
<script src="vendor/popper/popper.min.js"></script>
<!-- Plugin JavaScript -->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom scripts for this template -->
<script src="asset/js/stylish-portfolio.min.js"></script>
<!--Wave Effects -->
<script src="asset/dist/js/waves.js"></script>
<!--Menu sidebar -->
<script src="asset/dist/js/sidebarmenu.js"></script>
<!--stickey kit -->
<script src="assets/node_modules/sticky-kit-master/dist/sticky-kit.min.js"></script>
<script src="assets/node_modules/sparkline/jquery.sparkline.min.js"></script>
<!--Custom JavaScript -->
<script src="asset/dist/js/custom.min.js"></script>
<!-- ============================================================== -->
<!-- This page plugins -->
<!-- ============================================================== -->
<script src="asset/dist/js/pages/jasny-bootstrap.js"></script>
<script src="asset/js/jquery.validate.min.js"></script>
<script>
$.validator.setDefaults( {
submitHandler: function () {
$('#signupBtn').html('Signup <div class="spinner-border text-secondary float-right" role="status"><span class="sr-only">Loading...</span></div>');
$('#signupBtn').attr('disabled','disabled');
$('#signupForm').attr('disabled','disabled');
$('#signupForm').addClass('disabled');
$('#name').attr('readonly','readonly');
$('#email').attr('readonly','readonly');
$('#password').attr('readonly','readonly');
$('#cpassword').attr('readonly','readonly');
$('#usertype').attr('readonly','readonly');
$('#lang').attr('readonly','readonly');
$('#cv').attr('readonly','readonly');
$('#id').attr('readonly','readonly');
$('#agree').attr('readonly','readonly');
$( "#signupForm" ).submit();
//$( "#btn" ).html('');
//alert( "submitted!" );
}
} );
$( document ).ready( function () {
$( "#signupForm" ).validate( {
rules: {
name: {
required: true,
minlength: 5
},
email: {
required: true,
email: true
},
password: {
required: true,
minlength: 6
},
cpassword: {
required: true,
minlength: 6,
equalTo: "#password"
},
usertype: "required",
cv: "required",
id: "required",
agree: "required"
},
messages: {
name: {
required: "Please enter your full name",
minlength: "Your name must consist of at least 5 characters"
},
email: "Please enter a valid email",
password: {
required: "Please provide a password",
minlength: "Your password must be at least 6 characters long"
},
cpassword: {
required: "Please provide a password",
minlength: "Your password must be at least 6 characters long",
equalTo: "Please enter the same password as above"
},
usertype: "Please select your usertype",
cv: "Please upload your resume",
id: "Please upload yourr ID-Proof",
agree: "Please accept our policy"
},
errorElement: "em",
errorPlacement: function ( error, element ) {
// Add the `help-block` class to the error element
error.addClass( "help-block" );
// Add `has-feedback` class to the parent div.form-group
// in order to add icons to inputs
element.parents( ".col-xs-12" ).addClass( "has-feedback" );
if ( element.prop( "type" ) === "checkbox" ) {
error.insertAfter( element.parent( "label" ) );
} else {
error.insertAfter( element );
}
},
success: function ( label, element ) {
// Add the span element, if doesn't exists, and apply the icon classes to it.
if ( !$( element ).next( "span" )[ 0 ] ) {
$( "<span class='glyphicon glyphicon-ok form-control-feedback'></span>" ).insertAfter( $( element ) );
}
},
highlight: function ( element, errorClass, validClass ) {
$( element ).parents( ".col-xs-12" ).addClass( "has-error" ).removeClass( "has-success" );
$( element ).next( "span" ).addClass( "glyphicon-remove" ).removeClass( "glyphicon-ok" );
},
unhighlight: function (element, errorClass, validClass) {
$( element ).parents( ".col-xs-12" ).addClass( "has-success" ).removeClass( "has-error" );
$( element ).next( "span" ).addClass( "glyphicon-ok" ).removeClass( "glyphicon-remove" );
}
} );
} );
/*
*/
</script>
<!-- Custom Theme JavaScript -->
<script>
/*
$(function() {
$("#signupForm input,#signupForm select").jqBootstrapValidation({
preventSubmit: true,
submitError: function($form, event, errors) {
alert(0);
// additional error messages or events
},
submitSuccess: function($form, event) {
alert(1);
event.preventDefault(); // prevent default submit behaviour
// get values from FORM
var name = $("input#name").val();
var email = $("input#email").val();
var phone = $("input#phone").val();
var message = $("textarea#message").val();
var firstName = name; // For Success/Failure Message
// Check for white space in name for Success/Fail message
if (firstName.indexOf(' ') >= 0) {
firstName = name.split(' ').slice(0, -1).join(' ');
}
$this = $("#sendMessageButton");
$this.prop("disabled", true); // Disable submit button until AJAX call is complete to prevent duplicate messages
$.ajax({
url: "../../include/contact_me.php",
type: "POST",
data: {
name: name,
phone: phone,
email: email,
message: message
},
cache: false,
success: function() {
// Success message
$('#success').html("<div class='alert alert-success'>");
$('#success > .alert-success').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×")
.append("</button>");
$('#success > .alert-success')
.append("<strong>Your message has been sent. </strong>");
$('#success > .alert-success')
.append('</div>');
//clear all fields
$('#contactForm').trigger("reset");
},
error: function() {
// Fail message
$('#success').html("<div class='alert alert-danger'>");
$('#success > .alert-danger').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×")
.append("</button>");
$('#success > .alert-danger').append($("<strong>").text("Sorry " + firstName + ", it seems that my mail server is not responding. Please try again later!"));
$('#success > .alert-danger').append('</div>');
//clear all fields
$('#contactForm').trigger("reset");
},
complete: function() {
setTimeout(function() {
$this.prop("disabled", false); // Re-enable submit button when AJAX call is complete
}, 1000);
}
});
},
filter: function() {
return $(this).is(":visible");
},
});
$("a[data-toggle=\"tab\"]").click(function(e) {
e.preventDefault();
$(this).tab("show");
});
});
*/
$('#name').focus(function() {
$('#success').html('');
});
$('#usertype').change(function(e) {
if($('#usertype').val() == 'freelancer') {
$("#cvInput").show();
$("#idInput").show();
$("#langInput").show();
}
else {
$("#cvInput").hide();
$("#idInput").hide();
$("#langInput").hide();
}
});
// Closes the sidebar menu
$("#menu-close").click(function(e) {
e.preventDefault();
$("#sidebar-wrapper").toggleClass("active");
});
// Opens the sidebar menu
$("#menu-toggle").click(function(e) {
e.preventDefault();
$("#sidebar-wrapper").toggleClass("active");
});
// Scrolls to the selected menu item on the page
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') || location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
</script>
<!--Custom JavaScript -->
<script type="text/javascript">
$(function() {
$(".preloader").fadeOut();
});
$(function() {
$('[data-toggle="tooltip"]').tooltip()
});
// ==============================================================
// Login and Recover Password
// ==============================================================
$('#to-recover').on("click", function() {
$("#loginform").slideUp();
$("#recoverform").fadeIn();
});
</script>
</body>
</html>