コード例 #1
0
ファイル: resume_xml.php プロジェクト: pamalite/yel
        $resume_data['resume']['work_experiences']['work_experience'][$i]['from'] = $experience['from'];
        $resume_data['resume']['work_experiences']['work_experience'][$i]['to'] = $experience['to'];
        $resume_data['resume']['work_experiences']['work_experience'][$i]['place'] = $experience['place'];
        $resume_data['resume']['work_experiences']['work_experience'][$i]['role'] = $experience['role'];
        $resume_data['resume']['work_experiences']['work_experience'][$i]['work_summary'] = $experience['work_summary'];
        $i++;
    }
}
$resume_data['resume']['educations'] = array();
if (count($educations) > 0) {
    $i = 0;
    foreach ($educations as $education) {
        $resume_data['resume']['educations']['education'][$i]['qualification'] = $education['qualification'];
        $resume_data['resume']['educations']['education'][$i]['completion_year'] = $education['completed_on'];
        $resume_data['resume']['educations']['education'][$i]['institution'] = $education['institution'];
        $resume_data['resume']['educations']['education'][$i]['country'] = Country::getCountryFrom($education['country']);
        $i++;
    }
}
$resume_data['resume']['skills'] = '';
if (!is_null($skills[0]['skill']) && !empty($skills[0]['skill'])) {
    $resume_data['resume']['skills'] = $skills[0]['skill'];
}
$resume_data['resume']['technical_skills'] = array();
if (count($technical_skills) > 0) {
    $i = 0;
    $levels = array('A' => 'Beginner', 'B' => 'Intermediate', 'C' => 'Advanced');
    foreach ($technical_skills as $technical_skill) {
        $resume_data['resume']['technical_skills']['technical_skill'][$i]['tech_skill'] = $technical_skill['technical_skill'];
        $resume_data['resume']['technical_skills']['technical_skill'][$i]['level'] = $levels[$technical_skill['level']];
        $i++;
コード例 #2
0
ファイル: member_home_page.php プロジェクト: pamalite/yel
 public function show()
 {
     $this->begin();
     $this->top_search('Home');
     $this->menu('member', 'home');
     $this->howitworks();
     $country = $this->member->getCountry();
     $currency = Currency::getSymbolFromCountryCode($country);
     $completeness_raw = $this->get_completeness();
     $completeness_percent = 0;
     $next_step = '';
     $total = 0;
     foreach ($completeness_raw as $key => $value) {
         $total += $value;
         $completeness_percent = $total / count($completeness_raw) * 100;
         if ($completeness_percent < 100 && empty($next_step)) {
             switch ($key) {
                 case 'seeking':
                     $next_step = 'Fill in Current Job Responsibilities / Experiences.';
                     break;
                 case 'current_salary':
                     $next_step = 'Fill in Current Salary range.';
                     break;
                 case 'expected_salary':
                     $next_step = 'Fill in Expected Salary range.';
                     break;
                 case 'preferred_job_location':
                     $next_step = 'Select your preferred job locations.';
                     break;
                 case 'can_travel_relocate':
                     $next_step = 'Fill in Willing to travel / relocate.';
                     break;
                 case 'reason_for_leaving':
                     $next_step = 'Fill in Reason for Leaving.';
                     break;
                 case 'notice_period':
                     $next_step = 'Fill in Notice Period.';
                     break;
                 case 'has_job_profiles':
                     $next_step = 'Add a Present &amp; Past Position.';
                     break;
             }
         }
     }
     if ($completeness_percent >= 100) {
         $next_step = 'Career Profile is complete.';
     }
     $answers = $this->get_answers();
     $is_active = $answers['is_active_seeking_job'] == '1' ? true : false;
     $job_profiles = $this->get_job_profiles();
     $page = file_get_contents(dirname(__FILE__) . '/../../../html/member_home_page.html');
     $page = str_replace('%root%', $this->url_root, $page);
     $page = str_replace('%country_code%', $country, $page);
     $page = str_replace('%country%', Country::getCountryFrom($country), $page);
     $page = str_replace('%currency%', $currency, $page);
     if (isset($_SESSION['yel']['member']['linkedin_id'])) {
         if (!empty($_SESSION['yel']['member']['linkedin_id'])) {
             $page = str_replace('%linkedin_copy_display%', 'block', $page);
         } else {
             $page = str_replace('%linkedin_copy_display%', 'none', $page);
         }
     } else {
         $page = str_replace('%linkedin_copy_display%', 'none', $page);
     }
     // if (!empty($this->error_message)) {
     //     $page = str_replace('%error_message%', $this->error_message, $page);
     // } else {
     //     $page = str_replace('%error_message%', '', $page);
     // }
     // completeness
     $progress_percent = $completeness_percent;
     if ($completeness_percent >= 100) {
         // this is to make sure the progress bar does not touch the right edge
         $progress_percent -= 1;
     }
     $page = str_replace('%completeness_percent%', $progress_percent, $page);
     $page = str_replace('%lbl_completeness_percent%', $completeness_percent, $page);
     $page = str_replace('%next_step%', $next_step, $page);
     // photo
     $photo_html = '<div style="text-align: center; margin: auto;">Max resolution: 200x220 pixels<br/>Max size: 150KB</div>';
     if ($this->member->hasPhoto()) {
         $photo_html = '<img id="photo_image" class="photo_image" src="candidate_photo.php?id=' . $this->member->getId() . '" />';
     }
     $page = str_replace('%photo_html%', $photo_html, $page);
     // resumes
     $resumes = $this->get_resumes();
     $page = str_replace('%member_email%', $this->member->getId(), $page);
     if (empty($resumes)) {
         $page = str_replace('%no_resumes%', 'block', $page);
         $page = str_replace('%resumes_table%', '', $page);
     } else {
         $page = str_replace('%no_resumes%', 'none', $page);
         $resumes_table = new HTMLTable('resumes_table', 'resumes');
         $resumes_table->set(0, 0, "Updated On", '', 'header');
         $resumes_table->set(0, 1, "File Name", '', 'header');
         $resumes_table->set(0, 2, "&nbsp;", '', 'header actions');
         foreach ($resumes as $i => $resume) {
             $resumes_table->set($i + 1, 0, $resume['formatted_modified_on'], '', 'cell');
             $resumes_table->set($i + 1, 1, '<a href="resume.php?id=' . $resume['id'] . '">' . $resume['file_name'] . '</a>', '', 'cell');
             $resumes_table->set($i + 1, 2, '<a class="no_link" onClick="update_resume(' . $resume['id'] . ');">Update</a>', '', 'cell actions');
             //$resumes_table->set($i+1, 2, '<a class="no_link" onClick="delete_resume('. $resume['id']. ');">Delete</a>&nbsp;|&nbsp;<a class="no_link" onClick="update_resume('. $resume['id']. ');">Update</a>', '', 'cell actions');
         }
         $page = str_replace('%resumes_table%', $resumes_table->get_html(), $page);
     }
     // career profile
     $criteria = array('columns' => "DATE_FORMAT(imported_on, '%e %b, %Y') AS formatted_last_imported_on", 'match' => "email_addr = '" . $this->member->getId() . "'");
     $result = $this->member->find($criteria);
     if (!is_null($result[0]['formatted_last_imported_on']) || !empty($result[0]['formatted_last_imported_on'])) {
         $page = str_replace('%last_imported_on%', 'Last imported on ' . $result[0]['formatted_last_imported_on'], $page);
     } else {
         $page = str_replace('%last_imported_on%', 'Not yet imported', $page);
     }
     $is_active_str = 'No';
     if ($is_active) {
         $is_active_str = 'Yes';
     }
     if ($answers['contact_me_for_opportunities'] == '1') {
         if ($is_active_str == 'No') {
             $is_active_str .= ', but ';
         } else {
             $is_active_str .= '; also ';
         }
         $is_active_str .= 'contact me if opportunities are available.';
         $page = str_replace('%contact_me%', 'checked', $page);
     } else {
         $page = str_replace('%contact_me%', '', $page);
     }
     $page = str_replace('%is_active%', $is_active_str, $page);
     $seeking_txt = str_replace(array("\r\n", "\r", "\n"), '<br/>', $answers['seeking']);
     $page = str_replace('%seeking%', $seeking_txt, $page);
     $page = str_replace('%expected_salary_currency%', $answers['expected_salary_currency'], $page);
     $exp_sal = $answers['expected_salary'] <= 0 ? '(None provided)' : $answers['expected_salary'];
     $page = str_replace('%expected_salary%', $exp_sal, $page);
     $exp_total = $answers['expected_total_annual_package'] <= 0 ? '(None provided)' : $answers['expected_total_annual_package'];
     $page = str_replace('%expected_total_annual_package%', $exp_total, $page);
     $page = str_replace('%current_salary_currency%', $answers['current_salary_currency'], $page);
     $cur_sal = $answers['current_salary'] <= 0 ? '(None provided)' : $answers['current_salary'];
     $page = str_replace('%current_salary%', $cur_sal, $page);
     $cur_total = $answers['current_total_annual_package'] <= 0 ? '(None provided)' : $answers['current_total_annual_package'];
     $page = str_replace('%current_total_annual_package%', $cur_total, $page);
     $page = str_replace('%pref_job_loc_1%', $answers['pref_job_location_1'], $page);
     $page = str_replace('%pref_job_loc_2%', $answers['pref_job_location_2'], $page);
     if ($answers['can_travel_relocate'] == 'Y') {
         $page = str_replace('%can_travel%', 'Yes', $page);
     } else {
         $page = str_replace('%can_travel%', 'No', $page);
     }
     $reason_for_leaving_txt = str_replace(array("\r\n", "\r", "\n"), '<br/>', $answers['reason_for_leaving']);
     $page = str_replace('%reason_for_leaving%', $reason_for_leaving_txt, $page);
     $page = str_replace('%notice_period%', $answers['notice_period'], $page);
     // job profiles
     if (empty($job_profiles)) {
         $page = str_replace('%no_positions%', 'block', $page);
         $page = str_replace('%job_profiles_table%', '', $page);
     } else {
         $page = str_replace('%no_positions%', 'none', $page);
         $job_profiles_table = new HTMLTable('job_profiles_table', 'job_profiles');
         $job_profiles_table->set(0, 0, '&nbsp;', '', 'header action');
         $job_profiles_table->set(0, 1, 'From', '', 'header');
         $job_profiles_table->set(0, 2, 'To', '', 'header');
         $job_profiles_table->set(0, 3, 'Employer', '', 'header');
         $job_profiles_table->set(0, 4, 'Position', '', 'header');
         $job_profiles_table->set(0, 5, '&nbsp;', '', 'header action');
         foreach ($job_profiles as $i => $job_profile) {
             $job_profiles_table->set($i + 1, 0, '<a class="no_link" onClick="delete_job_profile(' . $job_profile['id'] . ')">delete</a>', '', 'cell action');
             $job_profiles_table->set($i + 1, 1, $job_profile['formatted_work_from'], '', 'cell');
             $work_to = $job_profile['formatted_work_to'];
             if (is_null($work_to) || empty($work_to) || $work_to == '0000-00-00') {
                 $work_to = 'Present';
             }
             $job_profiles_table->set($i + 1, 2, $work_to, '', 'cell');
             $emp = htmlspecialchars_decode(stripslashes($job_profile['employer']));
             $emp .= '<br/><span class="mini_spec">' . $job_profile['employer_specialization'] . '</span>';
             $job_profiles_table->set($i + 1, 3, $emp, '', 'cell');
             $pos = htmlspecialchars_decode(stripslashes($job_profile['position_title']));
             $pos .= '<br/><span class="mini_spec">reporting to</span><br/>';
             if (is_null($job_profile['position_superior_title']) || empty($job_profile['position_superior_title'])) {
                 $pos .= '<a class="no_link" onClick="show_job_profile_popup(' . $job_profile['id'] . ')">edit reporting structure</a>';
             } else {
                 $pos .= '<span class="mini_superior">' . $job_profile['position_superior_title'] . '</span>';
             }
             $job_profiles_table->set($i + 1, 4, $pos, '', 'cell');
             $edit = '<a class="no_link" onClick="show_job_profile_popup(' . $job_profile['id'] . ')">finish incomplete profile</a>';
             if (!is_null($job_profile['summary']) && !empty($job_profile['summary']) && !is_null($job_profile['position_superior_title']) && !empty($job_profile['position_superior_title']) && !is_null($job_profile['employer_specialization']) && !empty($job_profile['employer_specialization'])) {
                 $edit = '<a class="no_link" onClick="show_job_profile_popup(' . $job_profile['id'] . ')">update</a>';
             }
             $job_profiles_table->set($i + 1, 5, $edit, '', 'cell action');
         }
         $page = str_replace('%job_profiles_table%', $job_profiles_table->get_html(), $page);
     }
     // popup windows
     // photo upload
     $page = str_replace('%upload_photo_member_id%', $this->member->getId(), $page);
     // career summary editor
     if ($is_active) {
         $page = str_replace('%is_active_yes_option%', 'selected', $page);
         $page = str_replace('%is_active_no_option%', '', $page);
     } else {
         $page = str_replace('%is_active_yes_option%', '', $page);
         $page = str_replace('%is_active_no_option%', 'selected', $page);
     }
     $page = str_replace('%seeking_txt%', str_replace('<br/>', "\r\n", $answers['seeking']), $page);
     $exp_currency_options_str = '';
     foreach ($GLOBALS['currencies'] as $i => $currency) {
         if ($currency == $answers['expected_salary_currency']) {
             $exp_currency_options_str .= '<option value="' . $currency . '" selected>' . $currency . '</option>' . "\n";
         } else {
             $exp_currency_options_str .= '<option value="' . $currency . '">' . $currency . '</option>' . "\n";
         }
     }
     $page = str_replace('%expected_salary_currency_options%', $exp_currency_options_str, $page);
     $page = str_replace('%expected_salary_txt%', $answers['expected_salary'], $page);
     $page = str_replace('%expected_total_txt%', $answers['expected_total_annual_package'], $page);
     $cur_currency_options_str = '';
     foreach ($GLOBALS['currencies'] as $i => $currency) {
         if ($currency == $answers['currenty_salary_currency']) {
             $cur_currency_options_str .= '<option value="' . $currency . '" selected>' . $currency . '</option>' . "\n";
         } else {
             $cur_currency_options_str .= '<option value="' . $currency . '">' . $currency . '</option>' . "\n";
         }
     }
     $page = str_replace('%current_salary_currency_options%', $cur_currency_options_str, $page);
     $page = str_replace('%current_salary_txt%', $answers['current_salary'], $page);
     $page = str_replace('%current_total_txt%', $answers['current_total_annual_package'], $page);
     $page = str_replace('%pref_job_loc_1_select%', $this->generate_countries($answers['pref_job_loc_1'], 'pref_job_loc_1'), $page);
     $page = str_replace('%pref_job_loc_2_select%', $this->generate_countries($answers['pref_job_loc_2'], 'pref_job_loc_2'), $page);
     if ($answers['can_travel_relocate'] == 'Y') {
         $page = str_replace('%can_travel_yes', 'selected', $page);
         $page = str_replace('%can_travel_no', '', $page);
     } else {
         $page = str_replace('%can_travel_yes', '', $page);
         $page = str_replace('%can_travel_no', 'selected', $page);
     }
     $page = str_replace('%reason_for_leaving_txt%', str_replace('<br/>', "\r\n", $answers['reason_for_leaving']), $page);
     $page = str_replace('%notice_period_txt%', $answers['notice_period'], $page);
     // job profile
     $page = str_replace('%work_from_month_select%', generate_month_dropdown('work_from_month', ''), $page);
     $page = str_replace('%work_to_month_select%', generate_month_dropdown('work_to_month', ''), $page);
     $page = str_replace('%emp_desc_select%', $this->generate_employer_description('emp_desc', -1), $page);
     $page = str_replace('%industry_select%', $this->generate_industries('emp_specialization', array()), $page);
     // present page
     echo $page;
 }
コード例 #3
0
ファイル: resume_pdf.php プロジェクト: pamalite/yel
 function show_educations($_educations)
 {
     $this->SetTextColor(0);
     if (count($_educations) <= 0) {
         $this->SetFont('Times', '', 10);
         $this->Cell(0, 5, 'No education recorded', 0, 1, 'C');
         $this->Ln();
     } else {
         foreach ($_educations as $education) {
             $this->SetFont('Times', 'B', 10);
             $this->Cell(75, 5, 'Qualification:', 0, 0, 'R');
             $this->SetFont('Times', '', 10);
             $this->Cell(0, 5, $education['qualification'], 0, 1, 'L');
             $this->SetFont('Times', 'B', 10);
             $this->Cell(75, 5, 'Completion Year:', 0, 0, 'R');
             $this->SetFont('Times', '', 10);
             $this->Cell(0, 5, $education['completed_on'], 0, 1, 'L');
             $this->SetFont('Times', 'B', 10);
             $this->Cell(75, 5, 'Institution:', 0, 0, 'R');
             $this->SetFont('Times', '', 10);
             $this->Cell(0, 5, $education['institution'], 0, 1, 'L');
             $this->SetFont('Times', 'B', 10);
             $this->Cell(75, 5, 'Country:', 0, 0, 'R');
             $this->SetFont('Times', '', 10);
             $this->Cell(0, 5, Country::getCountryFrom($education['country']), 0, 1, 'L');
             $this->Ln();
         }
     }
 }
コード例 #4
0
ファイル: employer_action.php プロジェクト: pamalite/yel
         $is_test_site = true;
         break;
     }
 }
 // send an email to consultant about the job is being assigned
 $employee = new Employee($_POST['employee']);
 $employer = new Employer($_POST['employer']);
 $lines = file(dirname(__FILE__) . '/../private/mail/employee_job_assignment.txt');
 $message = '';
 foreach ($lines as $line) {
     $message .= $line;
 }
 $message = str_replace('%job_id%', $job->getId(), $message);
 $message = str_replace('%job%', $_POST['title'], $message);
 $message = str_replace('%employer%', $employer->getName(), $message);
 $message = str_replace('%country%', Country::getCountryFrom($_POST['country']), $message);
 $message = str_replace('%is_exec%', $_POST['is_executive'] == '1' ? 'Yes' : 'No', $message);
 $message = str_replace('%expiry%', $job->getExpiryDate(), $message);
 $subject = $_POST['title'] . ' position has been assigned to you';
 $headers = 'From: YellowElevator.com <*****@*****.**>' . "\n";
 mail($employee->getEmailAddress(), $subject, $body, $headers);
 // $handle = fopen('/tmp/email_to_'. $employee->getEmailAddress(). '.txt', 'w');
 // fwrite($handle, 'Subject: '. $subject. "\n\n");
 // fwrite($handle, $body);
 // fclose($handle);
 // Tweet about this job, if it is new
 if ($new_id > 0 && !$is_test_site) {
     $employer = htmlspecialchars_decode(stripslashes($employer->getName()));
     $url = $GLOBALS['protocol'] . '://' . $GLOBALS['root'] . '/job/' . $new_id;
     $status = $data['title'] . ' (' . $employer . ') - ' . $url;
     $twitter_username = '******';
コード例 #5
0
ファイル: resume_viewer.php プロジェクト: pamalite/yel
                    <td class="field"><?php 
        echo $education['completed_on'];
        ?>
</td>
                </tr>
                <tr>
                    <td class="label">Institution:</td>
                    <td class="field"><?php 
        echo $education['institution'];
        ?>
</td>
                </tr>
                <tr>
                    <td class="label">Country:</td>
                    <td class="field"><?php 
        echo Country::getCountryFrom($education['country']);
        ?>
</td>
                </tr>
            <?php 
        if ($i < count($educations) - 1) {
            ?>
                <tr>
                    <td colspan="2" class="separator"></td>
                </tr>
            <?php 
        }
        $i++;
    }
    ?>
        </table>
