-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapply.js
62 lines (48 loc) · 1.75 KB
/
apply.js
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
if (localStorage.getItem('users') == null) {
users = hardcodedUsers();
} else {
users = JSON.parse(localStorage.getItem("users"))
}
console.log(users)
var activeUser = JSON.parse(localStorage.getItem('activeUser'))
console.log(activeUser)
var company= localStorage.getItem('Company')
var city= localStorage.getItem('City')
var code = localStorage.getItem('Code')
console.log(code)
console.log(city)
console.log(company)
document.getElementById("COMPANY").innerHTML = company;
document.getElementById("CITY").innerHTML = city;
document.getElementById("fname").innerHTML = activeUser.fname;
document.getElementById("lname").innerHTML = activeUser.lname;
document.getElementById("userEMail").innerHTML = activeUser.EMail;
document.getElementById("Phonenum").innerHTML = activeUser.Phone;
document.getElementById("linkedinUrl").innerHTML = activeUser.LinkedinUrl;
//checks to see if they have applied to three jobs and if they havent it stores the code into it.
function Apply(){
checkbox = document.getElementById("concent").checked
console.log(checkbox)
if(checkbox == true){
if (activeUser.Applied1 === null){
activeUser.Applied1 = code
localStorage.setItem('activeUser', JSON.stringify(activeUser))
}
else if(activeUser.Applied2 === null ){
activeUser.Applied2 = code
localStorage.setItem('activeUser', JSON.stringify(activeUser))
}
else if (activeUser.Applied3 === null )
{
activeUser.Applied3 = code
localStorage.setItem('activeUser', JSON.stringify(activeUser))
}
window.location="JobList.html";
}
else {
alert("Your concent is required in order to submit your application")
}
}
function back() {
window.location="JobList.html";
}