/** * Parse data from interface and return JobApplication Object * @param Array $postArr Array containing POST values * @return JobApplication Job Application object */ public function parseData($postArr) { $application = new JobApplication(); if (isset($postArr['txtId']) && !empty($postArr['txtId'])) { $application->setId(trim($postArr['txtId'])); } if (isset($postArr['txtVacancyId']) && !empty($postArr['txtVacancyId'])) { $application->setVacancyId(trim($postArr['txtVacancyId'])); } if (isset($postArr['txtFirstName']) && !empty($postArr['txtFirstName'])) { $application->setFirstName(trim($postArr['txtFirstName'])); } if (isset($postArr['txtMiddleName']) && !empty($postArr['txtMiddleName'])) { $application->setMiddleName(trim($postArr['txtMiddleName'])); } if (isset($postArr['txtLastName']) && !empty($postArr['txtLastName'])) { $application->setLastName(trim($postArr['txtLastName'])); } if (isset($postArr['txtStreet1']) && !empty($postArr['txtStreet1'])) { $application->setStreet1(trim($postArr['txtStreet1'])); } if (isset($postArr['txtStreet2']) && !empty($postArr['txtStreet2'])) { $application->setStreet2(trim($postArr['txtStreet2'])); } if (isset($postArr['txtCity']) && !empty($postArr['txtCity'])) { $application->setCity(trim($postArr['txtCity'])); } if (isset($postArr['txtCountry']) && !empty($postArr['txtCountry'])) { $application->setCountry(trim($postArr['txtCountry'])); } if (isset($postArr['txtProvince']) && !empty($postArr['txtProvince'])) { $application->setProvince(trim($postArr['txtProvince'])); } if (isset($postArr['txtZip']) && !empty($postArr['txtZip'])) { $application->setZip(trim($postArr['txtZip'])); } if (isset($postArr['txtPhone']) && !empty($postArr['txtPhone'])) { $application->setPhone(trim($postArr['txtPhone'])); } if (isset($postArr['txtMobile']) && !empty($postArr['txtMobile'])) { $application->setMobile(trim($postArr['txtMobile'])); } if (isset($postArr['txtEmail']) && !empty($postArr['txtEmail'])) { $application->setEmail(trim($postArr['txtEmail'])); } if (isset($postArr['txtQualifications']) && !empty($postArr['txtQualifications'])) { $application->setQualifications(trim($postArr['txtQualifications'])); } if ($_FILES['txtResume']['size'] > 0) { if ($_FILES['txtResume']['error'] > 0) { $application->resumeData['error'] = $_FILES['txtResume']['error']; } else { $application->resumeData['name'] = $_FILES['txtResume']['name']; $application->resumeData['tmpName'] = $_FILES['txtResume']['tmp_name']; $application->resumeData['extension'] = strtolower(array_pop(explode(".", $_FILES['txtResume']['name']))); $application->resumeData['size'] = $_FILES['txtResume']['size']; } } return $application; }
/** * Parse data from interface and return JobApplication Object * @param Array $postArr Array containing POST values * @return JobApplication Job Application object */ public function parseData($postArr) { $application = new JobApplication(); if (isset($postArr['txtId']) && !empty($postArr['txtId'])) { $application->setId(trim($postArr['txtId'])); } if (isset($postArr['txtVacancyId']) && !empty($postArr['txtVacancyId'])) { $application->setVacancyId(trim($postArr['txtVacancyId'])); } if (isset($postArr['txtFirstName']) && !empty($postArr['txtFirstName'])) { $application->setFirstName(trim($postArr['txtFirstName'])); } if (isset($postArr['txtMiddleName']) && !empty($postArr['txtMiddleName'])) { $application->setMiddleName(trim($postArr['txtMiddleName'])); } if (isset($postArr['txtLastName']) && !empty($postArr['txtLastName'])) { $application->setLastName(trim($postArr['txtLastName'])); } if (isset($postArr['txtStreet1']) && !empty($postArr['txtStreet1'])) { $application->setStreet1(trim($postArr['txtStreet1'])); } if (isset($postArr['txtStreet2']) && !empty($postArr['txtStreet2'])) { $application->setStreet2(trim($postArr['txtStreet2'])); } if (isset($postArr['txtCity']) && !empty($postArr['txtCity'])) { $application->setCity(trim($postArr['txtCity'])); } if (isset($postArr['txtCountry']) && !empty($postArr['txtCountry'])) { $application->setCountry(trim($postArr['txtCountry'])); } if (isset($postArr['txtProvince']) && !empty($postArr['txtProvince'])) { $application->setProvince(trim($postArr['txtProvince'])); } if (isset($postArr['txtZip']) && !empty($postArr['txtZip'])) { $application->setZip(trim($postArr['txtZip'])); } if (isset($postArr['txtPhone']) && !empty($postArr['txtPhone'])) { $application->setPhone(trim($postArr['txtPhone'])); } if (isset($postArr['txtMobile']) && !empty($postArr['txtMobile'])) { $application->setMobile(trim($postArr['txtMobile'])); } if (isset($postArr['txtEmail']) && !empty($postArr['txtEmail'])) { $application->setEmail(trim($postArr['txtEmail'])); } if (isset($postArr['txtQualifications']) && !empty($postArr['txtQualifications'])) { $application->setQualifications(trim($postArr['txtQualifications'])); } return $application; }
/** * Deletes the resume of the applicant * @param int $applicationId ID of the Application */ private function _deleteResume($applicationId) { $this->_authenticateResumeAccess(); $jobApplication = new JobApplication(); $jobApplication->setId($applicationId); // If resume details are not set, at default they become null try { $jobApplication->deleteResume(); $objs['application'] = JobApplication::getJobApplication($applicationId); // No resume $objs['message'] = 'Resume deleted'; } catch (Exception $e) { $objs['application'] = JobApplication::getJobApplication($applicationId); // still contains the resume $objs['message'] = 'Resume not deleted'; } $path = '/templates/recruitment/viewApplicationDetails.php'; $template = new TemplateMerger($objs, $path); $template->display(); }