-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
357 lines (311 loc) · 12.4 KB
/
index.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Job Application</title>
<!-- Font Awesome Icons -->
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Merriweather+Sans:400,700" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic' rel='stylesheet' type='text/css'>
<!-- Plugin CSS -->
<link href="vendor/magnific-popup/magnific-popup.css" rel="stylesheet">
<!-- Theme CSS - Includes Bootstrap -->
<link href="css/creative.min.css" rel="stylesheet">
</head>
<body id="page-top">
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-light fixed-top py-3" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="#page-top">EGM Job Application</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-strong="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto my-2 my-lg-0">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#services">Description</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#apply">Apply</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Masthead -->
<header class="masthead">
<div class="container h-100">
<div class="row h-100 align-items-center justify-content-center text-center">
<div class="col-lg-10 align-self-end">
<h1 class="text-uppercase text-white font-weight-bold">Work with us</h1>
<hr class="divider my-4">
</div>
<div class="col-lg-8 align-self-baseline">
<p class="text-white-75 font-weight-light mb-5">Friendly and supportive work environment.</p>
</div>
</div>
</div>
</header>
<!-- Services Section -->
<section class="page-section" id="services">
<div class="container">
<h2 class="text-center mt-0" name="name" id="name"></h2>
<hr class="divider my-4">
<div class="row">
<div class="col-lg-6 col-md-6 text-left">
<div class="mt-5">
<h3 class="h4 mb-2">DESCRIPTION</h3>
<p class="text-muted mb-0" name="description" id="description"></p>
</div>
</div>
<div class="col-lg-6 col-md-6 text-left">
<div class="mt-5">
<h3 class="h4 mb-2">REQUIREMENTS</h3>
<p class="text-muted mb-0" name="requirement" id="requirement"></p>
</div>
</div>
</div>
</div>
</section>
<!-- Contact Section -->
<section class="page-section" id="apply">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-8 text-center">
<h2 class="mt-0">Apply For This Job</h2>
<hr class="divider my-4">
<div class="text-left">
<form id="frmContact">
<div id="alert_error_message" class="alert alert-danger collapse" role="alert">
<i class="fa fa-exclamation-triangle"></i>
Please check in on some of the fields below.
<button type="button" class="close" data-dismiss="alert" aria-strong="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div id="alert_sucess_message" class="alert alert-success collapse" role="alert">
Information successfully sent!
<button type="button" class="close" data-dismiss="alert" aria-strong="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="form-group">
<strong for="exampleInputEmail1">First Name <i class="text-danger">*</i></strong>
<input type="text" class="form-control" id="firstname" name="firstname" placeholder="Enter first name" maxlength="50">
<div id="firstname_error_message" class="text-danger"></div>
</div>
<div class="form-group">
<strong>Last Name <i class="text-danger">*</i></strong>
<input type="text" class="form-control" id="lastname" name="lastname" placeholder="Enter last name" maxlength="50">
<div id="lastname_error_message" class="text-danger"></div>
</div>
<div class="form-group">
<strong>E-mail <i class="text-danger">*</i></strong>
<input type="email" class="form-control" id="email" name="email" placeholder="Enter first email" maxlength="50">
<div id="email_error_message" class="text-danger"></div>
</div>
<div class="form-group">
<strong>Phone <i class="text-danger">*</i></strong>
<input type="text" class="form-control" id="phone" name="phone" placeholder="Enter last phone" maxlength="20">
<div id="phone_error_message" class="text-danger"></div>
</div>
<div class="form-group">
<strong>Address <i class="text-danger">*</i></strong>
<input type="text" class="form-control" id="address" name="address" placeholder="Enter first address" maxlength="50">
<div id="address_error_message" class="text-danger"></div>
</div>
<div class="form-group">
<strong>Resume <i class="text-danger">*</i></strong>
<div class="custom-file">
<input type="file" id="resume" name="resume" class="custom-file-input" accept=".pdf,.doc">
<label class="custom-file-label">Choose file...</label>
<div id="resume_error_message" class="text-danger"></div>
</div>
</div>
<button type="button" id="submit" class="btn btn-primary btn-block">SUBMIT APPLICATION</button>
</form>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="bg-light py-5">
<div class="container">
<div class="small text-center text-muted">Copyright © 2019 - EGMedia</div>
</div>
</footer>
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Plugin JavaScript -->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<script src="vendor/magnific-popup/jquery.magnific-popup.min.js"></script>
<!-- Custom scripts for this template -->
<script src="js/creative.min.js"></script>
</body>
</html>
<script>
$(function() {
// Get position data
getPosition();
// Get the name of the file appear on select
$(".custom-file-input").on("change", function() {
var fileName = $(this).val().split("\\").pop();
$(this).siblings(".custom-file-label").addClass("selected").html(fileName);
});
function clear(){
$('#frmContact')[0].reset();
$(".custom-file-input").siblings(".custom-file-label").addClass("selected").html("Choose file...");
}
$('#submit').click(function(){
submit();
});
$(document).keypress(function(e) {
if(e.which == 13) {
submit();
}
});
var error_firstname = false;
var error_lastname = false;
var error_email = false;
var error_phone = false;
var error_address= false;
var error_resume= false;
$("#firstname").focusout(function() {
check_firstname();
});
$("#lastname").focusout(function() {
check_lastname();
});
$("#email").focusout(function() {
check_email();
});
$("#phone").focusout(function() {
check_phone();
});
$("#address").focusout(function() {
check_address();
});
$("#resume").focusout(function() {
check_resume();
});
function check_firstname() {
if ($.trim($('#firstname').val()) == '') {
$("#firstname_error_message").html("Input is blank!");
$("#firstname_error_message").show();
error_firstname = true;
} else {
$("#firstname_error_message").hide();
}
}
function check_lastname() {
if ($.trim($('#lastname').val()) == '') {
$("#lastname_error_message").html("Input is blank!");
$("#lastname_error_message").show();
error_lastname = true;
} else {
$("#lastname_error_message").hide();
}
}
function check_email() {
var pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/i);
if ($.trim($('#email').val()) == '') {
$("#email_error_message").html("Input is blank!");
$("#email_error_message").show();
error_email = true;
} else if (!(pattern.test($("#email").val()))) {
$("#email_error_message").html("Invalid email address");
$("#email_error_message").show();
error_email = true;
} else {
$("#email_error_message").hide();
}
}
function check_phone() {
if ($.trim($('#phone').val()) == '') {
$("#phone_error_message").html("Input is blank!");
$("#phone_error_message").show();
error_phone = true;
} else {
$("#phone_error_message").hide();
}
}
function check_address() {
if ($.trim($('#address').val()) == '') {
$("#address_error_message").html("Input is blank!");
$("#address_error_message").show();
error_address = true;
} else {
$("#address_error_message").hide();
}
}
function check_resume() {
if ($('#resume').get(0).files.length === 0) {
$("#resume_error_message").html("No files selected.!");
$("#resume_error_message").show();
error_resume = true;
} else {
$("#resume_error_message").hide();
}
}
function submit(){
error_firstname = false;
error_lastname = false;
error_email = false;
error_phone = false;
error_address = false;
error_resume = false;
check_firstname();
check_lastname();
check_email();
check_phone();
check_address();
check_resume();
if (error_firstname == false && error_lastname == false && error_email == false && error_phone == false && error_address == false && error_resume == false) {
var formData = new FormData(document.getElementById("frmContact"));
$.ajax({
url: "candidate.php",
type: "post",
dataType: "html",
data: formData,
cache: false,
contentType: false,
processData: false,
beforeSend:function(){
$('#submit').attr('disabled', 'disabled');
$('#submit').val('Sending...');
},
success:function(data){
$("#alert_sucess_message").show();
$("#alert_error_message").hide();
$('#submit').attr('disabled', false);
$('#submit').val($('#action').val());
clear();
}
});
} else {
$("#alert_sucess_message").hide();
$("#alert_error_message").show();
return false;
}
}
});
function getPosition(){
$.ajax({
type:"POST",
data:"",
url:"getPosition.php",
success:function(data){
data=jQuery.parseJSON(data);
$('#name').text(data['position_name']);
$('#description').text(data['position_description']);
$('#requirement').text(data['position_requirement']);
}
});
}
</script>