<?php require_once "../initialise_files.php"; include_once "sessioninc.php"; $smarty->assign('action', $_GET['action']); $smarty->assign('id', (int) $_GET['id']); //// updating job types if (isset($_GET['action']) && $_GET['action'] == "edit" && isset($_GET['id'])) { $id = (int) $_GET['id']; $jt_name = JobType::find_by_id($id); $jt_name2 = $jt_name->type_name; $smarty->assign('jt_name2', $jt_name2); $smarty->assign('is_active', $jt_name->is_active); if (isset($_GET['bt_update'])) { $job_type = new JobType(); $job_type->id = (int) $_GET['id']; $job_type->type_name = $_GET['txt_name']; $job_type->var_name = $job_type->mod_write_check($_GET['txt_name'], $jt_name->var_name); $job_type->is_active = $_GET['txt_active']; if ($job_type->save()) { $session->message("Job Type updated "); redirect_to($_SERVER['PHP_SELF'] . "?#" . $_GET['id']); die; } else { $message = join("<br />", $job_type->errors); } } } //deleteing job type if (isset($_GET['action']) && $_GET['action'] == "delete" && isset($_GET['id'])) { $job_type = new JobType();
$req = return_url(); $var_name = $req[1]; $jobs = $job->find_by_var_name($var_name); $job_id = (int) $jobs->id; if ($jobs && !empty($jobs)) { $html_title = SITE_NAME . " - " . $jobs->job_title; $meta_description = seo_words(subtrack_string($jobs->job_description, 250)); $meta_keywords = seo_words(subtrack_string($jobs->job_description, 150)); $id = (int) $jobs->id; $jobs->update_views(); //job type $type = Job2Type::find_all_type_by_jobid($id); $type2 = array(); $i = 1; foreach ($type as $job_type) { $type_name = JobType::find_by_id($job_type->fk_job_type_id); $type2[$i]['name'] = $type_name->type_name; $type2[$i]['var_name'] = $type_name->var_name; $i++; } $smarty->assign('jobtype', $type2); $smarty->assign('var_name', $jobs->var_name); $smarty->assign('job_ref', $jobs->job_ref); $smarty->assign('job_title', $jobs->job_title); $smarty->assign('job_description', $jobs->job_description); $smarty->assign('job_postion', $jobs->job_postion); //locations //country $country_arry = Country::find_by_code($jobs->country); //$country_a($country_arry) ? $country_arry->code : $country_a; $country_var_name = $country_arry->var_name;
$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)); //job states $js = empty($cv_details->look_job_status) ? 0 : $cv_details->look_job_status; $job_status = JobStatus::find_by_id($js); $ljs = $job_status ? $job_status->status_name : format_lang('none'); $smarty->assign('ljs', $ljs); //job type $job_t = empty($cv_details->look_job_type) ? 0 : $cv_details->look_job_type; $job_type_arr = JobType::find_by_id($job_t); //print_r( $job_type_arr); $job_types = $job_type_arr ? $job_type_arr->type_name : format_lang('none'); $smarty->assign('job_type', $job_types); //where do you wont to work //country $country_arry = Country::find_by_code($cv_details->country); $country_var_name = $country_arry->var_name; $country_name = $country_arry->name; $smarty->assign('country', $country_name); //states $state = StateProvince::find_by_code($cv_details->country, $cv_details->state_province); $state_name = empty($state) ? $cv_details->state_province : $state->name; $state_var_name = $state ? $state->var_name : $cv_details->state_province; $smarty->assign('state', $state_name); $smarty->assign('state_url', $country_var_name . "/" . $state_var_name . "/");