public function address() { $address = ""; if (isset($this->address) && !empty($this->address)) { $address .= $this->address . ":"; } if (isset($this->address2) && !empty($this->address2)) { $address .= $this->address2 . ":"; } if (isset($this->city) && !empty($this->city)) { $city = City::find_by_code($this->country, $this->state_province, $this->county, $this->city); $address .= $city->name . ":"; } //county if (isset($this->county) && !empty($this->county)) { $county = County::find_by_code($this->country, $this->state_province, $this->county); $address .= $county->name . ":"; } //states if (isset($this->state_province) && !empty($this->state_province)) { $state_province = StateProvince::find_by_code($this->country, $this->state_province); $address .= $state_province->name . ":"; } //post code if (isset($this->post_code) && !empty($this->post_code)) { $address .= $this->post_code . ":"; } //country if (isset($this->country) && !empty($this->country)) { $country = Country::find_by_code($this->country); $address .= $country->name . ":"; } else { return ""; } return $address; }
$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; $country_name = $country_arry->name; $smarty->assign('country', $country_name); $smarty->assign('country_url', $country_var_name); //states $state = StateProvince::find_by_code($jobs->country, $jobs->state_province); $state_name = empty($state) ? $jobs->state_province : $state->name; $state_var_name = $state ? $state->var_name : $jobs->state_province; $smarty->assign('state', $state_name); $smarty->assign('state_url', $country_var_name . "/" . $state_var_name . "/"); //county $county = County::find_by_code($jobs->country, $jobs->state_province, $jobs->county); $county_name = empty($county) ? $jobs->county : $county->name; $county_var_name = $county ? $county->var_name : $jobs->county;
} $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 . "/"); //county $county = County::find_by_code($cv_details->country, $cv_details->state_province, $cv_details->county); $county_name = empty($county) ? $cv_details->county : $county->name; $county_var_name = $county ? $county->var_name : $cv_details->county; $smarty->assign('county', $county_name); $smarty->assign('county_url', $country_var_name . "/" . $state_var_name . "/" . $county_var_name . "/");
public static function recommendedJob($user_id = 0, $cvjob_title = null, $cvjob_title2 = null, $cvjob_city = null, $cvjob_county = null, $cvjob_state = null, $cvjob_country = null) { global $database, $db; $select = " SELECT job_title, city, county, state_province, country, fk_employer_id,var_name, created_at "; $select .= ", match( job.job_title, job.job_description ) against ('" . $cvjob_title . "' '+" . $cvjob_title2 . "' IN BOOLEAN MODE) as relevance "; $from = " FROM " . self::$table_name . " AS job "; $where = " WHERE job.id NOT IN ( SELECT job_h.fk_job_id from " . TBL_HISTORY . " as job_h WHERE job_h.fk_employee_id={$user_id}) "; $where .= " AND job.is_active='Y' AND job.job_status='approved' AND job.id > 0 "; //$where .= " AND var_name <> '".$old."' "; $where .= " AND match( job.job_title, job.job_description ) against ('" . $cvjob_title . "' '+" . $cvjob_title2 . "' IN BOOLEAN MODE)"; $where .= " AND DATE_ADD( job.created_at, INTERVAL " . JOBLASTFOR . " DAY ) > NOW() "; //$where .= " AND city='{$cvjob_city}' "; $where .= " AND county='{$cvjob_county}' "; $where .= " AND state_province='{$cvjob_state}'"; $where .= " AND country='{$cvjob_country}'"; $order = " ORDER BY relevance, created_at DESC "; $limit = " LIMIT 10 "; //SELECT job.job_title, job.city, job.county, job.state_province, job.country //FROM jobberland_job AS job //WHERE job.id NOT IN (SELECT job_h.fk_job_id from jobberland_job_history as job_h WHERE fk_employer_id = 1) $sql = $select . $from . $where . $order . $limit; //echo $sql; $result = $database->query($sql); $num_rows = $database->num_rows($result); if ($num_rows > 0) { $i = 1; $temp = array(); while ($row = $database->fetch_object($result)) { $temp[$i]['job_title'] = $row->job_title; $temp[$i]['var_name'] = $row->var_name; $temp[$i]['created_at'] = strftime(DATE_FORMAT, strtotime($row->created_at)); //country $country_arry = Country::find_by_code($row->country); $country_name = $country_arry->name; //states $state = StateProvince::find_by_code($row->country, $row->state_province); $state_name = empty($state) ? $row->state_province : $state->name; //county $county = County::find_by_code($row->country, $row->state_province, $row->county); $county_name = empty($county) ? $row->county : $county->name; //city $city = City::find_by_code($row->country, $row->state_province, $row->county, $row->city); $city_name = empty($city) ? $row->city : $city->name; $temp[$i]['location'] = $city_name . ", " . $county_name . ", " . $state_name . ", " . $country_name; $employer = Employer::find_by_id($row->fk_employer_id); $company_name = $employer->company_name; $temp[$i]['company_name'] = $company_name; //$temp[$i]['job_title'] = $row->job_title; //$temp[$i]['job_title'] = $row->job_title; $i++; } return $temp; } return false; }
$country_name = $country_arry->name; $city = City::find_by_code($jobs->country, $jobs->state_province, $jobs->county, $jobs->city); $city_name = empty($city) ? $jobs->city : $city->name; $smarty->assign('apply_for', $jobs->job_title . " " . strtolower(format_lang('at')) . " " . $employer->company_name . " " . strtolower(format_lang('in')) . " " . $city_name . ", " . $country_name); unset($employer, $city, $country_arry); //Congratulations! You've applied for: //IT Manager at IT Lab in London EC1A 9PT if ($jobs) { $job_s = array(); $i = 1; $job_suggestions = Job::apply_suggestion($jobs->job_title, $var_name); foreach ($job_suggestions as $job_suggestion) { $employer = Employer::find_by_id($job_suggestion->fk_employer_id); //locations //country $country_arry = Country::find_by_code($job_suggestion->country); $country_name = $country_arry->name; //states $state = StateProvince::find_by_code($job_suggestion->country, $job_suggestion->state_province); $state_name = empty($state) ? $job_suggestion->state_province : $state->name; //county $county = County::find_by_code($job_suggestion->country, $job_suggestion->state_province, $job_suggestion->county); $county_name = empty($county) ? $job_suggestion->county : $county->name; //city $city = City::find_by_code($job_suggestion->country, $job_suggestion->state_province, $job_suggestion->county, $job_suggestion->city); $city_name = empty($city) ? $job_suggestion->city : $city->name; //end $job_s[$i]['id'] = $job_suggestion->id; $job_s[$i]['var_name'] = $job_suggestion->var_name; $job_s[$i]['job_title'] = $job_suggestion->job_title; $job_s[$i]['company_name'] = $employer->company_name;
$employee = Employee::find_by_id($rows->fk_employee_id); $manage_list[$i]['id'] = $rows->id; $manage_list[$i]['employee_name'] = $employee->full_name(); $manage_list[$i]['employee_id'] = $rows->fk_employee_id; $manage_list[$i]['cv_title'] = $rows->cv_title; $manage_list[$i]['look_job_title'] = $rows->look_job_title; $manage_list[$i]['look_job_title2'] = $rows->look_job_title2; $status = JobStatus::find_by_id($rows->look_job_status); $status_name = $status->status_name; $manage_list[$i]['look_job_status'] = $status_name; $manage_list[$i]['recent_job_title'] = $rows->recent_job_title; //$manage_list[$i]['city']= $rows->city; $manage_list[$i]['modified_at'] = strftime(DATE_FORMAT, strtotime($rows->modified_at)); //locations //country $country_arry = Country::find_by_code($rows->country); $country_var_name = $country_arry->var_name; $country_name = $country_arry->name; //states $state = StateProvince::find_by_code($rows->country, $rows->state_province); $state_name = empty($state) ? $rows->state_province : $state->name; //county $county = County::find_by_code($rows->country, $rows->state_province, $rows->county); $county_name = empty($county) ? $rows->county : $county->name; $city = City::find_by_code($rows->country, $rows->state_province, $rows->county, $rows->city); $city_name = empty($city) ? $rows->city : $city->name; //end of location $manage_list[$i]['city'] = $city_name . ", " . $county_name . ",<br />" . $state_name . ", " . $country_name; //$manage_list[$i]['city_url'] = $state_var_name."/".$county_var_name."/".$city_var_name."/"; $i++; }
$html_title = SITE_NAME . " - " . format_lang('page_title', 'BrowseBYLocation') . " - ( " . $city_name . ", " . $county_name . ", " . $state_name . ", " . $country_name . " ) "; } $smarty->assign('lang', $lang); $smarty->assign('message', $message); $smarty->assign('rendered_page', $smarty->fetch('job_location.tpl')); break; ///this is the first page ///this is the first page default: $job_states = Job::location_top_link(); if ($job_states) { $activeLink = array(); $i = 1; foreach ($job_states as $job_state) { //states $state_code = Country::find_by_code($job_state->country); $state_var_name = $state_code ? $state_code->var_name : $job_state->country; $state_name = $state_code ? $state_code->name : $job_state->country; $activeLink[$i]['name'] = $state_name; $activeLink[$i]['var_name'] = $state_var_name; $activeLink[$i]['url'] = ""; $i++; } $smarty->assign('activeLink', $activeLink); } ///jobs $job_by_locations = Job::list_job_by_location($country_code); if ($job_by_locations2) { $location = array(); $i = 1; foreach ($job_by_locations as $job_by_location) {