$subval\r";
}
}else{
if(is_array($selectedval)){ // for multi selects
while(list($sskey,$ssval) = @each($selectedval)){
$output .= $ssval." - ".$key;
$S = option_selected($ssval,$key,$default);
if($S) break;
}
@reset($selectedval);
}else $S = option_selected($selectedval,$key,$default);
$output .= "$val \r";
}
}
return $output;
}
//Declare the custom function for formatting
function pretty_print($json_data)
{
//Initialize variable for adding space
$space = 0;
$flag = false;
//Using
tag to format alignment and font
//loop for iterating the full json data
for($counter=0; $counter < strlen($json_data); $counter++)
{
if ( $json_data[$counter] == '}')
{
$result = $result."\n";
$space--;
$c = 0;
while ($c < $space*2)
{
$result = $result." ";
$c++;
}
$result = $result.$json_data[$counter];
} //if
else if ($json_data[$counter] == ']' )
{
$result = $result."\n";
$space--;
$c = 0;
while ($c < $space*2)
{
$result = $result." ";
$c++;
}
$result = $result.$json_data[$counter];
} //if
elseif ($json_data[$counter] == ',')
{
$result = $result.$json_data[$counter]."\n";
$c = 0;
while ($c < $space*2)
{
$result = $result." ";
$c++;
}
} //if
//Checking starting second and third brackets
elseif ($json_data[$counter] == '{')
{
$result = $result.$json_data[$counter]."\n";
$space++;
$c = 0;
while ($c < $space*2)
{
$result = $result." ";
$c++;
}
}
elseif ($json_data[$counter] == '[')
{
$result = $result.$json_data[$counter]."\n";
$space++;
$c = 0;
while ($c < $space*2)
{
$result = $result." ";
$c++;
}
} //if
else
{
$result = $result.$json_data[$counter];
}
} //for
return $result;
}
//////////////////////////////////////////
if( $_POST['ha_action'] && $_POST['ha_action'] != "Display")
{
// create client object
$client = new SoapClient($_POST['WSDL'], array('trace' => 1));
$fileData = catchupload($_FILES['document']['tmp_name']);
if(isset($_POST['ha_action']) && !isset($_POST['save_as_file']))
{
if (isset($_POST['output_type']))
{
$output = $_POST['output_type'];
if ($output == "output_hrxml")
$set_output = "HR-XML";
else if ($output == "output_json")
$set_output = "JSON";
else
$set_output = "HR-XML";
}
else
$set_output = "HR-XML";
}
//echo "OUTPUT ".$set_output;
if($_REQUEST['URL'] && trim($_REQUEST['URL'])) //IAG 08/02/19
{
$_SESSION['result1'] = $client->ParseDocNew_fromURL($_REQUEST['product_code'],$_REQUEST['URL']);
}
// SMC 9-3-09
else if($_REQUEST['cid'] != "")
$_SESSION['result1'] = $client->ParseDoc($_REQUEST['did'],$_REQUEST['pid'], $_REQUEST['cid'],$_FILES['document']['name'],base64_encode($fileData));
else
$_SESSION['result1'] = $client->ParseDocNew($_REQUEST['product_code'],$_FILES['document']['name'],base64_encode($fileData), "", "", "", $set_output);
// if a fault occurred, output error info
if (isset($fault))
{
print "Error: ". $fault;
}
else if ($_SESSION['result1'] == -1)
{
print "THE RESULT WAS INVALID ";
}
else
{
// otherwise output the result
//print " ".$result1;
}
// kill object
unset($client);
}
//if (!isset($_POST['ha_action']))
//{
// mail('innagliksberg@gmail.com', 'Someone has accessed the Resume Demo', 'Someone has accessed the Resume Demo');
//}
header("Content-type: text/html; charset=utf-8");
$output = "".
"HireAbility Resume Parsing Demo \r".
" ".
" ".
"".
"\r".
"".
"\r".
"";
//background-color: #f4511e;
echo $output;
?>
function buildHTMLoutput($result='')
{
$tag_style_2c = "style='vertical-align:middle; text-align:left; font-size:12pt; font-weight:bold; color:gainsboro; padding:5px;'";
$tag_style_2d = "style='white-space:normal; vertical-align:middle; text-align:left; font-size:14pt; font-weight:bold; color:#333333;'";
$tag_style_2dd = "style='white-space:normal; vertical-align:middle; text-align:left; font-size:12pt; font-weight:bold; color:#333333;'";
$tag_style_2ddd = "style='white-space:normal; vertical-align:middle; text-align:left; font-size:12pt; font-weight:bold; color:#333333; padding-top:10px'";
//background:linear-gradient(lightgrey, grey); color:#ffffff;'"; //color:steelblue; background-color:lightslategrey;
$tag_style_3 = "style='vertical-align:top; text-align:left; white-space:normal; font-weight:500; font-size:12pt; color:steelblue; padding:5px; padding-left:20px'";
$tag_style_3a = "style='vertical-align:top; font-size:12pt; font-weight:500; color:black;'";
$tag_style_3aa = "style='vertical-align:top; font-size:10pt; font-weight:500; color:black;'";
$tag_style_3b = "style='vertical-align:top; font-size:12pt; font-weight:bold; color:black;'";
$tag_style_3c = "style='vertical-align:top; white-space:normal; font-size:12pt; font-weight:bold; padding: 5px; color:grey;'";
//$tag_style_3e = "style='vertical-align:top; white-space:nowrap; font-weight:550; font-size:11pt; color:lightslategrey; padding:0px;'";
$tag_style_3e = "style='vertical-align:top; white-space:nowrap; font-weight:bold; font-size:12pt; color:slategrey;'";
$tag_style_3ee = "style='vertical-align:top; white-space:nowrap; font-weight:550; font-size:12pt; color:black;'";
$posStart = strpos($result,"{");
if ($posStart !== false && $posStart == 0)
{
$json = true;
}
else
{
$json = false;
}
/////////////////////////////////////////////////////////// JSON //////////////////////////////////////////////////////////
if ($json !== false) //04/28/17
{
$var = json_decode($result, true);
$var1 = $var["Results"][0]["HireAbilityJSONResults"][0];
$address = $var1["Address"][0];
$phone = $var1["Phone"];
$email = $var1["Email"];
$website = $var1["Web"];
$linkedIn = $var1["LinkedIn"];
$facebook = $var1["Facebook"];
$instagram = $var1["Instagram"];
$github = $var1["Github"];
$skype = $var1["SkypeId"];
$instagram = $var1["Instagram"];
$github = $var1["Github"];
$skype = $var1["Skype"];
$executiveSummary = $var1["ExecutiveSummary"];
$position = $var1["PositionHistory"];
$education = $var1["EducationOrganizationAttendance"];
$skill = $var1["PersonCompetency"];
$cert = $var1["Certification"];
$license = $var1["License"];
$languages = $var1["Languages"];
$primaryLanguage = $var1["PrimaryLanguage"];
$security = $var1["SecurityCredentials"];
$citizenship = $var1["Citizenship"];
$nationality = $var1["Nationality"];
$dateOfBirth = $var1["DateOfBirth"];
$birthPlace = $var1["BirthPlace"];
$religion = $var1["Religion"];
$age = $var1["Age"];
$ethnicity = $var1["Ethnicity"];
$objective = $var1["Objective"];
$matters = $var1["Matters"];
$maritalStatus = $var1["MaritalStatus"];
$workEligibility = $var1["WorkEligibility"];
$personLegalId = $var1["PersonLegalId"];
$highestDegree = $var1["HighestDegree"];
$mostRecentJobTitle = $var1["MostRecentJobTitle"];
$employmentReferences = $var1["EmploymentReferences"];
//var_dump($var1["Languages"]);
//print "HELLO ".$phone[0]["Number"];
//print "HELLO ".$linkedIn[0]["Address"];
//CONTACT INFO
//NAME
$posStart = strpos($result, "FormattedName");
$name .= "";
if (sizeof($var1['FormattedName']) > 0 || sizeof($var1['GivenName']) > 0 || sizeof($var1['FamilyName']) > 0)
{
$name .= "
";
}
if ($posStart !== false)
{
$name .= "
Formatted Name: ";
$name .= $var1['FormattedName'];
$name .= "
";
}
$posStart = strpos($result, "GivenName");
if ($posStart !== false)
{
$name .= "
First Name: ";
$name .= $var1['GivenName'];
$name .= "
";
}
$posStart = strpos($result, "MiddleName");
if ($posStart !== false)
{
$name .= "
Middle Name: ";
$name .= $var1['MiddleName'];
$name .= "
";
}
$posStart = strpos($result, "FamilyName");
if ($posStart !== false)
{
$name .= "
Family Name: ";
$name .= $var1['FamilyName'];
$name .= "
";
}
$name .= "
";
//ADDRESS
$posStart = strpos($result, "Address");
if (sizeof($address) > 0)
{
$name .= ""; //color of the box div
$name .= "
";
//ADDRESS LINE
$posStart = strpos($result, "AddressLine");
if ($posStart !== false)
{
$name .= "
Street Address: ";
$name .= $address['AddressLine'];
$name .= "
";
}
$name .= "
"; //container for City/State
//CITY
$posStart = strpos($result, "CityName");
if ($posStart !== false)
{
$name .= "City: ";
$name .= $address['CityName'];
$name .= " ";
}
//STATE
$posStart = strpos($result, "CountrySubDivisionCode");
if ($posStart !== false)
{
$name .= " State/Province: ";
$name .= $address['CountrySubDivisionCode'];
$name .= " ";
}
$name .= "
"; //container for City/State
$name .= "
"; //container for Zip/Country
//ZIP CODE
$posStart = strpos($result, "PostalCode");
if ($posStart !== false)
{
$name .= "Postal Code: ";
$name .= $address['PostalCode'];
$name .= " ";
}
//COUNTRY CODE
$posStart = strpos($result, "\"CountryCode\"");
if ($posStart !== false)
{
//echo "\nHERE1 ", $posStart,", ", $length;
$name .= " Country Code: ";
$name .= $address['CountryCode'];
$name .= " ";
}
$name .= "
"; //container for City/State/Zip
$name .= "
";
} //address
//TELEPHONE
$posStart = strpos($result, "\"Phone\"");
if (sizeof($phone) > 0)
{
$name .= ""; //color of the box div
$name .= "
";
$size = sizeof($phone);
$counter = 0;
while ($counter < $size)
{
$phoneType = $phone[$counter]["Label"];
if ($phoneType == "personal")
{
$phoneType = "Home";
}
else if ($phoneType == "mobile")
{
$phoneType = "Mobile";
}
else if ($phoneType == "other")
{
$phoneType = "Other";
}
$name .= "
".$phoneType." Number: ";
$name .= $phone[$counter]["Number"];
$name .= "
";
$counter++;
} //while
$name .= "
";
}
//EMAIL
//$posStart = strpos($result, "\"Email\"");
if (sizeof($email) > 0)
{
$name .= ""; //color of the box div
$size = sizeof($email);
$counter = 0;
while ($counter < $size)
{
$emailType = $email[$counter]["Label"];
$name .= "
Email (".$emailType."): ";
$name .= $email[$counter]["Address"];
$name .= "
";
$counter++;
//echo $emails, "\n";
} //while
$name .= "
";
} //email
//WEBSITE
if (sizeof($website) > 0)
{
$name .= ""; //color of the box div
$size = sizeof($website);
$counter = 0;
while ($counter < $size)
{
$websiteType = $website[$counter]["Label"];
$name .= "
Website (".$websiteType.") ";
$name .= $website[$counter]["Address"];
$name .= "
";
$counter++;
}
$name .= "
";
} //website
//LINKEDIN
if (sizeof($linkedIn) > 0)
{
$name .= ""; //color of the box div
$name .= "
LinkedIn: ";
$name .= $linkedIn[0]["Address"];
$name .= "
";
$name .= "
";
} //linkedin
//FACEBOOK
if (sizeof($facebook) > 0)
{
$name .= ""; //color of the box div
$name .= "
Facebook: ";
$name .= $facebook[0]["Address"];
$name .= "
";
$name .= "
";
} //facebook
//Instagram
if (sizeof($instagram) > 0)
{
$name .= ""; //color of the box div
$name .= "
Instagram: ";
$name .= $instagram[0]["Address"];
$name .= "
";
$name .= "
";
} //instagram
//GITHUB
if (sizeof($github) > 0)
{
$name .= ""; //color of the box div
$name .= "
Github: ";
$name .= $github[0]["Address"];
$name .= "
";
$name .= "
";
} //github
//SKYPE
if (sizeof($skype) > 0)
{
$name .= ""; //color of the box div
$name .= "
Skype ID: ";
$name .= $skype[0]["Address"];
$name .= "
";
$name .= "
";
} //skype
if (sizeof(maritalStatus) > 0 || sizeof($personLegalId) > 0 || sizeof($workEligibility) > 0 || sizeof($highestDegree) > 0 || sizeof($mostRecentJobTitle) > 0)
{
$name .= ""; //color of the box div
//MARITAL STATUS
if (sizeof($maritalStatus) > 0)
{
$name .= "
Marital Status: ";
$name .= $maritalStatus;
$name .= "
";
} //Martial Status
//PERSON LEGAL ID
if (sizeof($personLegalId) > 0)
{
$name .= "
Legal Id Number: ";
$name .= $personLegalId;
$name .= "
";
} //Person Legal Id
//WORK ELIGIBILITY
if (sizeof($workEligibility) > 0)
{
$name .= "
Work Eligibility: ";
$name .= $workEligibility[0]["CountryCode"];
$name .= "
";
} //work eligibility
//HIGHEST DEGREE
if (sizeof($highestDegree) > 0)
{
$highestDegree = strtolower($highestDegree);
$highestDegree = ucfirst($highestDegree);
$name .= "
Highest Degree: ";
$name .= $highestDegree;
$name .= "
";
}
//MOST RECENT JOB TITLE
if (sizeof($mostRecentJobTitle) > 0)
{
$name .= "
Most Recent Job Title: ";
$name .= $mostRecentJobTitle;
$name .= "
";
}
//SECURITY
if (sizeof($security) > 0)
{
$name .= "
Security Clearance: ";
$name .= $security;
$name .= "
";
} //Security
//Citizenship
if (sizeof($citizenship) > 0)
{
$name .= "
Citizenship: ";
$name .= $citizenship;
$name .= "
";
} //Citizenship
//Nationality
if (sizeof($nationality) > 0)
{
$name .= "
Nationality: ";
$name .= $nationality;
$name .= "
";
} //Nationality
//Primary Language
if (sizeof($primaryLanguage) > 0)
{
$name .= "
Primary Language: ";
$name .= $primaryLanguage;
$name .= "
";
} //Primary Language
//Date of Birth
if (sizeof($dateOfBirth) > 0)
{
$name .= "
Date of Birth: ";
$name .= $dateOfBirth;
$name .= "
";
} //Date of Birth
//Age
if (sizeof($age) > 0)
{
$name .= "
Age: ";
$name .= $age;
$name .= "
";
} //Age
//Birthplace
if (sizeof($birthPlace) > 0)
{
$name .= "
Place of Birth: ";
$name .= $birthPlace;
$name .= "
";
} //Birthplace
//Religion
if (sizeof($religion) > 0)
{
$name .= "
Religion: ";
$name .= $religion;
$name .= "
";
} //Religion
//Ethnicity
if (sizeof($ethnicity) > 0)
{
$name .= "
Ethnicity: ";
$name .= $ethnicity;
$name .= "
";
} //Security
$name .= "
"; //box
}
//OBJECTIVE
if (sizeof($objective) > 0)
{
$name .= ""; //color of the box div
$name .= "
Objective: ";
$name .= $objective;
$name .= "
";
$name .= "
";
} //executive summary
//EXECUTIVE SUMMARY
if (sizeof($executiveSummary) > 0)
{
$name .= ""; //color of the box div
$name .= "
Executive Summary: ";
$name .= $executiveSummary;
$name .= "
";
$name .= "
";
} //executive summary
//WORK HISTORY
$posStart = strpos($result, "\"PositionHistory\"");
if ($posStart !== false)
{
$size = sizeof($position);
if ($size > 0)
{
$name .= ""; //color of the box div
$name .= "
";
}
$counter = 0;
while ($counter < $size)
{
//EMPLOYER
$name .= "
EMPLOYER NAME: ";
$name .= $position[$counter]["Employer"];
$name .= "
";
//TITLE
if (sizeof($position[$counter]["PositionTitle"]) > 0)
{
$name .= "
Job Title: ";
$name .= $position[$counter]["PositionTitle"];
$name .= "
";
}
//LOCATION
if (sizeof($position[$counter]["ReferenceLocation"]) > 0)
{
$name .= "
Location: ";
if ($position[$counter]["ReferenceLocation"]["CityName"] !== false)
{
$name .= $position[$counter]["ReferenceLocation"]["CityName"];
$name .= " ";
}
if ($position[$counter]["ReferenceLocation"]["CountrySubDivisionCode"] !== false)
{
$name .= $position[$counter]["ReferenceLocation"]["CountrySubDivisionCode"];
$name .= " ";
}
if ($position[$counter]["ReferenceLocation"]["CountryCode"] !== false)
{
$name .= $position[$counter]["ReferenceLocation"]["CountryCode"];
}
$name .= "
";
}
//DATES
if (sizeof($position[$counter]["StartDate"]) > 0)
{
$name .= "
Start Date: ";
$name .= $position[$counter]["StartDate"];
$name .= "
";
}
if (sizeof($position[$counter]["EndDate"]) > 0)
{
$name .= "
End Date: ";
$name .= $position[$counter]["EndDate"];
$name .= "
";
}
else if (sizeof($position[$counter]["CurrentIndicator"]) > 0)
{
$name .= "
End Date: ";
$name .= "currently employed";
$name .= "
";
}
//INDUSTRY
if (sizeof($position[$counter]["Industry"]["Name"]) > 0)
{
$name .= "
Industry Type: ";
$name .= $position[$counter]["Industry"]["Name"];
$name .= "
";
}
//DESCRIPTION
if (sizeof($position[$counter]["Description"]) > 0)
{
$name .= "
Job Description: ";
$description = $position[$counter]["Description"];
$description = preg_replace('/\r\n/', ' ', $description);
$name .= $description;
$name .= "
";
}
//CONFIDENCE
$confidence = $position[$counter]["UserArea"];
if (sizeof($confidence) > 0)
{
$name .= "
INTELLIGENT CONFIDENCE SCORES:
";
$name .= "
Employer Name Confidence Rating: ";
$name .= $confidence[0][EmployerNameConfidenceRating];
$name .= "
";
$name .= "
Job Title Confidence Rating: ";
$name .= $confidence[0][JobTitleConfidenceRating];
$name .= "
";
$name .= "
Start Date Confidence Rating: ";
$name .= $confidence[0][StartDateConfidenceRating];
$name .= "
";
$name .= "
End Date Confidence Rating: ";
$name .= $confidence[0][EndDateConfidenceRating];
$name .= "
";
$name .= "
Dates Confidence Rating: ";
$name .= $confidence[0][DatesConfidenceRating];
$name .= "
";
$name .= "
Job Description Confidence Rating: ";
$name .= $confidence[0][DescriptionConfidenceRating];
$name .= "
";
$name .= "
Overall Position Confidence Rating: ";
$name .= $confidence[0][PositionConfidenceRating];
$name .= "
";
}
$counter++;
} //while
$name .= "
";
} //positions
//EDUCATION
//$posStart = strpos($result, "\"EducationOrganizationAttendance\"");
if (sizeof($education) > 0)
{
$name .= ""; //color of the box div
$name .= "
";
$size = sizeof($education);
$counter = 0;
while ($counter < sizeof($education))
{
//SCHOOL NAME
$name .= "
SCHOOL NAME: ";
$name .= $education[$counter]["School"];
$name .= "
";
//LOCATION
if (sizeof($education[$counter]["ReferenceLocation"]) > 0)
{
$name .= "
Location: ";
$name .= $education[$counter]["ReferenceLocation"]["CityName"];
$name .= " ";
$name .= $education[$counter]["ReferenceLocation"]["CountrySubDivisionCode"];
$name .= " ";
$name .= $education[$counter]["ReferenceLocation"]["CountryCode"];
$name .= "
";
} //location
//DEGREE
if (sizeof($education[$counter]["DegreeType"]) > 0)
{
$name .= "
Degree: ";
$name .= $education[$counter]["DegreeType"][0]["Name"];
$name .= "
";
}
//MAJOR
if (sizeof($education[$counter]["MajorProgramName"]) > 0)
{
$name .= "
Major: ";
$name .= $education[$counter]["MajorProgramName"][0];
$name .= "
";
}
//MINOR
if (sizeof($education[$counter]["MinorProgramName"]) > 0)
{
$name .= "
Minor: ";
$name .= $education[$counter]["MinorProgramName"][0];
$name .= "
";
}
//DATE
if (sizeof($education[$counter]["DegreeDate"]) > 0)
{
$name .= "
Graduation Date: ";
$name .= $education[$counter]["DegreeDate"];
$name .= "
";
}
//DATES OF ATTENDANCE
if (sizeof($education[$counter]["AttendanceStartDate"]) > 0)
{
$name .= "
Attendance Start Date: ";
$name .= $education[$counter]["AttendanceStartDate"];
$name .= "
";
if (sizeof($education[$counter]["AttendanceEndDate"]) > 0)
{
$name .= "
Attendance End Date: ";
$name .= $education[$counter]["AttendanceEndDate"];
$name .= "
";
}
}
$counter++;
} //while
$name .= "
";
} //education
//CERTIFICATIONS
if (sizeof($cert) > 0)
{
$name .= ""; //color of the box div
$name .= "
";
$counter = 0;
$size = sizeof($cert);
while ($counter < $size)
{
//CERTIFICATION NAME
$name .= "
".$cert[$counter]["CertificationName"]." ";
//$name .= $cert[$counter]["CertificationName"];
$name .= "
";
$counter++;
} //while
$name .= "
";
} //if
//LICENSES
if (sizeof($license) > 0)
{
$name .= ""; //color of the box div
$name .= "
Licenses & Certifications ^ ";
$counter = 0;
$size = sizeof($license);
while ($counter < $size)
{
//CERTIFICATION NAME
$name .= "
".$license[$counter]["LicenseName"]." ";
//$name .= $license[$counter]["LicenseName"];
$name .= "
";
$counter++;
} //while
$name .= "
";
} //if
//LANGUAGES
if (sizeof($languages) > 0)
{
$name .= ""; //color of the box div
$name .= "
";
$size = sizeof($languages);
$counter = 0;
while ($counter < $size)
{
//LANGUAGE CODE
$name .= "
";
$name .= $languages[$counter]["LanguageCode"];
$name .= "";
if ($languages[$counter]["Primary"])
{
$name .= "";
$name .= "Primary Language ";
$name .= " ";
}
if (sizeof($languages[$counter]["Listening"]) > 0)
{
$name .= "";
$name .= "Listening: ";
$name .= $languages[$counter]["Listening"];
$name .= " ";
}
if (sizeof($languages[$counter]["Reading"]) > 0)
{
$name .= "";
$name .= "Reading: ";
$name .= $languages[$counter]["Reading"];
$name .= " ";
}
if (sizeof($languages[$counter]["Conversation"]) > 0)
{
$name .= "";
$name .= "Conversation: ";
$name .= $languages[$counter]["Conversation"];
$name .= " ";
}
if (sizeof($languages[$counter]["Speaking"]) > 0)
{
$name .= "";
$name .= "Speaking: ";
$name .= $languages[$counter]["Speaking"];
$name .= " ";
}
if (sizeof($languages[$counter]["Writing"]) > 0)
{
$name .= "";
$name .= "Writing: ";
$name .= $languages[$counter]["Writing"];
$name .= " ";
}
$name .= " ";
$name .= "
";
$counter++;
} //while
$name .= "
";
} //if
//SKILLS
if (sizeof($skill) > 0)
{
$name .= ""; //color of the box div
$name .= "
";
$size = sizeof($skill);
$counter = 0;
while ($counter < $size)
{
//SKILL NAME
$name .= "
";
$name .= $skill[$counter]["CompetencyName"];
$name .= " Level: ";
$name .= $skill[$counter]["CompetencyLevel"];
$name .= "
";
$counter++;
} //while
$name .= "
";
} //if
//MATTERS
if (sizeof($matters) > 0)
{
$name .= ""; //color of the box div
$name .= "
";
$size = sizeof($matters);
$counter = 0;
while ($counter < $size)
{
$name .= "
Matter Name: ";
$name .= $matters[$counter]["MatterName"];
$name .= "
";
$counter++;
} //while
$name .= "
";
} //if
//CLINICAL HOURS
//REFERENCES
if (sizeof($employmentReferences) > 0)
{
$name .= ""; //color of the box div
$name .= "
";
$size = sizeof($education);
$counter = 0;
while ($counter < sizeof($employmentReferences))
{
//TYPE
$name .= "
Reference Type: ";
$name .= $employmentReferences[$counter]["RefereeTypeCode"];
$name .= "
";
//NAME
$name .= "
Referee Name: ";
$name .= $employmentReferences[$counter]["FormattedName"];
$name .= "
";
//TITLE
$name .= "
Referee Position Title: ";
$name .= $employmentReferences[$counter]["PositionTitle"];
$name .= "
";
//PHONE
$name .= "
Referee Phone Number: ";
$name .= $employmentReferences[$counter]["PreferredPhone"];
$name .= "
";
$counter++;
} //while
$name .= "
";
} //references
return $name;
} //json
////////////////////////////////////// HR-XML //////////////////////////////////////////////////////////////////////////////////////////////
//START HR-XML
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
//xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($parser,$result,$values,$tags);
xml_parser_free($parser);
//$data = @simplexml_load_string($result);
//$data = json_decode(json_encode($result),1);
//var_dump($values);
// loop through the structure
foreach ($tags as $key=>$val)
{
$data = $values[$val[0]];
//var_dump($data);
if ($key == "FormattedName")
{
$formattedName = $data[value];
}
else if ($key == "Affix")
{
//print_r($data[attributes][type]);
if ($data[attributes][type] == "formOfAddress")
$prefix = $data[value];
else if ($data[attributes][type] == "generation")
$suffix = $data[value];
else if ($data[attributes][type] == "qualification")
$suffix = $data[value];
}
else if ($key == "GivenName")
{
$givenName = $data[value];
}
else if ($key == "PreferredGivenName")
{
$nickName = $data[value];
}
else if ($key == "MiddleName")
{
$middleName = $data[value];
}
else if ($key == "FamilyName")
{
$lastName = $data[value];
}
else if ($key == "Citizenship")
{
$citizenship = $data[value];
}
else if ($key == "VisaStatus")
{
$visaStatus = $data[value];
}
else if ($key == "PersonLegalId")
{
$ssNumber = $data[value];
}
else if ($key == "Age")
{
$age = $data[value];
}
else if ($key == "DateOfBirth")
{
$dateOfBirth = $data[value];
}
else if ($key == "MaritalStatus")
{
$maritalStatus = $data[value];
}
else if ($key == "InternetWebAddress")
{
$webSite = $data[value];
}
else if ($key == "LinkedInAddress")
{
$linkedin = $data[value];
}
else if ($key == "FacebookAddress")
{
$facebook = $data[value];
}
else if ($key == "InstagramAddress")
{
$instagram = $data[value];
}
else if ($key == "GithubAddress")
{
$github = $data[value];
}
else if ($key == "SkypId")
{
$skype = $data[value];
}
else
{
continue;
}
//var_dump($powerZone);
//if ($key == "PostalAddress")
//{
//echo "HELLO";
// $address = $data[value];
//}
} //foreach
//INTELLIGENT MODULE DATA / SUMMARY
//POWER ZONE
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$powerZone = trim(substr($result, $posStart, $posEnd-$posStart));
if (sizeof($powerZone) > 0)
{
$posStart = strpos($powerZone, "");
$posEnd = strpos($powerZone, " ");
if ($posStart !== false && $posEnd !== false)
{
$securityClearance = trim(substr($powerZone, $posStart+19, $posEnd-$posStart-19));
}
$posStart = strpos($powerZone, "");
$posEnd = strpos($powerZone, " ");
if ($posStart !== false && $posEnd !== false)
{
$securityPolygraph = trim(substr($powerZone, $posStart+19, $posEnd-$posStart-19));
if ($securityPolygraph == "s")
{
$securityPolygraph = "not specified";
}
}
$posStart = strpos($powerZone, "");
$posEnd = strpos($powerZone, " ");
if ($posStart !== false && $posEnd !== false)
{
$militaryBranch = trim(substr($powerZone, $posStart+16, $posEnd-$posStart-16));
}
$posStart = strpos($powerZone, "");
$posEnd = strpos($powerZone, " ");
if ($posStart !== false && $posEnd !== false)
{
$careerLevel = trim(substr($powerZone, $posStart+13, $posEnd-$posStart-13));
}
if (strlen($securityClearance) > 0 || strlen($securityPolygraph) > 0 || strlen($militaryBranch) > 0 || strlen($careerLevel) > 0)
{
$name .= ""; //box
$name .= "
INTELLIGENT MODULE DATA / SUMMARY
";
if (strlen($securityClearance) > 0)
{
$name .= "
Security Clearance: ";
$name .= $securityClearance;
$name .= "
";
}
if (strlen($securityPolygraph) > 0)
{
$name .= "
Security Polygraph: ";
$name .= $securityPolygraph;
$name .= "
";
}
if (strlen($militaryBranch) > 0)
{
$name .= "
Military Branch: ";
switch ($militaryBranch)
{
case "a":
$militaryBranch = "Army";
break;
case "n":
$militaryBranch = "Navy";
break;
case "af":
$militaryBranch = "Air";
break;
case "mc":
$militaryBranch = "Marine";
break;
case "cg":
$militaryBranch = "Reserve";
break;
case "r":
$militaryBranch = "National";
break;
}
$name .= $militaryBranch;
$name .= "
";
}
if (strlen($careerLevel) > 0)
{
$careerLevel = ucfirst($careerLevel);
$name .= "
Career Level: ";
$name .= ucwords($careerLevel);
$name .= "
";
}
$name .= "
"; //outer box
}
}
} //PowerZone
//INDUSTRY
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$industry = trim(substr($result, $posStart+10, $posEnd-$posStart-10));
if (strlen($industry) > 0)
{
$name .= ""; //box
$name .= "
Industry: ";
$name .= ucwords(strtolower($industry));
$name .= "
";
$name .= "
"; //outer box
}
}
//HIGHEST DEGREE
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$highestDegree = trim(substr($result, $posStart+15, $posEnd-$posStart-15));
if (strlen($highestDegree) > 0)
{
$name .= ""; //box
$name .= "
Highest Degree: ";
$name .= ucwords(strtolower($highestDegree));
$name .= "
";
$name .= "
"; //outer box
}
}
//EXPERIENCE SUMMARY
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$experienceSummary = trim(substr($result, $posStart, $posEnd-$posStart));
if (sizeof($experienceSummary) > 0)
{
$name .= ""; //box
$found=true;
$counter = 0;
while ($found && sizeof($experienceSummary) > 0)
{
$posStart = strpos($experienceSummary, "
");
$posEnd = strpos($experienceSummary, " ");
if ($posStart !== false && $posEnd !== false)
{
$experienceKind = trim(substr($experienceSummary, $posStart+16, $posEnd-$posStart-16));
$experienceSummary = trim(substr($experienceSummary, $posEnd+17));
switch ($experienceKind)
{
case "TopSkills":
$posStart = strpos($experienceSummary, "
");
$posEnd = strpos($experienceSummary, " ");
if ($posStart !== false && $posEnd !== false)
{
$detail = trim(substr($experienceSummary, $posStart+8, $posEnd-$posStart-8));
$experienceSummary = trim(substr($experienceSummary, $posEnd+9));
$name .= "
Skills:
";
$name .= "
";
$name .= $detail;
$name .= "
";
}
break;
case "LastSkills":
$posStart = strpos($experienceSummary, "
");
$posEnd = strpos($experienceSummary, " ");
if ($posStart !== false && $posEnd !== false)
{
$detail = trim(substr($experienceSummary, $posStart+8, $posEnd-$posStart-8));
$experienceSummary = trim(substr($experienceSummary, $posEnd+9));
$name .= "
";
$name .= $detail;
$name .= "
";
}
break;
case "Summary":
$detail = trim(substr($experienceSummary, $posStart+8, $posEnd-$posStart-8));
$experienceSummary = trim(substr($experienceSummary, $posEnd+9));
break;
case "SummaryNamed":
$posStart = strpos($experienceSummary, "
");
$posEnd = strpos($experienceSummary, " ");
if ($posStart !== false && $posEnd !== false)
{
$detail = trim(substr($experienceSummary, $posStart+8, $posEnd-$posStart-8));
$experienceSummary = trim(substr($experienceSummary, $posEnd+9));
$name .= "
Summary: ";
$name .= $detail;
$name .= "
";
}
break;
case "Experience":
$detail = trim(substr($experienceSummary, $posStart+8, $posEnd-$posStart-8));
$experienceSummary = trim(substr($experienceSummary, $posEnd+9));
break;
case "HighestIndustry":
$posStart = strpos($experienceSummary, "
");
$posEnd = strpos($experienceSummary, " ");
if ($posStart !== false && $posEnd !== false)
{
$detail = trim(substr($experienceSummary, $posStart+8, $posEnd-$posStart-8));
$experienceSummary = trim(substr($experienceSummary, $posEnd+9));
$name .= "
Highest Industry: ";
$name .= $detail;
$name .= "
";
}
break;
case "HighestEducation":
$posStart = strpos($experienceSummary, "
");
$posEnd = strpos($experienceSummary, " ");
if ($posStart !== false && $posEnd !== false)
{
$detail = trim(substr($experienceSummary, $posStart+8, $posEnd-$posStart-8));
$experienceSummary = trim(substr($experienceSummary, $posEnd+9));
$name .= "
Highest Education: ";
$name .= $detail;
$name .= "
";
}
break;
case "TopLevel":
$posStart = strpos($experienceSummary, "
");
$posEnd = strpos($experienceSummary, " ");
if ($posStart !== false && $posEnd !== false)
{
$detail = trim(substr($experienceSummary, $posStart+8, $posEnd-$posStart-8));
$experienceSummary = trim(substr($experienceSummary, $posEnd+9));
$name .= "
Top Level Summary: ";
$name .= $detail;
$name .= "
";
}
break;
}
}
else
{
$found = false;
}
} //while
$name .= "
"; //outer box
}
}
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$contactInfo = trim(substr($result, $posStart, $posEnd-$posStart));
}
//CONTACT INFO
if (sizeof($contactInfo))
{
$name .= "";
$name .= "
";
//NAME
if (strlen($formattedName) > 0)
{
$name .= "
Formatted Name: ";
$name .= $formattedName;
$name .= "
";
}
if (strlen($prefix) > 0)
{
$name .= "
Form of Address: ";
$name .= $prefix;
$name .= "
";
}
if (strlen($givenName) > 0)
{
$name .= "
First Name: ";
$name .= $givenName;
$name .= "
";
}
if (strlen($middleName) > 0)
{
$name .= "
Middle Name: ";
$name .= $middleName;
$name .= "
";
}
if (strlen($nickName) > 0)
{
$name .= "
Nickname: ";
$name .= $nickName;
$name .= "
";
}
if (strlen($lastName) > 0)
{
$name .= "
Last Name: ";
$name .= $lastName;
$name .= "
";
}
if (strlen($suffix) > 0)
{
$name .= "
Suffix: ";
$name .= $suffix;
$name .= "
";
}
//Personal Descriptors
$posStart = strpos($result, "
");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$personDescriptors = trim(substr($result, $posStart, $posEnd-$posStart));
$posStart = strpos($personDescriptors, "
");
$posEnd = strpos($personDescriptors, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Social Security / Legal ID Number: ";
$name .= trim(substr($personDescriptors, $posStart+9, $posEnd-$posStart-9));
//$name .= $ssNumber;
$name .= "
";
}
if (strlen($citizenship) > 0)
{
$name .= "
Citizenship: ";
$name .= $citizenship;
$name .= "
";
}
if (strlen($visaStatus) > 0)
{
$name .= "
Work Eligibility/Visa: ";
//$name .= trim(substr($personDescriptors, $posStart+12, $posEnd-$posStart-12));
$name .= $visaStatus;
$name .= "
";
}
}
if (strlen($maritalStatus) > 0)
{
$name .= "
Marital Status: ";
$name .= $maritalStatus;
$name .= "
";
}
if (strlen($dateOfBirth) > 0)
{
$name .= "
Date of Birth: ";
$name .= $dateOfBirth;
$name .= "
";
}
if (strlen($age) > 0)
{
$name .= "
Age: ";
$name .= $age;
$name .= "
";
}
if (strlen($gender) > 0)
{
$name .= "
Gender: ";
$gender = trim(substr($biologicalDescriptors, $posStart+12, $posEnd-$posStart-12));
if ($gender == 1)
$name .= "male";
else if ($gender == 2)
$name .= "female";
$name .= "
";
}
$posStart = strpos($personDescriptors, "
");
$posEnd = strpos($personDescriptors, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Citizenship: ";
$name .= trim(substr($personDescriptors, $posStart+17, $posEnd-$posStart-17));
$name .= "
";
}
$name .= "
"; //color of the box div
//end name box
//ADDRESS
$posStart = strpos($contactInfo, "");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= ""; //color of the box div
$name .= "
";
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Street Address: ";
$name .= trim(substr($contactInfo, $posStart+13, $posEnd-$posStart-13));
$name .= "
";
}
$name .= "
"; //container for City/State
$posStart = strpos($contactInfo, "");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "City: ";
$name .= trim(substr($contactInfo, $posStart+14, $posEnd-$posStart-14));
$name .= " ";
}
$posStart = strpos($contactInfo, "");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= " State/Province: ";
$name .= trim(substr($contactInfo, $posStart+8, $posEnd-$posStart-8));
$name .= " ";
}
$name .= "
"; //container for City/State
$name .= "
"; //container for Zip / Country
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Postal Code: ";
$name .= trim(substr($contactInfo, $posStart+12, $posEnd-$posStart-12));
$name .= " ";
}
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Country: ";
$name .= trim(substr($contactInfo, $posStart+13, $posEnd-$posStart-13));
$name .= " ";
}
$name .= " "; //container for Zip / Country
$name .= "
"; //color of the box div
} //Address
//TELEPHONE
$posStart1 = strpos($contactInfo, "");
$posStart2 = strpos($contactInfo, "");
$posStart3 = strpos($contactInfo, "");
$posStart4 = strpos($contactInfo, "");
$posStart5 = strpos($contactInfo, "");
if ($posStart1 !== false || $posStart2 !== false || $posStart3 !== false)
{
$name .= ""; //color of the box div
$name .= "
";
$posStart1 = strpos($contactInfo, "
");
$posEnd1 = strpos($contactInfo, " ");
while ($posStart1 !== false && $posEnd1 !== false)
{
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
$location1 = trim(substr($contactInfo, $posStart+10, $posEnd-$posStart-10));
if ($location1 == "home")
{
$location1 = "Home";
}
else if ($location1 == "onPerson")
{
$location1 = "Mobile";
}
$name .= "
".$location1." Number:
";
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Formatted Number: ";
$name .= trim(substr($contactInfo, $posStart+17, $posEnd-$posStart-17));
$name .= "
";
}
$name .= "
"; //Country/Area/Number
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Country Code: ";
$name .= trim(substr($contactInfo, $posStart+26, $posEnd-$posStart-26));
$name .= " ";
}
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Area Code: ";
$name .= trim(substr($contactInfo, $posStart+14, $posEnd-$posStart-14));
$name .= " ";
}
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Number: ";
$name .= trim(substr($contactInfo, $posStart+18, $posEnd-$posStart-18));
$name .= " ";
}
$name .= "
"; //Country/Area/Number
$contactInfo = trim(substr($contactInfo, $posEnd1+13));
$posStart1 = strpos($contactInfo, "
");
$posEnd1 = strpos($contactInfo, " ");
} //while
//MOBILE
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$location1 = "Mobile";
$name .= "
".$location1." Number:
";
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Formatted Number: ";
$name .= trim(substr($contactInfo, $posStart+17, $posEnd-$posStart-17));
$name .= "
";
}
$name .= "
"; //Country/Area/Number
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Country Code: ";
$name .= trim(substr($contactInfo, $posStart+26, $posEnd-$posStart-26));
$name .= " ";
}
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Area Code: ";
$name .= trim(substr($contactInfo, $posStart+14, $posEnd-$posStart-14));
$name .= " ";
}
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Number: ";
$name .= trim(substr($contactInfo, $posStart+18, $posEnd-$posStart-18));
$name .= " ";
}
$name .= "
"; //Country/Area/Number
$contactInfo = trim(substr($contactInfo, $posEnd+9));
}
//FAX
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$location1 = "Fax";
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
".$location1." Number:
";
$name .= "
Formatted Number: ";
$name .= trim(substr($contactInfo, $posStart+17, $posEnd-$posStart-17));
$name .= "
";
}
$name .= "
"; //Country/Area/Number
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Country Code: ";
$name .= trim(substr($contactInfo, $posStart+26, $posEnd-$posStart-26));
$name .= " ";
}
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Area Code: ";
$name .= trim(substr($contactInfo, $posStart+14, $posEnd-$posStart-14));
$name .= " ";
}
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Number: ";
$name .= trim(substr($contactInfo, $posStart+18, $posEnd-$posStart-18));
$name .= " ";
}
$name .= "
"; //Country/Area/Number
$contactInfo = trim(substr($contactInfo, $posEnd+6));
}
$name .= "
"; //color of the box div
} //Telephones
//EMAIL / WEBSITE
if ($posStart4 !== false || $posStart5 !== false ||
strlen($linkedin) > 0 || strlen($facebook) > 0 || strlen($instagram) > 0 || strlen($github) > 0 || strlen($skype) > 0)
{
$name .= ""; //color of the box div
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Email 1: ";
$name .= trim(substr($contactInfo, $posStart+22, $posEnd-$posStart-22));
$name .= "
";
$contactInfo = trim(substr($contactInfo, $posEnd+24));
$posStart = strpos($contactInfo, "
");
$posEnd = strpos($contactInfo, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Email 2: ";
$name .= trim(substr($contactInfo, $posStart+23, $posEnd-$posStart-23));
$name .= "
";
}
}
//WEB SITE
if (strlen($webSite) > 0)
{
$name .= "
Web Site: ";
$name .= $webSite;
$name .= "
";
}
//LINKEDIN
if (strlen($linkedin) > 0)
{
$name .= "
LinkedIn: ";
$name .= $linkedin;
$name .= "
";
}
//FACEBOOK
if (strlen($facebook) > 0)
{
$name .= "
Facebook: ";
$name .= $facebook;
$name .= "
";
}
//INSTAGRAM
if (strlen($instagram) > 0)
{
$name .= "
Instagram: ";
$name .= $instagram;
$name .= "
";
}
//GITHUB
if (strlen($github) > 0)
{
$name .= "
Github: ";
$name .= $github;
$name .= "
";
}
//SKYPE
if (strlen($skype) > 0)
{
$name .= "
Skype ID: ";
$name .= $skype;
$name .= "
";
}
$name .= "
"; //color of the box div
} //end //Email/Web
} //contactInfo
//EXECUTIVE SUMMARY
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= ""; //color of the box div
$name .= "
Executive & Qualifications Summaries ^ ";
$name .= "
Qualifications Summary: ".
"";
$name .= trim(substr($result, $posStart+18, $posEnd-$posStart-18));
$name .= "
";
$name .= "
"; //color of the box div
}
//OBJECTIVE
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= ""; //color of the box div
$name .= "
Objectives, Goals and Cover Letters ^ ";
$name .= "
Objective: ".
"";
$name .= trim(substr($result, $posStart+11, $posEnd-$posStart-11));
$name .= "
";
$name .= "
"; //color of the box div
}
//WORK HISTORY
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$empHistory = trim(substr($result, $posStart, $posEnd-$posStart));
$name .= ""; //color of the box div
$found=true;
$counter = 0;
while ($found && sizeof($empHistory) > 0)
{
$posStart = strpos($empHistory, "
");
$posEnd = strpos($empHistory, " ");
if ($posStart !== false && $posEnd !== false)
{
$employerOrg = trim(substr($empHistory, $posStart, $posEnd-$posStart));
$empHistory = trim(substr($empHistory, $posEnd+13));
$posStart = strpos($employerOrg, "
");
$posEnd = strpos($employerOrg, " ");
if ($posStart !== false && $posEnd !== false)
{
//FIRST POSITION
if ($counter == 0)
{
$name .= "
";
}
$empName = trim(substr($employerOrg, $posStart+17, $posEnd-$posStart-17));
$name .= "
EMPLOYER NAME: ";
$name .= trim(substr($employerOrg, $posStart+17, $posEnd-$posStart-17));
$name .= "
";
}
//POSITION HISTORY
$posStart = strpos($employerOrg, "
");
$posEnd = strpos($employerOrg, " ");
$foundPosition = false;
if ($posStart !== false && $posEnd !== false)
{
$foundPosition = true;
$positionHistory = trim(substr($employerOrg, $posStart, $posEnd-$posStart));
$employerOrg = trim(substr($employerOrg, $posEnd+16));
}
while ($foundPosition && sizeof($employerOrg) > 0) //02/27/18
{
//JOB TITLE
$posStart = strpos($positionHistory, "
");
$posEnd = strpos($positionHistory, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Job Title: ";
$name .= trim(substr($positionHistory, $posStart+7, $posEnd-$posStart-7));
$name .= "
";
}
//LOCATION
$posStart = strpos($positionHistory, "
");
$posEnd = strpos($positionHistory, " ");
if ($posStart !== false && $posEnd !== false)
{
$location1 = trim(substr($positionHistory, $posStart, $posEnd-$posStart));
$posStart = strpos($location1, "
");
$posEnd = strpos($location1, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Location: ";
$name .= trim(substr($location1, $posStart+14, $posEnd-$posStart-14));
$posStart = strpos($location1, "");
$posEnd = strpos($location1, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= " ";
$name .= trim(substr($location1, $posStart+8, $posEnd-$posStart-8));
}
$name .= "
";
}
}
//DATES
$posStart = strpos($positionHistory, "
\n");
$posEnd = strpos($positionHistory, " \n ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Start Date: ";
$name .= trim(substr($positionHistory, $posStart+21, $posEnd-$posStart-21));
$name .= "
";
}
$posStart = strpos($positionHistory, "
\n");
$posEnd = strpos($positionHistory, " \n ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
End Date: ";
$name .= trim(substr($positionHistory, $posStart+19, $posEnd-$posStart-19));
$name .= "
";
}
else if ($counter == 0) //CURRENT
{
$name .= "
End Date: ";
$name .= "currently employed";
$name .= "
";
}
//INDUSTRY
$posStart = strpos($positionHistory, "
");
$posEnd = strpos($positionHistory, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Industry Type: ";
$name .= trim(substr($positionHistory, $posStart+21, $posEnd-$posStart-21));
$name .= "
";
}
//DESCRIPTION
$posStart = strpos($positionHistory, "
");
$posEnd = strpos($positionHistory, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Job Description: ";
$name .= trim(substr($positionHistory, $posStart+13, $posEnd-$posStart-13));
$name .= "
";
}
//EMPLOYER NAME CONFIDENCE RATING
$posStart = strpos($employerOrg, "
");
$posEnd = strpos($employerOrg, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
INTELLIGENT CONFIDENCE SCORES:
";
$name .= "
Employer Name Confidence Rating: ";
$name .= trim(substr($employerOrg, $posStart+30, $posEnd-$posStart-30));
$name .= "
";
}
//JOB TITLE CONFIDENCE RATING
$posStart = strpos($employerOrg, "
");
$posEnd = strpos($employerOrg, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Job Title Confidence Rating: ";
$name .= trim(substr($employerOrg, $posStart+26, $posEnd-$posStart-26));
$name .= "
";
}
//START DATE CONFIDENCE RATING
$posStart = strpos($employerOrg, "
");
$posEnd = strpos($employerOrg, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Start Date Confidence Rating: ";
$name .= trim(substr($employerOrg, $posStart+27, $posEnd-$posStart-27));
$name .= "
";
}
//END DATE CONFIDENCE RATING
$posStart = strpos($employerOrg, "
");
$posEnd = strpos($employerOrg, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
End Date Confidence Rating: ";
$name .= trim(substr($employerOrg, $posStart+25, $posEnd-$posStart-25));
$name .= "
";
}
//DATES CONFIDENCE RATING
$posStart = strpos($employerOrg, "
");
$posEnd = strpos($employerOrg, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Dates Confidence Rating: ";
$name .= trim(substr($employerOrg, $posStart+23, $posEnd-$posStart-23));
$name .= "
";
}
//DESCRIPTION CONFIDENCE RATING
$posStart = strpos($employerOrg, "
");
$posEnd = strpos($employerOrg, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Description Confidence Rating: ";
$name .= trim(substr($employerOrg, $posStart+29, $posEnd-$posStart-29));
$name .= "
";
}
//POSITION CONFIDENCE RATING
$posStart = strpos($employerOrg, "
");
$posEnd = strpos($employerOrg, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Overall Position Confidence Rating: ";
$name .= trim(substr($employerOrg, $posStart+26, $posEnd-$posStart-26));
$name .= "
";
}
//NEXT POSITION
$posStart = strpos($employerOrg, "
");
$posEnd = strpos($employerOrg, " ");
$foundPosition = false;
if ($posStart !== false && $posEnd !== false)
{
$foundPosition = true;
$positionHistory = trim(substr($employerOrg, $posStart, $posEnd-$posStart));
$employerOrg = trim(substr($employerOrg, $posEnd+16));
$name .= "
EMPLOYER NAME: ";
$name .= $empName;
$name .= "
";
}
$counter++;
} //while PositionHistory
} //if
else
{
$found = false;
}
} //end while Employment
$name .= "
"; //color of the box div
}
//MILITARY HISTORY
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$militaryHistory = trim(substr($result, $posStart, $posEnd-$posStart));
$found=true;
$counter = 0;
while ($found && sizeof($militaryHistory) > 0 && $counter < sizeof($militaryHistory))
{
$name .= ""; //color of the box div
if ($counter == 0)
{
$name .= "
";
}
$posStart = strpos($militaryHistory, "
");
$posEnd = strpos($militaryHistory, " ");
if ($posStart !== false && $posEnd !==false)
{
$serviceStatus = trim(substr($militaryHistory, $posStart+15, $posEnd-$posStart));
$name .= "
Service Status: ";
$name .= trim($serviceStatus);
$name .= "
";
}
$posStart = strpos($militaryHistory, "
");
$posEnd = strpos($militaryHistory, " ");
if ($posStart !== false && $posEnd !==false)
{
$countryServed = trim(substr($militaryHistory, $posStart+15, $posEnd-$posStart));
$name .= "
Country Served: ";
$name .= trim($countryServed);
$name .= "
";
}
$posStart = strpos($militaryHistory, "
");
if ($posStart !== false && $posEnd !== false)
{
$serviceDetail = trim(substr($militaryHistory, $posStart+23, $posEnd-$posStart));
$militaryHistory = trim(substr($militaryHistory, $posEnd+16));
$posEnd = strpos($serviceDetail, "\"");
if ($posEnd !== false)
{
$name .= "Service Branch: ";
$name .= trim(substr($serviceDetail, 0, $posEnd));
$name .= "
";
}
$posStart = strpos($serviceDetail, "");
$posEnd = strpos($serviceDetail, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Unit or Division: ";
$name .= trim(substr($serviceDetail, $posStart+16, $posEnd-$posStart-16));
$name .= "
";
}
$posStart = strpos($serviceDetail, "");
$posEnd = strpos($serviceDetail, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Rank: ";
$name .= trim(substr($serviceDetail, $posStart+18, $posEnd-$posStart-18));
$name .= "
";
}
$posStart = strpos($serviceDetail, "\n");
$posEnd = strpos($serviceDetail, " \n ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Start Date: ";
$name .= trim(substr($serviceDetail, $posStart+21, $posEnd-$posStart-21));
$name .= "
";
}
$posStart = strpos($serviceDetail, "\n");
$posEnd = strpos($serviceDetail, " \n ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "End Date: ";
$name .= trim(substr($serviceDetail, $posStart+19, $posEnd-$posStart-19));
$name .= "
";
}
$posStart = strpos($serviceDetail, "");
$posEnd = strpos($serviceDetail, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Area of Expertise: ";
$name .= trim(substr($serviceDetail, $posStart+17, $posEnd-$posStart-17));
$name .= "
";
}
} //if
else
{
$found = false;
}
$counter++;
$name .= " "; //color of the box div
} //end while Military History
} //MILITARY
//EDUCATION
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$eduHistory = trim(substr($result, $posStart, $posEnd-$posStart));
$name .= ""; //color of the box div
$name .= "
";
$found=true;
while ($found && sizeof($eduHistory) > 0)
{
$posStart = strpos($eduHistory, "
");
if ($posStart !== false && $posEnd !== false)
{
$school = trim(substr($eduHistory, $posStart, $posEnd-$posStart));
$eduHistory = trim(substr($eduHistory, $posEnd+20));
$posStart = strpos($school, "");
$posEnd = strpos($school, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "SCHOOL NAME: ";
$name .= trim(substr($school, $posStart+12, $posEnd-$posStart-12));
$name .= "
";
}
$posStart = strpos($school, "schoolType=\"");
$falsePosStart = strpos($school, "schoolType=\"\"");
$posEnd = strpos($school, ""); //start of school name
if ($posStart !== false && $posEnd !== false && $falsePosStart === false)
{
$name .= "School Type: ";
$name .= trim(substr($school, $posStart+12, $posEnd-$posStart-15));
$name .= "
";
}
$posStart = strpos($school, "");
$posEnd = strpos($school, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Location: ";
$name .= trim(substr($school, $posStart+12, $posEnd-$posStart-12));
$name .= "
";
}
$posStart = strpos($school, "");
$posEnd = strpos($school, " ");
if ($posStart !== false && $posEnd !== false)
{
$address = trim(substr($school, $posStart, $posEnd-$posStart));
$name .= "Location: ";
//CITY
$posStart = strpos($address, "");
$posEnd = strpos($address, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= trim(substr($address, $posStart+14, $posEnd-$posStart-14))." ";
}
//STATE
$posStart = strpos($address, "");
$posEnd = strpos($address, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= trim(substr($address, $posStart+8, $posEnd-$posStart-8))." ";
}
//CITY
$posStart = strpos($address, "");
$posEnd = strpos($address, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= trim(substr($address, $posStart+13, $posEnd-$posStart-13));
}
$name .= "
";
}
$posStart = strpos($school, "");
$posEnd = strpos($school, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Degree: ";
$name .= trim(substr($school, $posStart+12, $posEnd-$posStart-12));
$name .= "
";
}
$posStart = strpos($school, "\n");
$posEnd = strpos($school, " \n ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Major: ";
$name .= trim(substr($school, $posStart+20, $posEnd-$posStart-20));
$name .= "
";
}
$posStart = strpos($school, "\n");
$posEnd = strpos($school, " \n ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Minor: ";
$name .= trim(substr($school, $posStart+20, $posEnd-$posStart-20));
$name .= "
";
}
$posStart = strpos($school, "");
$posEnd = strpos($school, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Grade Point Average: ";
$posStart = strpos($school, "\n");
$posEnd = strpos($school, " \n ");
if ($posStart !== false && $posEnd !== false)
{
$name .= trim(substr($school, $posStart+28, $posEnd-$posStart-28));
}
$name .= "
";
}
$posStart = strpos($school, "\n");
$posEnd = strpos($school, " \n ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Graduation Date: ";
//$name .= "Graduation Date: ";
$name .= trim(substr($school, $posStart+12, $posEnd-$posStart-12));
$name .= "
";
}
//DATES OF ATTENDANCE
$posStart = strpos($school, "\n");
$posEnd = strpos($datesOfAttendence, " \n");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Attended From: ";
$name .= trim(substr($datesOfAttendence, $posStart+21, $posEnd-$posStart-21));
$name .= "
";
}
$posStart = strpos($datesOfAttendence, "\n");
$posEnd = strpos($datesOfAttendence, " \n ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Attended To: ";
$name .= trim(substr($datesOfAttendence, $posStart+19, $posEnd-$posStart-19));
$name .= "
";
}
}
/*if (sizeof($education[$counter]["DatesOfAttendance"]) > 0)
{
$name .= "Dates of Attendence: ";
$name .= $education[$counter]["DatesOfAttendence"][0]["StartDate"][0]["AnyDate"];
$name .= "
";
}*/
$posStart = strpos($school, "");
$posEnd = strpos($school, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Additional Information: ";
$name .= trim(substr($school, $posStart+10, $posEnd-$posStart-10));
$name .= "
";
}
}
else
{
$found = false;
}
} //end while Education
$name .= " "; //color of the box div
} //EDUCATION
//SKILLS
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$qualifications = trim(substr($result, $posStart, $posEnd-$posStart));
$name .= ""; //color of the box div
$name .= "
";
$found=true;
while ($found && sizeof($qualifications) > 0)
{
$posStart = strpos($qualifications, "
");
if ($posStart !== false && $posEnd !== false)
{
$skill = trim(substr($qualifications, $posStart+18, $posEnd-$posStart-18));
$qualifications = trim(substr($qualifications, $posEnd+13));
$posEnd = strpos($skill, "\"");
if ($posEnd !==false)
{
//SKILL NAME
$name .= "";
$name .= trim(substr($skill, 0, $posEnd));
//YEAR LAST USED
$posStart = strpos($skill, "lastUsed=\"");
if ($posStart !== false /*&& $posEnd !== false*/)
{
$name .= " Year Last Used: ";
$name .= trim(substr($skill, $posStart+10, 4)); //display the year part only
$name .= " ";
}
//YEARS OF EXPERIENCE
$posStart = strpos($skill, "");
$posEnd = strpos($skill, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= " Years of Experience: ";
$name .= trim(substr($skill, $posStart+57, $posEnd-$posStart-15));
$name .= " ";
}
$name .= "
";
} //SKILL NAME
}
else
{
$found = false;
}
} //end while SKILL
$name .= " "; //color of the box div
} //SKILLS
//LANGUAGES
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$languages = trim(substr($result, $posStart, $posEnd-$posStart));
$name .= ""; //color of the box div
$name .= "
";
$found=true;
while ($found && sizeof($languages) > 0)
{
$posStart = strpos($languages, "
");
$posEnd = strpos($languages, " ");
if ($posStart !== false && $posEnd !== false)
{
$language = trim(substr($languages, $posStart+10, $posEnd-$posStart-10));
$languages = trim(substr($languages, $posEnd+10));
$posStart = strpos($language, "
");
$posEnd = strpos($language, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
";
$name .= trim(substr($language, $posStart+14, $posEnd-$posStart-14));
$name .= " ";
$posStart = strpos($language, "
");
$posEnd = strpos($language, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
";
$name .= "Primary Language";
$name .= " ";
}
$posStart = strpos($language, "
");
$posEnd = strpos($language, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
";
$name .= "Listening: ";
$name .= trim(substr($language, $posStart+11, $posEnd-$posStart-11));
$name .= " ";
}
$posStart = strpos($language, "
");
$posEnd = strpos($language, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
";
$name .= "Reading: ";
$name .= trim(substr($language, $posStart+9, $posEnd-$posStart-9));
$name .= " ";
}
$posStart = strpos($language, "
");
$posEnd = strpos($language, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
";
$name .= "Conversation: ";
$name .= trim(substr($language, $posStart+14, $posEnd-$posStart-14));
$name .= " ";
}
$posStart = strpos($language, "
");
$posEnd = strpos($language, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
";
$name .= "Speaking: ";
$name .= trim(substr($language, $posStart+10, $posEnd-$posStart-10));
$name .= " ";
}
$posStart = strpos($language, "
");
$posEnd = strpos($language, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
";
$name .= "Writing: ";
$name .= trim(substr($language, $posStart+9, $posEnd-$posStart-9));
$name .= " ";
}
$name .= "
";
}
}
else
{
$found = false;
}
} //end while Security
$name .= "
"; //color of the box div
}
//LICENSES
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$licenses = trim(substr($result, $posStart, $posEnd-$posStart));
$name .= ""; //color of the box div
$name .= "
";
$found=true;
while ($found && sizeof($licenses) > 0)
{
$posStart = strpos($licenses, "
");
$posEnd = strpos($licenses, " ");
if ($posStart !== false && $posEnd !== false)
{
$license = trim(substr($licenses, $posStart+24, $posEnd-$posStart-24));
$licenses = trim(substr($licenses, $posEnd+24));
$posStart = strpos($license, "
");
$posEnd = strpos($license, " ");
if ($posStart !== false && $posEnd !== false)
{
//LICENSE NAME
$name .= "
License Name: ";
$name .= trim(substr($license, $posStart+6, $posEnd-$posStart-6));
$name .= "
";
}
$posStart = strpos($license, "
\n");
$posEnd = strpos($license, " \n ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Valid from: ";
$name .= trim(substr($license, $posStart+21, $posEnd-$posStart-21));
$name .= "
";
}
$posStart = strpos($license, "
\n");
$posEnd = strpos($license, " \n ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Valid To: ";
$name .= trim(substr($license, $posStart+19, $posEnd-$posStart-19));
$name .= "
";
}
}
else
{
$found = false;
}
} //end while License
$name .= "
"; //color of the box div
}
//ASSOCIATIONS
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$associations = trim(substr($result, $posStart, $posEnd-$posStart));
$name .= "";
$found=true;
while ($found && sizeof($associations) > 0)
{
$posStart = strpos($associations, "");
$posEnd = strpos($associations, " ");
if ($posStart !== false && $posEnd !== false)
{
$association = trim(substr($associations, $posStart+13, $posEnd-$posStart-13));
$associations = trim(substr($associations, $posEnd+13));
$posStart = strpos($association, "");
$posEnd = strpos($association, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Association Name: ";
$name .= trim(substr($association, $posStart+6, $posEnd-$posStart-6));
$name .= "
";
}
$posStart = strpos($association, "");
$posEnd = strpos($association, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Role: ";
$name .= trim(substr($association, $posStart+12, $posEnd-$posStart-12));
$name .= "
";
}
}
else
{
$found = false;
}
} //end while Association
$name .= " "; //color of the box div
} //Associations
//SECURITY
$posStart = strpos($result, "");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$securities = trim(substr($result, $posStart, $posEnd-$posStart));
$name .= ""; //color of the box div
$name .= "
";
$found=true;
while ($found && sizeof($securities) > 0)
{
$posStart = strpos($securities, "
");
$posEnd = strpos($securities, " ");
if ($posStart !== false && $posEnd !== false)
{
$security = trim(substr($securities, $posStart+10, $posEnd-$posStart-10));
$securities = trim(substr($securities, $posEnd+10));
$posStart = strpos($security, "
");
$posEnd = strpos($security, " ");
if ($posStart !== false && $posEnd !== false)
{
//$name .= "
Level: ";
$name .= "";
$name .= trim(substr($security, $posStart+6, $posEnd-$posStart-6));
$name .= "
";
}
}
else
{
$found = false;
}
} //end while Security
$name .= " "; //color of the box div
} //Security
//PUBLICATIONS
$posStart = strpos($result, "
");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$publications = trim(substr($result, $posStart, $posEnd-$posStart));
$name .= "
"; //color of the box div
$name .= "
";
$found=true;
while ($found && sizeof($publications) > 0)
{
$posStart = strpos($publications, "
");
$posEnd = strpos($publications, " ");
if ($posStart !== false && $posEnd !== false)
{
$article = trim(substr($publications, $posStart+9, $posEnd-$posStart-9));
$publications = trim(substr($publications, $posEnd+9));
$posStart = strpos($article, "
");
$posEnd = strpos($article, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Article Title: ";
$name .= trim(substr($article, $posStart+7, $posEnd-$posStart-7));
$name .= "
";
}
$posStart = strpos($article, "
");
$posEnd = strpos($article, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Author Name(s): ";
$name .= trim(substr($article, $posStart+20, $posEnd-$posStart-20));
$name .= "
";
}
$posStart = strpos($article, "
\n");
$posEnd = strpos($article, " \n ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Publication Date: ";
$name .= trim(substr($article, $posStart+30, $posEnd-$posStart-30));
$name .= "
";
}
$posStart = strpos($article, "
");
$posEnd = strpos($article, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Journal or Serial Name: ";
$name .= trim(substr($article, $posStart+21, $posEnd-$posStart-21));
$name .= "
";
}
$posStart = strpos($article, "
");
$posEnd = strpos($article, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Volume: ";
$name .= trim(substr($article, $posStart+8, $posEnd-$posStart-8));
$name .= "
";
}
$posStart = strpos($article, "
");
$posEnd = strpos($article, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Page Number: ";
$name .= trim(substr($article, $posStart+11, $posEnd-$posStart-11));
$name .= "
";
}
} //Article
else
{
$posStart = strpos($publications, "
");
$posEnd = strpos($publications, " ");
if ($posStart !== false && $posEnd !== false)
{
$book = trim(substr($publications, $posStart+6, $posEnd-$posStart-6));
$publications = trim(substr($publications, $posEnd+6));
$posStart = strpos($book, "
");
$posEnd = strpos($book, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Book Title: ";
$name .= trim(substr($book, $posStart+7, $posEnd-$posStart-7));
$name .= "
";
}
$posStart = strpos($book, "
");
$posEnd = strpos($book, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Author Name(s): ";
$name .= trim(substr($book, $posStart+20, $posEnd-$posStart-20));
$name .= "
";
}
$posStart = strpos($book, "
\n");
$posEnd = strpos($book, " \n ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Publication Date: ";
$name .= trim(substr($book, $posStart+30, $posEnd-$posStart-30));
$name .= "
";
}
} //Book
else //Conference Paper
{
$posStart = strpos($publications, "
");
$posEnd = strpos($publications, " ");
if ($posStart !== false && $posEnd !== false)
{
$conferencePaper = trim(substr($publications, $posStart+17, $posEnd-$posStart-17));
$publications = trim(substr($publications, $posEnd+9));
$posStart = strpos($conferencePaper, "
");
$posEnd = strpos($conferencePaper, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Conference Paper Title: ";
$name .= trim(substr($conferencePaper, $posStart+7, $posEnd-$posStart-7));
$name .= "
";
}
$posStart = strpos($conferencePaper, "
");
$posEnd = strpos($conferencePaper, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Author Name(s): ";
$name .= trim(substr($conferencePaper, $posStart+20, $posEnd-$posStart-20));
$name .= "
";
}
$posStart = strpos($conferencePaper, "
\n");
$posEnd = strpos($conferencePaper, " \n");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Publication Date: ";
$name .= trim(substr($conferencePaper, $posStart+30, $posEnd-$posStart-30));
$name .= "
";
}
$posStart = strpos($conferencePaper, "");
$posEnd = strpos($conferencePaper, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Event Name: ";
$name .= trim(substr($conferencePaper, $posStart+11, $posEnd-$posStart-11));
$name .= "
";
}
}
else
{
$found = false;
}
} //Conference Paper
} //big else
} //end while Publications
$name .= " "; //color of the box div
} //PUBLICATIONS
//SPEAKING EVENTS
$posStart = strpos($result, "
");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$speakingEvents = trim(substr($result, $posStart, $posEnd-$posStart));
$name .= "
"; //color of the box div
$name .= "
";
$found=true;
while ($found && sizeof($speakingEvents) > 0)
{
$posStart = strpos($speakingEvents, "
");
$posEnd = strpos($speakingEvents, " ");
if ($posStart !== false && $posEnd !== false)
{
$speakingEvent = trim(substr($speakingEvents, $posStart+15, $posEnd-$posStart-15));
$speakingEvents = trim(substr($speakingEvents, $posEnd+15));
$posStart = strpos($speakingEvent, "
");
$posEnd = strpos($speakingEvent, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Event Name: ";
$name .= trim(substr($speakingEvent, $posStart+11, $posEnd-$posStart-11));
$name .= "
";
}
$name .= "
"; //TYPE / DATE
$posStart = strpos($speakingEvent, "");
$posEnd = strpos($speakingEvent, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Event Type: ";
$name .= trim(substr($speakingEvent, $posStart+11, $posEnd-$posStart-11));
$name .= " ";
}
$posStart = strpos($speakingEvent, "");
$posEnd = strpos($speakingEvent, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= " Event Date: ";
$name .= trim(substr($speakingEvent, $posStart+23, $posEnd-$posStart-23));
$name .= " ";
}
$name .= "
"; //TYPE / DATE
} //Speaking Event
else
{
$found = false;
}
} //end while Speaking Events
$name .= "
"; //color of the box div
} //SPEAKING EVENTS
//PATENTS
$posStart = strpos($result, "
");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$patents = trim(substr($result, $posStart, $posEnd-$posStart));
$name .= "
"; //color of the box div
$name .= "
";
$found=true;
while ($found && sizeof($patents) > 0)
{
$posStart = strpos($patents, "
");
$posEnd = strpos($patents, " ");
if ($posStart !== false && $posEnd !== false)
{
$patent = trim(substr($patents, $posStart+8, $posEnd-$posStart-8));
$patents = trim(substr($patents, $posEnd+8));
$posStart = strpos($patent, "
");
$posEnd = strpos($patent, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Patent Title: ";
$name .= trim(substr($patent, $posStart+13, $posEnd-$posStart-13));
$name .= "
";
}
$posStart = strpos($patent, "
");
$posEnd = strpos($patent, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Inventors: ";
$name .= trim(substr($patent, $posStart+11, $posEnd-$posStart-11));
$name .= "
";
}
$name .= "
"; //STATUS / DATE
$posStart = strpos($patent, "");
$posEnd = strpos($patent, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Patent Status: ";
$name .= trim(substr($patent, $posStart+8, $posEnd-$posStart-8));
$name .= " ";
}
$posStart = strpos($patent, "");
$posEnd = strpos($patent, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= " Patent Date: ";
$name .= trim(substr($patent, $posStart+6, $posEnd-$posStart-6));
$name .= " ";
}
$name .= "
"; //STATUS / DATE
} //Patents
else
{
$found = false;
}
} //end while Patents
$name .= "
"; //color of the box div
} //PATENTS
//ACHIEVEMENTS
$posStart = strpos($result, "
");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$achievements = trim(substr($result, $posStart, $posEnd-$posStart));
$name .= "
"; //color of the box div
$name .= "
";
$found=true;
while ($found && sizeof($achievements) > 0)
{
$posStart = strpos($achievements, "
");
$posEnd = strpos($achievements, " ");
if ($posStart !== false && $posEnd !== false)
{
$achievement = trim(substr($achievements, $posStart+13, $posEnd-$posStart-13));
$achievements = trim(substr($achievements, $posEnd+13));
//EACH ACHIVEMENT with DATE
$posStart = strpos($achievement, "
");
$posEnd = strpos($achievement, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
";
$name .= trim(substr($achievement, $posStart+13, $posEnd-$posStart-13));
$name .= "
";
}
$posStart = strpos($achievement, "
");
$posEnd = strpos($achievement, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "
Date: ";
$name .= trim(substr($achievement, $posStart+12, $posEnd-$posStart-12));
$name .= "
";
}
} //Achievements
else
{
$found = false;
}
} //end while Achievements
$name .= "
"; //color of the box div
}
//HOBBIES
$posStart = strpos($result, "
");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$additionalItems = trim(substr($result, $posStart, $posEnd-$posStart));
$name .= "
"; //color of the box div
$name .= "
";
$found=true;
while ($found && sizeof($additionalItems) > 0)
{
$posStart = strpos($additionalItems, "
");
if ($posStart !== false && $posEnd !== false)
{
$item = trim(substr($additionalItems, $posStart+27, $posEnd-$posStart-23));
$additionalItems = trim(substr($additionalItems, $posEnd+23));
//EACH HOBBY
$name .= "";
$posStart = strpos($item, "");
$posEnd = strpos($item, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "";
$name .= trim(substr($item, $posStart+13, $posEnd-$posStart-13));
$name .= " ";
}
$name .= "
";
} //Item
else
{
$found = false;
}
} //end while Hobbies
$name .= " "; //color of the box div
} //HOBBIES
//REFERENCES
$posStart = strpos($result, "
");
$posEnd = strpos($result, " ");
if ($posStart !== false && $posEnd !== false)
{
$references = trim(substr($result, $posStart, $posEnd-$posStart));
$name .= "
"; //color of the box div
$name .= "
";
$found=true;
while ($found && sizeof($references) > 0)
{
$posStart = strpos($references, "
");
if ($posStart !== false && $posEnd !== false)
{
$reference = trim(substr($references, $posStart+17, $posEnd-$posStart-17));
$references = trim(substr($references, $posEnd+12));
$posEnd = strpos($reference, "\"");
if ($posEnd !==false)
{
$name .= "Reference Type: ";
$name .= trim(substr($reference, 0, $posEnd));
$name .= "
";
}
$posStart = strpos($reference, "");
$posEnd = strpos($reference, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Name: ";
$name .= trim(substr($reference, $posStart+15, $posEnd-$posStart-15));
$name .= "
";
}
$posStart = strpos($reference, "");
$posEnd = strpos($reference, " ");
if ($posStart !== false && $posEnd !== false)
{
$telephone = trim(substr($reference, $posStart+26, $posEnd-$posStart-26));
$posStart = strpos($reference, "");
$posEnd = strpos($reference, " ");
$telephone .= "-";
$telephone .= trim(substr($reference, $posStart+14, $posEnd-$posStart-14));
$posStart = strpos($reference, "");
$posEnd = strpos($reference, " ");
$telephone .= "-";
$telephone .= trim(substr($reference, $posStart+18, $posEnd-$posStart-18));
$name .= "Telephone: ";
$name .= $telephone;
$name .= "
";
}
$posStart = strpos($reference, "");
$posEnd = strpos($reference, " ");
if ($posStart !== false && $posEnd !== false)
{
$name .= "Email: ";
$name .= trim(substr($reference, $posStart+22, $posEnd-$posStart-22));
$name .= "
";
}
}
else
{
$found = false;
}
} //end while References
$name .= " "; //color of the box div
} //REFERENCES
return $name;
}
function mapLanguages($code='')
{
switch ($code) {
case "EN":
return "English";
case "UK":
return "Ukrainian";
break;
case "RU":
return "Russian";
break;
case "DE":
return "German";
break;
} //switch
}
?>