-
Notifications
You must be signed in to change notification settings - Fork 0
/
submit_application.php
116 lines (111 loc) · 3.56 KB
/
submit_application.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
<?php include 'admin/db_connect.php' ?>
<?php
$qry = $conn->query("SELECT * FROM vacancy where id=".$_GET['id'])->fetch_array();
foreach($qry as $k =>$v){
$$k = $v;
}
?>
<div class="container-fluid">
<form id="manage-application">
<input type="hidden" name="id" value="">
<input type="hidden" name="position_id" value="<?php echo $_GET['id'] ?>">
<div class="col-md-12">
<div class="row">
<h3>Application Form for <?php echo $position ?></h3>
</div>
<hr>
<div class="row form-group">
<div class="col-md-4">
<label for="" class="control-label">Last Name</label>
<input type="text" class="form-control" name="lastname" required="">
</div>
<div class="col-md-4">
<label for="" class="control-label">First Name</label>
<input type="text" class="form-control" name="firstname" required="">
</div>
<div class="col-md-4">
<label for="" class="control-label">Middle Name</label>
<input type="text" class="form-control" name="middlename" required="">
</div>
</div>
<div class="row form-group">
<div class="col-md-4">
<label for="" class="control-label">Gender</label>
<select name="gender" id="" class="custom-select browser-default">
<option>Male</option>
<option>Female</option>
</select>
</div>
<div class="col-md-4">
<label for="" class="control-label">Email</label>
<input type="email" class="form-control" name="email" required="">
</div>
<div class="col-md-4">
<label for="" class="control-label">Contact</label>
<input type="text" class="form-control" name="contact" required="">
</div>
</div>
<div class="row form-group">
<div class="col-md-7">
<label for="" class="control-label">Address</label>
<textarea name="address" id="" cols="30" rows="3" required class="form-control"></textarea>
</div>
</div>
<div class="row form-group">
<div class="col-md-7">
<label for="" class="control-label">Cover Letter</label>
<textarea name="cover_letter" id="" cols="30" rows="3" placeholder="(Optional)" class="form-control"></textarea>
</div>
</div>
<div class="row form-group">
<div class="input-group col-md-4 mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="">Resume</span>
</div>
<div class="custom-file">
<input type="file" class="custom-file-input" id="resume" onchange="displayfname(this,$(this))" name="resume" accept="application/msword,text/plain, application/pdf">
<label class="custom-file-label" for="resume">Choose file</label>
</div>
</div>
</div>
</div>
</form>
</div>
<script>
function displayfname(input,_this) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
console.log(input.files[0].name)
_this.siblings('label').html(input.files[0].name);
}
reader.readAsDataURL(input.files[0]);
}
}
$(document).ready(function(){
$('#manage-application').submit(function(e){
e.preventDefault()
start_load()
$.ajax({
url:'admin/ajax.php?action=save_application',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
error:err=>{
console.log(err)
},
success:function(resp){
if(resp == 1){
alert_toast('Application successfully submitted.','success')
setTimeout(function(){
location.reload()
},1000)
}
}
})
})
})
</script>