-
Notifications
You must be signed in to change notification settings - Fork 0
/
createController.js
98 lines (93 loc) · 2.39 KB
/
createController.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
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
app.controller('createController', function($scope, Upload, $rootScope, $http){
$scope.createCandidate = function(candidate_info, file){
var skills = '';
if (candidate_info.skills1){
skills += '1';
}
else{
skills += '0';
}
if (candidate_info.skills2){
skills += '1';
}
else{
skills += '0';
}
if (candidate_info.skills3){
skills += '1';
}
else{
skills += '0';
}
// make http request to database
$http({
url: "create_profile.php",
method: "POST",
data: {'profile_type': $scope.profile_type,
'new_username': candidate_info.create_u,
'new_password': candidate_info.create_p,
'new_first': candidate_info.create_first,
'new_last': candidate_info.create_last,
'new_cloc': candidate_info.create_cloc,
'new_dloc': candidate_info.create_dloc,
'new_job': candidate_info.create_job,
'new_edu': candidate_info.create_edu,
'new_major': candidate_info.create_major,
'new_gpa': candidate_info.create_gpa,
'new_sal': candidate_info.create_sal,
'new_fun': candidate_info.create_fun,
'new_skills': skills
}
}).then(function(response){
if (response.data.success === false){
alert(response.data.message);
}else{
alert("you have successfully created a profile!");
}
});
}
$scope.createJob = function(job_info){
var profile_type = document.getElementById("profile_type");
var skills = '';
if (job_info.company_skills1){
skills += '1';
}
else{
skills += '0';
}
if (job_info.company_skills2){
skills += '1';
}
else{
skills += '0';
}
if (job_info.company_skills3){
skills += '1';
}
else{
skills += '0';
}
// make http request to database
$http({
url: "create_profile.php",
method: "POST",
data: {'profile_type': $scope.profile_type,
'new_username': job_info.create_company_u,
'new_password': job_info.create_company_p,
'new_name': job_info.create_company_name,
'new_loc': job_info.create_company_loc,
'new_title': job_info.create_title,
'new_industry': job_info.create_industry,
'new_sal': job_info.create_company_sal,
'new_desc': job_info.create_desc,
'new_skills': skills
}
}).then(function(response){
if (response.data.success === false){
alert(response.data.message);
}else{
alert("you have successfully created a profile!");
}
});
}
});