load->helper('string');
//Get url params
$url = parse_url($_SERVER['REQUEST_URI']);
if (isset($url["query"])) {
parse_str($url["query"], $params);
if (isset($params["keywords"])) {
$srcParam = explode(" ", $params["keywords"]);
//Create regex for search parameters
$pattern = '/';
for($i = 0; $i < count($srcParam); $i++){
$pattern .= '\b' . $srcParam[$i] . '\b';
if ($i != count($srcParam) - 1)
$pattern .= '|';
}
$pattern = $pattern . '/i';
}
}
$result = getJobPostings();
//Filter results
echo count($result->Data->Rows);
$jobs = array_filter(array_slice($result->Data->Rows, 0, 20), function ($value) use($pattern, $params) {
if (isset($params["loc"])) {
if (strpos($value->OrgUnit_ShortName, $params["loc"]) === false)
return false;
}
if ($pattern != '') {
//Filter out search keywords
return preg_match($pattern, $value->JobReq_ShortName) +
preg_match($pattern, $value->OrgUnit_ShortName) +
preg_match($pattern, $value->JobReq_JobReqId);
}
return true;
});
foreach ($jobs as $value) {
$date = date_parse($value->JobReq_RequestDate);
$content = '
' .
'
' .
'
' .
'
Information Technology
' .
'
' . $value->JobReq_ShortName . '
' .
'
' . makeDescPretty(strip_tags($value->JobPosting_LongName)) . '...View More
' .
'
' . $value->JobReq_JobReqId . '
' .
'
'. parseLocation($value->OrgUnit_ShortName) .'
' .
'
' .
'
' .
'
' .
'
';
echo $content;
}
function makeDescPretty($text)
{
$text = '
' . $text;
$text = str_replace("•", "•", $text);
$text .= '';
return $text;
}
function getJobPostings()
{
$curl = curl_init();
//curl_setopt($curl, CURLOPT_HTTPGET);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, 'RecruitingAPI:BEK@1906API');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Accept: application/json',
'Content-Type: application/json',
));
curl_setopt($curl, CURLOPT_URL, 'https://us63-services.dayforcehcm.com/Api/bekco/V1/Reports/JobPostingsAPI');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
$result = curl_exec($curl);
curl_close($curl);
if (!$result) {
echo "Request failed\n";
echo curl_errno($curl) . "\n";
echo curl_error($curl);
}
return json_decode($result);
}
function parseLocation($data)
{
if (strpos($data, "FAM") !== false)
return "Amarillo";
else if (strpos($data, "FAQ") !== false)
return "Albuquerque";
else if (strpos($data, "FDF") !== false)
return "Fort Worth/Dallas";
else if (strpos($data, "FEL") !== false)
return "Elba";
else if (strpos($data, "FHS") !== false)
return "Houston";
else if (strpos($data, "FLR") !== false)
return "Little Rock";
else if (strpos($data, "FOK") !== false)
return "Oklahoma";
else if (strpos($data, "FSA") !== false)
return "San Antonio";
}
?>
Information Technology
Project Manager
Seeking an experienced Project Manager to join our growing Project Management Office. Candidates for this role will be responsible for leading large, complex technology projects across multiple domain areas....View More
4586
Fort Worth, Texas
Information Technology
Project Manager
Seeking an experienced Project Manager to join our growing Project Management Office. Candidates for this role will be responsible for leading large, complex technology projects across multiple domain areas....View More
4586
Fort Worth, Texas
Information Technology
Project Manager
Seeking an experienced Project Manager to join our growing Project Management Office. Candidates for this role will be responsible for leading large, complex technology projects across multiple domain areas....View More
4586
Fort Worth, Texas
Information Technology
Project Manager
Seeking an experienced Project Manager to join our growing Project Management Office. Candidates for this role will be responsible for leading large, complex technology projects across multiple domain areas....View More
4586
Fort Worth, Texas
Information Technology
Project Manager
Seeking an experienced Project Manager to join our growing Project Management Office. Candidates for this role will be responsible for leading large, complex technology projects across multiple domain areas....View More
4586 FOK
Fort Worth, Texas