function get_cities_cloud() { global $db; $city_array = array(); $sql = 'SELECT c.id, c.name, c.ascii_name, COUNT(*) AS nr FROM ' . DB_PREFIX . 'cities c INNER JOIN ' . DB_PREFIX . 'jobs j ON (j.city_id = c.id ) WHERE j.is_active = 1 GROUP BY c.name'; $cities = $db->QueryArray($sql); foreach ($cities as $city) { $numberOfJobs = $city['nr']; $city_array[] = array('name' => $city['name'], 'varname' => $city['ascii_name'], 'count' => $numberOfJobs, 'tag_height' => get_cloud_tag_height($numberOfJobs)); } return $city_array; }
<?php /** * jobber job board platform * * @author Chronos <http://chronoscripts.com> <*****@*****.**> * @license You are free to edit and use this work, but it would be nice if you always referenced the original author ;) * (see license.txt). */ $city_array = get_cities_cloud(); $smarty->assign('cities_overview', $city_array); $numberOfJobsInOtherCities = $job->GetNumberOfJobsInOtherCities(); $smarty->assign('jobs_count_in_other_cities', $numberOfJobsInOtherCities); $smarty->assign('jobs_count_in_other_cities_tag_height', get_cloud_tag_height($numberOfJobsInOtherCities)); $totalNumberOfJobs = 0; foreach ($city_array as $city_job_data) { $totalNumberOfJobs += $city_job_data['count']; } $totalNumberOfJobs += $numberOfJobsInOtherCities; $smarty->assign('total_number_of_jobs', $totalNumberOfJobs); $html_title = $translations['jobscity']['page_title']; $template = 'cities.tpl';
<?php $companies = array(); $sanitizer = new Sanitizer(); $sql = 'SELECT company, count(id) AS nr FROM ' . DB_PREFIX . 'jobs WHERE is_temp = 0 AND is_active = 1 GROUP BY company ORDER BY company ASC'; $comps = $db->QueryArray($sql); foreach ($comps as $company) { $nr = $company['nr']; $tag_height = get_cloud_tag_height($nr); $companies[] = array('name' => $company['company'], 'varname' => $sanitizer->sanitize_title_with_dashes($company['company']), 'count' => $nr, 'tag_height' => $tag_height); } $smarty->assign('companies', $companies); $smarty->assign('companies_count', count($comps)); $html_title = $translations['companies']['page_title']; $template = 'companies.tpl';