コード例 #6
0
ファイル: feedback_action.php プロジェクト: pamalite/yel
require_once dirname(__FILE__) . "/private/lib/recaptchalib.php";
session_start();
$_SESSION['yel']['feedback']['firstname'] = $_POST['firstname'];
$_SESSION['yel']['feedback']['lastname'] = $_POST['lastname'];
$_SESSION['yel']['feedback']['email_addr'] = $_POST['email_addr'];
$_SESSION['yel']['feedback']['country'] = $_POST['country'];
$_SESSION['yel']['feedback']['feedback'] = $_POST['feedback'];
// verify captcha first
$privatekey = '6LdwqsASAAAAAEJESjRalI-y5sjko4b82nMLC5mH';
$resp = recaptcha_check_answer($privatekey, 'yellowelevator.com', $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
    redirect_to('feedback.php?error=1');
}
if (!isset($_POST['email_addr']) || !isset($_POST['country']) || !isset($_POST['firstname']) || !isset($_POST['lastname']) || !isset($_POST['feedback'])) {
    redirect_to('feedback.php?error=2');
}
$fullname = desanitize($_SESSION['yel']['feedback']['firstname'] . ', ' . $_SESSION['yel']['feedback']['lastname']);
$country = Country::getCountryFrom($_SESSION['yel']['feedback']['country']);
// Send email to feedback@yellowelevator.com
$mail_lines = file('private/mail/feedback.txt');
$message = '';
foreach ($mail_lines as $line) {
    $message .= $line;
}
$message = str_replace('%name%', $fullname, $message);
$message = str_replace('%country%', $country, $message);
$message = str_replace('%feedback%', $_SESSION['yel']['feedback']['feedback'], $message);
$subject = "Feedback from " . $fullname;
$headers = 'From: ' . $_SESSION['yel']['feedback']['email_addr'] . "\n";
mail('*****@*****.**', $subject, $message, $headers);
redirect_to('feedback.php?success=1');