×

Notice

The forum is in read only mode.

State in Job Search Results?

14 years 3 months ago #956 by Christian Patrick Helvin
In the job_searchresults.php page. I need the state to be shown here as well. How can I do that? Thanks!
14 years 3 months ago #962 by Ahmad
Replied by Ahmad on topic State in Job Search Results?
Please add this line in job_searchresults.php where you want to display state
<td class=\"maintext\">&nbsp;<strong><?php echo JText::_(\'JS_STATE\'); ?>	</strong></td>
						<td class=\"maintext\"><?php echo $app->statename; ?></td>

Replace this query in models/jsjobs.php function getJobSearch
		$query = \"SELECT job.*, cat.cat_title, jobtype.title AS jobtypetitle, jobstatus.title AS jobstatustitle 
				, salary.rangestart, salary.rangeend, country.name AS countryname, state.name AS stateyname
				, company.name AS companyname, company.url
				FROM \".$db->nameQuote(\'#__js_job_jobs\').\" AS job
				JOIN \".$db->nameQuote(\'#__js_job_jobtypes\').\" AS jobtype ON job.jobtype = jobtype.id 
				JOIN \".$db->nameQuote(\'#__js_job_jobstatus\').\" AS jobstatus ON job.jobstatus = jobstatus.id 
				LEFT JOIN \".$db->nameQuote(\'#__js_job_companies\').\" AS company ON job.companyid = company.id 
				LEFT JOIN \".$db->nameQuote(\'#__js_job_salaryrange\').\" AS salary ON job.jobsalaryrange = salary.id 
				LEFT JOIN \".$db->nameQuote(\'#__js_job_countries\').\" AS country ON job.country = country.code 
LEFT JOIN \".$db->nameQuote(\'#__js_job_states\').\" AS state ON job.state = state.code 
				, \".$db->nameQuote(\'#__js_job_categories\').\" AS cat \"; 
			if ($country != \'\') $query .= \" , \".$db->nameQuote(\'#__js_job_countries\').\" AS country2 \";
			if ($state != \'\') $query .= \" , \".$db->nameQuote(\'#__js_job_states\').\" AS state \";
			if ($county != \'\') $query .= \" , \".$db->nameQuote(\'#__js_job_counties\').\" AS county \";
			if ($city != \'\') $query .= \" , \".$db->nameQuote(\'#__js_job_cities\').\" AS city \";
			$query .= \"WHERE job.jobcategory = cat.id AND job.status = 1 AND (job.jobstatus BETWEEN 1 AND 5) 
						AND job.startpublishing <= \" . $db->Quote($curdate) . \" AND job.stoppublishing >= \" . $db->Quote($curdate);

Please write your valuable review JS Jobs and JS Support Ticket at JED.
Time to create page: 0.056 seconds

Please publish modules in offcanvas position.