コード例 #1
0
 function getResults($data = null)
 {
     if (!isset($data) || !is_array($data)) {
         $data = $_REQUEST;
     }
     $start = isset($data['start']) ? (int) $data['start'] : 0;
     $page = $this->controller->data();
     $keywords = isset($data['SearchQuery']) ? urldecode($data['SearchQuery']) : '';
     $location = isset($data['SearchLocation']) ? $data['SearchLocation'] : '';
     $miles = isset($data['SearchMiles']) ? intval($data['SearchLocation']) : '';
     $sort = isset($data['SearchSort']) ? $data['SearchSort'] : '';
     $window = isset($data['SearchWindow']) ? $data['SearchWindow'] : '';
     $config = SiteConfig::current_site_config();
     $service = new SimplyHiredService($config->getJobamaticPublisherID(), $config->getJobamaticDomain());
     $service->setQuery($keywords);
     $service->setLocation($location, $miles);
     $service->setSort($sort);
     $service->setWindowSize($window);
     $service->setPage($start);
     // echo $service->getAbsoluteRequestURL();exit;
     $data = $service->request();
     $this->jobSearchTitle = $service->getJobSearchTitle();
     return $data;
 }
コード例 #2
0
 public function searchJobs($query, $location = "", $miles = 25, $sort = 'rd', $window = 10)
 {
     $config = SiteConfig::current_site_config();
     $page = $this->start / $window + 1;
     $service = new SimplyHiredService($config->getJobamaticPublisherID(), $config->getJobamaticDomain());
     $service->setQuery($query);
     $service->setLocation($location, $miles);
     $service->setSort($sort);
     $service->setWindowSize($window);
     $service->setPage($page);
     return $service->request();
 }