$county_name = empty($county) ? $jobs->county : $county->name;
 $county_var_name = $county ? $county->var_name : $jobs->county;
 $smarty->assign('county', $county_name);
 $smarty->assign('county_url', $country_var_name . "/" . $state_var_name . "/" . $county_var_name . "/");
 $city = City::find_by_code($jobs->country, $jobs->state_province, $jobs->county, $jobs->city);
 $city_name = empty($city) ? $jobs->city : $city->name;
 $city_var_name = empty($city) ? $jobs->city : $city->var_name;
 $smarty->assign('city', $city_name);
 $smarty->assign('city_url', $country_var_name . "/" . $state_var_name . "/" . $county_var_name . "/" . $city_var_name . "/");
 //educations
 $educations = Education::find_by_id($jobs->fk_education_id);
 $education_name = !empty($educations) ? $educations->education_name : format_lang('not_provided');
 $smarty->assign('education_var_name', $educations->var_name);
 $smarty->assign('education', $education_name);
 //career
 $careers = CareerDegree::find_by_id($jobs->fk_career_id);
 $smarty->assign('careers', $careers);
 $career_name = $careers ? $careers->career_name : format_lang('not_provided');
 $smarty->assign('career_var_name', $careers->var_name);
 $smarty->assign('career', $career_name);
 //experience
 $experiences = Experience::find_by_id($jobs->fk_experience_id);
 $smarty->assign('experiences', $experiences);
 $experience_name = !empty($experiences) ? $experiences->experience_name : format_lang('not_provided');
 $smarty->assign('experience_var_name', $experiences->var_name);
 $smarty->assign('experience', $experience_name);
 $smarty->assign('spotlight', $jobs->spotlight);
 if (!empty($jobs->job_salary) && !empty($jobs->salaryfreq)) {
     $job_salary = $jobs->job_salary . format_lang('per') . $jobs->salaryfreq;
 } else {
     $job_salary = format_lang('not_provided');
    $str_date_d = date("d", strtotime($cv_details->start_date));
    $str_date_m = date("m", strtotime($cv_details->start_date));
    $str_date_y = date("Y", strtotime($cv_details->start_date));
    $smarty->assign('str_date', strftime(DATE_FORMAT, strtotime($str_date)));
}
$position = $cv_details->positions;
$smarty->assign('position', $position);
//recent job details
$rjt = $cv_details->recent_job_title;
$smarty->assign('rjt', $rjt);
$re = $cv_details->recent_employer;
$smarty->assign('re', $re);
$categories = Category::find_by_id($cv_details->recent_industry_work);
$riw = $categories ? $categories->cat_name : format_lang('none');
$smarty->assign('riw', $riw);
$careers = CareerDegree::find_by_id($cv_details->recent_career_level);
$rcl = $careers ? $careers->career_name : format_lang('none');
$smarty->assign('careers', $rcl);
//what are you looking for
$ljt = $cv_details->look_job_title;
$smarty->assign('ljt', $ljt);
$ljt2 = $cv_details->look_job_title2;
$smarty->assign('ljt2', $ljt2);
$sql = " SELECT * FROM " . TBL_CV_CAT . " WHERE cv_id=" . $id;
$cv_cat = $db->query($sql);
$cv_cat_array = array();
while ($row = $db->fetch_object($cv_cat)) {
    $categories = Category::find_by_id($row->category_id);
    $cv_cat_array[] = $categories->cat_name;
}
$smarty->assign('li', join("<br />", $cv_cat_array));
<?php

require_once "../initialise_files.php";
include_once "sessioninc.php";
$smarty->assign('action', $_GET['action']);
$smarty->assign('id', (int) $_GET['id']);
if (isset($_GET['action']) && $_GET['action'] == "edit" && isset($_GET['id'])) {
    $id = (int) $_GET['id'];
    $jt_name = CareerDegree::find_by_id($id);
    $jt_name2 = $jt_name->career_name;
    $smarty->assign('jt_name2', $jt_name2);
    $smarty->assign('is_active', $jt_name->is_active);
    if (isset($_GET['bt_update'])) {
        $career_degree = new CareerDegree();
        $career_degree->id = (int) $_GET['id'];
        $career_degree->career_name = $_GET['txt_name'];
        $career_degree->var_name = $career_degree->mod_write_check($_GET['txt_name'], $jt_name->var_name);
        $career_degree->is_active = $_GET['txt_active'];
        if ($career_degree->save()) {
            $session->message("CareerDegree updated ");
            redirect_to($_SERVER['PHP_SELF'] . "?#" . $_GET['id']);
            die;
        } else {
            $message = join("<br />", $career_degree->errors);
        }
    }
}
if (isset($_GET['action']) && $_GET['action'] == "delete" && isset($_GET['id'])) {
    $career_degree = new CareerDegree();
    $career_degree->id = (int) $_GET['id'];
    if ($career_degree->delete()) {
    $str_date = strftime(DATE_FORMAT, strtotime($str_date));
}
$smarty->assign('str_date', $str_date);
$position = $cv_details->positions;
$smarty->assign('position', $position);
//recent job details
$rjt = $cv_details->recent_job_title;
$smarty->assign('rjt', $rjt);
$re = $cv_details->recent_employer;
$smarty->assign('re', $re);
$cat = empty($cv_details->recent_industry_work) ? 0 : $cv_details->recent_industry_work;
$categories = Category::find_by_id($cat);
$riw = $categories ? $categories->cat_name : format_lang('none');
$smarty->assign('riw', $riw);
$cl = empty($cv_details->recent_career_level) ? 0 : $cv_details->recent_career_level;
$careers = CareerDegree::find_by_id($cl);
$rcl = $careers ? $careers->career_name : format_lang('none');
$smarty->assign('careers', $rcl);
//what are you looking for
$ljt = $cv_details->look_job_title;
$smarty->assign('ljt', $ljt);
$ljt2 = $cv_details->look_job_title2;
$smarty->assign('ljt2', $ljt2);
$sql = " SELECT * FROM " . TBL_CV_CAT . " WHERE cv_id=" . $id;
$cv_cat = $db->query($sql);
$cv_cat_array = array();
while ($row = $db->fetch_object($cv_cat)) {
    $categories = Category::find_by_id($row->category_id);
    $cv_cat_array[] = $categories->cat_name;
}
$smarty->assign('li', join("<br />", $cv_cat_array));