-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpeople_detail.php
executable file
·112 lines (90 loc) · 4.2 KB
/
people_detail.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
<?php if ( ! defined('ABS_PATH')) exit('ABS_PATH is not loaded. Direct access is not allowed.');
// only admin access
if( !osc_is_admin_user_logged_in() ) osc_die('Admin access only');
class JobboardPeopleDetail
{
public function __construct()
{
}
public function main()
{
$has_submited_more_vacancies = false;
$applicantId = Params::getParam("people");
$mjb = ModelJB::newInstance();
$people = $mjb->getApplicant($applicantId);
$file = $mjb->getCVFromApplicant($applicantId);
ModelJB::newInstance()->changeSecret($file['pk_i_id']);
$file = $mjb->getCVFromApplicant($applicantId);
$notes = $mjb->getNotesFromApplicant($applicantId);
$aNotes = array();
if(count($notes)>0) {
foreach($notes as $note) {
$note["admin_username"] = ModelJB::newInstance()-> getAdminUsername($note["fk_i_admin_id"]);
$aNotes[] = $note;
}
}
$adminManager = Admin::newInstance();
$aAdmin = $adminManager->findByPrimaryKey(osc_logged_admin_id());
$aMails = array();
$aMails = applicant_emailsent_get($applicantId);
$job = Item::newInstance()->findByPrimaryKey($people['fk_i_item_id']);
if($people['b_read']==0) {
ModelJB::newInstance()->changeRead($applicantId);
}
list($prevApplicantId, $nextApplicantId) = $this->get_search_applicant_ids($applicantId);
// show: This user has applied to more jobs
$aApplicants = $mjb->search(0,2,array('email' => $people['s_email']));
if(count($aApplicants)>1) {
$has_submited_more_vacancies = true;
}
// -------------------------------------------------------------------------
// get killer questions ...
$correctedForm = $people['b_corrected'];
$jobInfo = $mjb->getJobsAttrByItemId($people['fk_i_item_id']);
$killer_form_id = @$jobInfo['fk_i_killer_form_id'];
$aQuestions = array();
$acomulateScore = 0;
$maxPunctuation = 0;
$aKillerForm = ModelKQ::newInstance()->getKillerForm($killer_form_id);
if(is_array($aKillerForm) && !empty($aKillerForm)) {
// get killer form information ...
$aQuestions = ModelKQ::newInstance()->getKillerQuestions($killer_form_id);
$aAnswers = ModelKQ::newInstance()->getResultsByApplicant($applicantId);
foreach($aAnswers as $key => $_aux) {
if(is_numeric( @$_aux['s_punctuation'] )){
$acomulateScore += @$_aux['s_punctuation'];
}
}
$maxPunctuation = count($aAnswers)*10;
}
$score = (float)number_format($people['d_score'],1);
// load
require_once(JOBBOARD_VIEWS . 'applicants/detail.php');
}
public function get_search_applicant_ids($applicantId) {
$json_search_applicant_ids = osc_get_preference('applicant_ids_search', 'jobboard');
$aSearchApplicantsIds = json_decode($json_search_applicant_ids, true);
$prevApplId = false;
$nextApplId = false;
if(count($aSearchApplicantsIds) > 0) {
foreach ($aSearchApplicantsIds as $key => $value) {
if($value == $applicantId) {
if($key == '0') {
$prevApplId = false;
} else {
$prevApplId = $aSearchApplicantsIds[$key-1];
}
if(end($aSearchApplicantsIds) == $applicantId) {
$nextApplId = false;
} else {
$nextApplId = $aSearchApplicantsIds[$key+1];
}
}
}
}
return array($prevApplId, $nextApplId);
}
}
$jpd = new JobboardPeopleDetail();
$jpd->main();
// EOF