$criteria['salary'] = $_POST['salary']; $_SESSION['yel']['job_search']['criteria']['salary'] = $_POST['salary']; } if (isset($_POST['salary_end'])) { $criteria['salary_end'] = $_POST['salary_end']; $_SESSION['yel']['job_search']['criteria']['salary_end'] = $_POST['salary_end']; } if (isset($_POST['limit'])) { $criteria['limit'] = $_POST['limit']; $_SESSION['yel']['job_search']['criteria']['limit'] = $_POST['limit']; } if (isset($_POST['offset'])) { $criteria['offset'] = $_POST['offset']; $_SESSION['yel']['job_search']['criteria']['offset'] = $_POST['offset']; } $result = $job_search->search_using($criteria); if ($result == 0) { echo "0"; exit; } if (!$result) { echo "ko"; exit; } foreach ($result as $i => $row) { $result[$i]['employer'] = !is_null($row['alternate_employer']) && !empty($row['alternate_employer']) ? $row['alternate_employer'] : $row['employer']; $result[$i]['title'] = htmlspecialchars_decode($row['title']); $result[$i]['salary'] = number_format($row['salary'], 2, '.', ', '); $result[$i]['salary_end'] = number_format($row['salary_end'], 2, '.', ', '); $result[$i]['potential_reward'] = number_format($row['potential_reward'], 2, '.', ', '); $new_lines = array("\r", "\n", "\r\n");
public function get_jobs($_keyword_str = '', $_industry = 0, $_country = '', $_employer = '', $_limit = '', $_offset = 0, $_order_by = 'jobs.created_on', $_order = 'DESC', $_salary_start = 0, $_salary_end = 0) { $jobs = array(); if (empty($_limit) || $_limit <= 0) { $_limit = $GLOBALS['default_results_per_page']; } if (empty($_keyword_str) && empty($_country) && empty($_employer) && ($_industry <= 0 || !is_numeric($_industry))) { $this->error = 'get_jobs : keywords, country, employer and industry cannot be empty.'; return false; } $criteria = array(); $criteria['order_by'] = $_order_by . ' ' . $_order; $criteria['industry'] = $_industry; $criteria['employer'] = $_employer; $criteria['country_code'] = $_country; $criteria['limit'] = $_limit; $criteria['offset'] = $_offset; $criteria['keywords'] = $_keyword_str; $criteria['is_local'] = 1; $criteria['salary'] = $_salary_start; $criteria['salary_end'] = $_salary_end; $this->log_api_usage('get_jobs : ' . $this->array_to_text($criteria)); $job_search = new JobSearch(); $result = $job_search->search_using($criteria); if ($result == 0) { return array(); } if ($result === false) { $this->error = 'get_jobs : JobSearch encountered an error.'; return false; } $jobs['total'] = $job_search->total_results(); $jobs['jobs'] = $result; return $jobs; }