-
Notifications
You must be signed in to change notification settings - Fork 1
/
resumesManagement.php
306 lines (258 loc) · 9.26 KB
/
resumesManagement.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
<?php
session_start();
if(isset($_SESSION['username'])){
require_once "connection.php";
$sql="SELECT cand.candidate_id,
cand.candidate_firstname,
cand.candidate_lastname,
cand.candidate_email,
cand.candidate_phone,
cand.candidate_address,
cand.created_date,
fil.file_name
FROM tbl_candidate AS cand
INNER JOIN tbl_file as fil
ON cand.file_id=fil.file_id";
$result=mysqli_query($connection,$sql);
?>
<!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>Resumes Management System</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-dark bg-dark fixed-top py-3" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger text-light" 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 text-light" href="positionForm.php">Position</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger text-light" href="logout.php">Logout</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Resumes Management Section -->
<section class="page-section" id="apply">
<div class="container">
<h2 class="mt-0 text-center">Resume Management</h2>
<hr class="divider my-4">
<table class="table table-hover table-condensed table-bordered">
<thead class="p-3 mb-2 bg-light font-weight-bold">
<tr>
<th scope="col">No.</th>
<th scope="col">First Name</th>
<th scope="col">Last Name</th>
<th scope="col">E-mail</th>
<th scope="col">Phone</th>
<th scope="col">Address</th>
<th scope="col">Sent Date</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody >
<?php
while ($row=mysqli_fetch_row($result)) {
?>
<tr >
<td><?php echo $row[0] ?></td>
<td><?php echo $row[1] ?></td>
<td><?php echo $row[2] ?></td>
<td><?php echo $row[3] ?></td>
<td><?php echo $row[4] ?></td>
<td><?php echo $row[5] ?></td>
<td><?php echo $row[6] ?></td>
<td class="text-center"">
<a class="btn btn-primary" role="button" href="files/<?php echo $row[7] ?>" class="waves-effect waves-light btn indigo darken-4" download>Download</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</section>
<br><br>
<!-- Footer -->
<footer class="bg-light py-5 fixed-bottom">
<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>
<?php
}else{
header("location:login.html");
}
?>
<script>
$(function() {
// Add the following code if you want 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();
});
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;
}
}
});
</script>