<?php

$_SESSION['direct_to_emp'] = "review_cv/";
include_once 'sessioninc.php';
destroy_my_session();
$id = $_GET['id'];
if (!isset($id) || empty($id)) {
    redirect_to(BASE_URL . "employer/account/");
}
$username = $session->get_username();
$user_id = $session->get_user_id();
$country_code = DEFAULT_COUNTRY;
$cv_setting = new CVSetting();
$employee_id = $_GET['u'];
$cv_setting->id = $id;
$cv_setting->fk_employee_id = $employee_id;
$already_view = $cv_setting->already_view_cv($user_id, $id);
if (!$already_view) {
    $employer = new Employer();
    $employer->username = $username;
    $total_cv = $employer->total_cv();
    define('TEMP_TOTAL_CV', $total_cv);
    if (FREE_SITE == "N") {
        if ($total_cv <= 0) {
            $session->message("<div class='error'>" . format_lang('error', 'cv_zero') . "</div>");
            redirect_to(BASE_URL . "employer/credits/");
            die;
        }
    }
    $employer->update_cvs();
    $cv_setting->save_cv_view($user_id, 7);
$country_code = DEFAULT_COUNTRY;
$employer = Employer::find_by_id($user_id);
$total_cv = $employer->total_cv();
define('TEMP_TOTAL_CV', $total_cv);
if (FREE_SITE == "N") {
    if ($total_cv <= 0) {
        $session->message("<div class='error'>" . format_lang('error', 'cv_zero') . "</div>");
        redirect_to(BASE_URL . "employer/credits/");
        die;
    }
}
$id = $_GET['id'];
$smarty->assign('id', $id);
$employee_id = $_GET['u'];
$smarty->assign('employee_id', $employee_id);
$cv_setting = new CVSetting();
$cv_setting->id = $cv_id = $id;
$cv_setting->fk_employee_id = $employee_id;
/** update cv views */
$cv_setting->update_no_views();
$cv_details = $cv_setting->cv_review_by_employer();
$cv_status = $cv_details->cv_status;
$smarty->assign('cv_status', $cv_status);
if (empty($cv_details->year_experience) || $cv_details->year_experience == 0) {
    $cv_details->year_experience = 0;
}
$experiences = Experience::find_by_id($cv_details->year_experience);
$exper = !empty($experiences) ? $experiences->experience_name : format_lang('none');
$smarty->assign('exper', $exper);
$educations = Education::find_by_id($cv_details->highest_education);
$educ = !empty($educations) ? $educations->education_name : format_lang('none');
Example #3
0
     $location = $file_path . $file_name;
     //header("Content-Disposition: attachment; filename=".strip_tags(stripcslashes($orginal_name) ) . " ");
     header("Content-Disposition: attachment; filename=\"" . $orginal_name . "\"");
     // use 'attachment' to force a download
     header("Content-length: " . $file_size);
     header("Content-type: " . $file_type);
     readfile($location);
     die;
     break;
 default:
     //if no cv has been upload then take them to add new cv screen
     if ($total_max_cv <= 0 && $action != "add") {
         redirect_to(BASE_URL . "curriculum_vitae/add/");
     }
     //list of cover letter
     $my_cvs = CVSetting::employee_find_all($user_id);
     //$my_cls = CovingLetter::employee_find_all($user_id);
     if (is_array($my_cvs) and !empty($my_cvs)) {
         $cv_t = array();
         $i = 1;
         foreach ($my_cvs as $my_cv) {
             if ($my_cv->is_defult == 'Y') {
                 //$letter = empty($_POST['txt_letter']) ? $my_letter->cl_text : safe_output( $_POST['txt_letter'] );
             }
             $cv_t[$i]["id"] = $my_cv->id;
             $cv_t[$i]["fk_employee_id"] = $my_cv->fk_employee_id;
             $cv_t[$i]["cv_title"] = $my_cv->cv_title;
             $cv_t[$i]["cv_status"] = $my_cv->cv_status;
             $cv_t[$i]["no_views"] = $my_cv->no_views;
             $cv_t[$i]["created_at"] = strftime(DATE_FORMAT, strtotime($my_cv->created_at));
             $cv_t[$i]["modified_at"] = strftime(DATE_FORMAT, strtotime($my_cv->modified_at));
         }
         if ($file['size'] > $_POST['MAX_CV_FILESIZE']) {
             $error[] = format_lang('error', 'cv_upload_size');
         }
         if ($file['error'] == 0) {
             $ext = end(explode(".", basename($file['name'])));
             $ext = strtolower($ext);
             $allowed_exe = split(",", ALLOWED_FILETYPES_DOC);
             if (!in_array($ext, $allowed_exe)) {
                 $error[] = format_lang('error', 'file_not_allowed') . " " . basename($file['name']);
             }
         }
     } else {
         $user_id = $session->get_user_id();
         $_SESSION['apply']['cv_selected'] = $cv_selected = $_POST['txt_existed_cv'];
         $cv_setting = new CVSetting();
         $cv_setting->id = $cv_selected;
         $cv_setting->fk_employee_id = $user_id;
         $cv_info = $cv_setting->cv_review_by_employee();
         $cv = array();
         $cv['name'] = $cv_info->cv_title;
         $target = $cv_info->cv_file_path . $cv_info->cv_file_name;
         $cv['tmp_name'] = $target;
         $cv['type'] = $cv_info->cv_file_type;
         $cv['size'] = $cv_info->cv_file_size;
     }
 }
 //end
 if (!$session->get_job_seeker() && ENABLE_SPAM_APPLY_JOB && ENABLE_SPAM_APPLY_JOB == 'Y') {
     if (strtolower($_POST['spam_code']) != strtolower($_SESSION['spam_code']) || (!isset($_SESSION['spam_code']) || $_SESSION['spam_code'] == NULL)) {
         $error[] = get_lang('error', 'spam_wrong_word');
<?php

$_SESSION['direct_to'] = BASE_URL . "curriculum_vitae/";
include_once 'sessioninc.php';
$username = $session->get_username();
$user_id = $session->get_user_id();
$country_code = DEFAULT_COUNTRY;
$cv_setting = new CVSetting();
$_SESSION['resume']['id'] = $cv_setting->id = $cv_id = $id;
$cv_setting->fk_employee_id = $user_id;
$experiences = Experience::find_all();
if (is_array($experiences) and !empty($experiences)) {
    $experience_t = array();
    foreach ($experiences as $experience) {
        $experience_t[$experience->id] = $experience->experience_name;
    }
    $smarty->assign('experience', $experience_t);
}
$educations = Education::find_all();
if (is_array($educations) and !empty($educations)) {
    $education_t = array();
    foreach ($educations as $education) {
        $education_t[$education->id] = $education->education_name;
    }
    $smarty->assign('education', $education_t);
}
$categories = Category::find_all();
if (is_array($categories) and !empty($categories)) {
    $category_t = array();
    foreach ($categories as $category) {
        $category_t[$category->id] = $category->cat_name;
<?php

$_SESSION['direct_to'] = BASE_URL . "curriculum_vitae/";
include_once 'sessioninc.php';
destroy_my_session();
$username = $session->get_username();
$user_id = $session->get_user_id();
$country_code = DEFAULT_COUNTRY;
$cv_setting = new CVSetting();
//$cv_setting->id = $cv_id = $id;
$_SESSION['resume']['id'] = $cv_setting->id = $cv_id = $id;
$cv_setting->fk_employee_id = $user_id;
$cv_details = $cv_setting->cv_review_by_employee();
if (!$cv_details && !is_array($cv_details)) {
    $session->message("<div class='error'>" . format_lang('errormsg', 00) . "</div>");
    redirect_to(BASE_URL . 'curriculum_vitae/');
    exit;
}
if ($cv_details->modified_at == '' || empty($cv_details->modified_at)) {
    //$session->message("<div class='error'>CV has not been modified</div>");
    redirect_to(BASE_URL . 'curriculum_vitae/resume/' . $id . '/change/');
    exit;
}
$cv_status = strtolower($cv_details->cv_status);
$smarty->assign('cv_status', $cv_status);
$ye = empty($cv_details->year_experience) ? 0 : $cv_details->year_experience;
$experiences = Experience::find_by_id($ye);
$exper = !empty($experiences) ? $experiences->experience_name : format_lang('none');
$smarty->assign('exper', $exper);
$he = empty($cv_details->highest_education) ? 0 : $cv_details->highest_education;
$educations = Education::find_by_id($he);