<?php

/* A simple page to display the Quick Search Results */
require_once __DIR__ . '/jobQuickSearchResults.php';
$jobQuickSearchResults = new JobQuickSearchResults();
echo $jobQuickSearchResults->outputPage();
?>


 protected function searchCondition()
 {
     $conditionList = array();
     $conditionQuery = "";
     /* will insert here the additional conditions */
     $conditionDistrictId = static::queryConditionDistrictId($this->jobSearchForm->getSearchedDistrictId());
     if (!empty($conditionDistrictId)) {
         array_push($conditionList, $conditionDistrictId);
     }
     $conditionJobSubCategoryId = static::queryConditionJobSubCategoryId($this->jobSearchForm->getSearchedJobSubCategoryId());
     if (!empty($conditionJobSubCategoryId)) {
         array_push($conditionList, $conditionJobSubCategoryId);
     }
     $conditionWorkTypeId = static::queryConditionWorkTypeId($this->jobSearchForm->getSearchedWorkTypeId());
     if (!empty($conditionWorkTypeId)) {
         array_push($conditionList, $conditionWorkTypeId);
     }
     $conditionSalary = static::queryConditionSalary($this->jobSearchForm->getSearchedSalaryLow(), $this->jobSearchForm->getSearchedSalaryHigh());
     if (!empty($conditionSalary)) {
         array_push($conditionList, $conditionSalary);
     }
     foreach ($conditionList as $condition) {
         $conditionQuery .= " AND {$condition}";
     }
     if (!empty($conditionQuery)) {
         $conditionQuery = substr($conditionQuery, strlen(" AND "));
         $conditionQuery = parent::searchCondition() . " AND " . $conditionQuery;
     } else {
         /* will never be empty because it contains the DATE condition */
         $conditionQuery = parent::searchCondition();
     }
     /* add the searchSortOrder condition */
     $queryConditionSortOrder = $this->queryConditionSortOrder($this->jobSearchForm->getSearchedSortOrder());
     if (!empty($queryConditionSortOrder)) {
         $conditionQuery .= " " . $queryConditionSortOrder;
     }
     return $conditionQuery;
 }