$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 .= "\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 $set_output;



   if($_REQUEST['URL'] && trim($_REQUEST['URL'])) //IAG 08/02/19
     {
        $_SESSION['result1'] = $client->ParseJobDescriptionNew_fromURL($_REQUEST['product_code'],$_REQUEST['URL']);
     }
   else if($_REQUEST['cid'] != "")
       $_SESSION['result1'] = $client->ParseJobDescription($_REQUEST['did'],$_REQUEST['pid'], $_REQUEST['cid'],$_FILES['document']['name'],base64_encode($fileData));
   else
       $_SESSION['result1'] = $client->ParseJobDescriptionNew($_REQUEST['product_code'],$_FILES['document']['name'],base64_encode($fileData));
 
       //$_SESSION['result1'] = $client->ParseJobDescriptionNew($_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 "

".$result; } // kill object unset($client); } header("Content-type: text/html; charset=utf-8"); $output = "". "HireAbility Job Order Parsing Demo". "". "". "". "". "\r". "". "\r". ""; echo $output; ?>
". "". "". "". "". "". "
Job Parsing Demo
". "". "". ""; //Select display_type if(isset($_POST['ha_action']) && !isset($_POST['save_as_file'])) { $gotResults = true; $output .= ""; echo $output; if (isset($_POST['display_type'])) { $display = $_POST['display_type']; if ($display=="output_html") $checked_html = "checked='checked'"; else $checked_html = ""; if ($display=="output_html_text") $checked_html_text = "checked='checked'"; else $checked_html_text = ""; if ($display=="output_xml") $checked_xml = "checked='checked'"; else $checked_xml = ""; } else $checked_html_text = "checked='checked'"; $select = "". "". "". "". "". "". "". "". "". "". "
". "Display:". "
". "
". "
". "
". "". "
Read about Best Testing Practices
HireAbility Resume Parsing Demo
Code Samples

". ""; echo $select; //this TD is where the parsed output goes $output = "". ""; echo $output; //Select display_type //Get $result $result = utf8_decode($_SESSION['result1']); $resultX = $result; $result = preg_replace('/'/', '\'', $result); $result = preg_replace('/"/', '\'', $result); $result = preg_replace('/&/', '&', $result); $result = preg_replace('/</', '<', $result); $result = preg_replace('/>/', '>', $result); //$result = utf8_decode($result); $action = $_POST['ha_action']; $posStart = strpos($resultX, "{"); if ($posStart !== false && $posStart == 0) { $json = true; } else { $json = false; } //print "HERE ".$result; if ($json) { $result = preg_replace('/\n/', '', $result); //05/15/20 $var = json_decode($result,true); $var1 = $var["Results"][0]["HireAbilityJSONResults"][0]; $posStart = strpos($result, "\"TextResume\""); //supposed to be TextJobDescription but Shane changed the tag to TextResume in the grid, hence this $posEnd = strpos(substr($result,$posStart+16), "}"); if ($posStart !== false && $posEnd !== false) { $textJD = base64_decode($var1["TextResume"]); $resultX = preg_replace("/\\\\u([0-9abcdef]{4})/", "&#x$1;", $result); //05/18/20 $resultX = pretty_print($resultX); //05/15/20 //replace the encoded text file with real text //05/18/20 $posStart = strpos($resultX, "\"TextResume\""); $posEnd = strpos(substr($resultX,$posStart+16), "}"); $resultY = substr($resultX, 0, $posStart+14); $resultX = $resultY.$textJD.substr($resultX, $posStart+15+$posEnd); } else { $resultX = pretty_print($result); //05/15/20 } $textJD = str_replace("\n","
",$textJD); //05/19/20 } else { $posStart = strpos($result, ""); $posEnd = strpos($result, ""); if ($posStart !== false && $posEnd !== false) { $textJD = trim(substr($result, $posStart+20, $posEnd-$posStart-20)); //$textJD = base64_decode($textJD); $textJD = str_replace("\n","
",$textJD); //05/19/20 } $posStart = strpos($resultX, ""); $tempResult1 = substr($resultX, 0, $posStart); $tempResult2 = substr($resultX, $posEnd+4); $resultX = $tempResult1; $resultX .= $tempResult2; } $links .= " "; $links .= "Position Requirements "; $posStart = strpos($result, ""); if ($posStart !== false && $posEnd !== false) { $links .= " Remuneration "; } $posStart = strpos($result, ""); if ($posStart !== false && $posEnd !== false) { $links .= " Skills "; } else if (sizeof($var1["PersonCompetency"]) > 0) { $links .= " Skills "; } $name = buildHTMLoutputJD($result); if ($display == "output_html") { $output = "
". "
". "Visual Output
". "
".$links."
". "
". "
".$name."
". ""; } else if ($display == "output_html_text") { $output = "". "
". "
". "Visual Output
". "
". $links."
". "
".$name."
". "
". "
". "Original Text
". "
".$textJD."
". "
". ""; } else if ($display == "output_xml") { $output = "". "
HR-XML or JSON Parsed Output

". "". "
\n". ""; } else { $output = "". "
". "
". "Visual Output
". "
". $links."
". "
".$name."
". "
". "
". "Original Text
". "
".$textJD."
". "
". ""; } } else { $output .= "". //"Welcome to your Parsing Trial!". ""; } $actions = array( 'http://processing.resumeparser.com/ParsingTools.soap?wsdl' => $GLOBALS['BACKUP_SERVER_NAME'].' (Production/Testing - backup) http://processing.resumeparser.com/ParsingTools.soap?wsdl'); $output .= "". "". "". "". ""; //Select output_type /*if(isset($_POST['ha_action']) && !isset($_POST['save_as_file'])) { if (isset($_POST['output_type'])) { $output = $_POST['output_type']; if ($output == "output_hrxml") $checked_output_hrxml = "checked='checked'"; else $checked_output_hrxml = ""; if ($output == "output_json") $checked_output_json = "checked='checked'"; else $checked_output_json = ""; } else $checked_output_hrxml = "checked='checked'"; }*/ $output .= "". ""; if (!$gotResults) { $output .= "". ""; } //$output .= ""; echo $output; ?>
Server:
". ""; $output .= "". "
". "
Read about Best testing practices
". "
Resume Parsing Demo
". "
". "
Integration Documentation
". "

Enter Your Product Code:
' SIZE=35>
". "
". ""; echo $output; //if "email" variable is filled out, send email $email = $_REQUEST['email']; //echo "HELLO ".strlen($email); if (isset($_POST['email']) && strlen($email) > 0) { //Email information $admin_email = "igliksberg@hireability.com, ksmith@hireability.com"; //$email = $_REQUEST['email']; $subject = $_REQUEST['subject']; $comment = $_REQUEST['comment']; //send email mail($admin_email, "$subject", $comment, "From:" . $email); //Email response echo "
Thank you for contacting us!
"; } //if "email" variable is not filled out, display the form //else { ?>
How are we doing?
Your Email:
Subject:
Message:
© 2020 Hireability LLC. All rights reserved.
". ""; //JOB ID if ($id != "") { $name .= "
Job ID:"; $name .= $id; $name .= "
"; } //POSITION TITLE if ($positionTitle != "") { $name .= "
Position Title: "; $name .= $positionTitle; $name .= "
"; } //LOCATION if (sizeof($location) > 0) { $name .= "
Location: "; if (sizeof($location[0]["FormattedLocation"]) > 0) $name .= $location[0]["FormattedLocation"]; else if (sizeof($location[0]["StreetAddress"]) > 0) $name .= $location[0]["FormattedLocation"]; $name .= "
"; } //MINIMUM EXPERIENCE if ($requiredMinWorkExp != "") { $name .= "
Minimum Experience Required: "; $name .= $requiredMinWorkExp; $name .= "
"; } //EXPERIENCE REQUIRED if ($requiredWorkExp != "") { $name .= "
Experience Required: "; $name .= $requiredWorkExp; $name .= "
"; } //MINIMUM EDUCATION if (sizeof($minEduLevel) > 0) { $name .= "
Minimum Education Level: "; if ($minEduLevel[0]["Degree"] != "") $name .= $minEduLevel[0]["Degree"]; else $name .= $minEduLevel[0]["SchoolType"]; $name .= "
"; } $name .= "". ""; //SKILLS if (sizeof($skill) > 0) { $name .= "
"; //$name .= "
Skills & Competencies ^
"; $name .= "
Skills & Competencies
"; $size = sizeof($skill); $counter = 0; while ($counter < $size) { //SKILL NAME $name .= "
"; $name .= $skill[$counter]["CompetencyName"]; $name .= "
"; $counter++; } //while $name .= "
". ""; } //if return $name; } //////////////////////////////////////////// HR-XML OUTPUT ////////////////////////////////////////////////// $name .= "
"; $posStart = strpos($result, ""); $posEnd = strpos($result, ""); if ($posStart !== false && $posEnd !== false) { $positionPosting = trim(substr($result, $posStart, $posEnd-$posStart)); } if (sizeof($positionPosting)) { //JOB ID $posStart = strpos($positionPosting, ""); $posEnd = strpos($positionPosting, ""); if ($posStart !== false && $posEnd !== false) { $name .= "
Job ID: "; $name .= trim(substr($positionPosting, $posStart+9, $posEnd-$posStart-9)); $name .= "
"; } //POSITION TITLE $posStart = strpos($positionPosting, ""); $posEnd = strpos($positionPosting, ""); if ($posStart !== false && $posEnd !== false) { $name .= "
Position Title: "; $name .= trim(substr($positionPosting, $posStart+7, $posEnd-$posStart-7)); $name .= "
"; } } //PositionDetail $posStart = strpos($result, ""); $posEnd = strpos($result, ""); if ($posStart !== false && $posEnd !== false) { $positionDetail = trim(substr($result, $posStart, $posEnd-$posStart)); } if (sizeof($positionDetail)) { //POSITION SCHEDULE $posStart = strpos($positionDetail, ""); $posEnd = strpos($positionDetail, ""); if ($posStart !== false && $posEnd !== false) { $name .= "
Position Schedule: "; $name .= trim(substr($positionDetail, $posStart+18, $posEnd-$posStart-18)); $name .= "
"; } //INDUSTRY $posStart = strpos($positionDetail, ""); if ($posStart !== false && $posEnd !== false && $posEnd > $posStart) { $name .= "
Industry: "; $name .= trim(substr($positionDetail, $posStart+34, $posEnd-$posStart-34)); $name .= "
"; } //COMPANy NAME $posStart = strpos($positionDetail, ""); $posEnd = strpos($positionDetail, ""); if ($posStart !== false && $posEnd !== false) { $company = trim(substr($positionDetail, $posStart, $posEnd-$posStart)); $posStart = strpos($company, ""); $posEnd = strpos($company, ""); if ($posStart !== false && $posEnd !== false) { $name .= "
Company: "; $name .= trim(substr($company, $posStart+6, $posEnd-$posStart-6)); $name .= "
"; } } //LOCATION $posStart = strpos($positionDetail, ""); $posEnd = strpos($positionDetail, ""); if ($posStart !== false && $posEnd !== false) { $location = trim(substr($positionDetail, $posStart, $posEnd-$posStart)); $posStart = strpos($location, ""); $posEnd = strpos($location, ""); if ($posStart !== false && $posEnd !== false) { $name .= "
Location: "; $name .= trim(substr($location, $posStart+6, $posEnd-$posStart-6)); $name .= "
"; } } } // end positionDetail //Supporting Materials $posStart = strpos($result, ""); $posEnd = strpos($result, ""); if ($posStart !== false && $posEnd !== false) { $supportingMaterials = trim(substr($result, $posStart, $posEnd-$posStart)); } if (sizeof($supportingMaterials)) { //DESCRIPTION $posStart = strpos($supportingMaterials, ""); $posEnd = strpos($supportingMaterials, ""); if ($posStart !== false && $posEnd !== false) { $desc = trim(substr($supportingMaterials, $posStart+13, $posEnd-$posStart-13)); $desc = str_replace("\n","
",$desc); $name .= "
Job Description:
"; $name .= "
"; $name .= $desc; $name .= "
"; } } //end supporting materials //MINIMUM EXPERIENCE $posStart = strpos($result, ""); $posEnd = strpos($result, ""); if ($posStart !== false && $posEnd !== false) { $name .= "
Minimum Experience Required: "; $name .= trim(substr($result, $posStart+47, $posEnd-$posStart-47)); $name .= " years
"; } //EXPERIENCE REQUIRED $posStart = strpos($result, ""); $posEnd = strpos($result, ""); if ($posStart !== false && $posEnd !== false) { $name .= "
Experience Required: "; $name .= trim(substr($result, $posStart+44, $posEnd-$posStart-44)); $name .= " years
"; } //MINIMUM EDUCATION $posStart = strpos($result, ""); if ($posStart !== false && $posEnd !== false) { $education = trim(substr($result, $posStart+30, $posEnd-$posStart-30)); if (sizeof($education)) { $posStart = strpos($education, "degree=\""); $posEnd = strpos($education, "\"/>"); if ($posStart !== false && $posEnd !== false) { $name .= "
Minimum Education Level: "; $name .= trim(substr($education, $posStart+8, $posEnd-$posStart-8)); $name .= "
"; } } } //REMUNERATION COMPENSATION $posStart = strpos($positionDetail, ""); $posEnd = strpos($positionDetail, ""); if ($posStart !== false && $posEnd !== false) { $name .= "
Remuneration Package:
"; $remuneration = trim(substr($positionDetail, $posStart, $posEnd-$posStart)); if (sizeof($remuneration)) { $posStart = strpos($remuneration, "baseInterval="); $posEnd = strpos($remuneration, "'>"); if ($posStart !== false && $posEnd != false) { $interval = trim(substr($remuneration, $posStart+14, $posEnd-$posStart-14)); } $posStart = strpos($remuneration, ""); $posEnd = strpos($remuneration, ""); if ($posStart !== false && $posEnd !== false) { $name .= "
Salary Range From: "; $name .= trim(substr($remuneration, $posStart+18, $posEnd-$posStart-18)); $name .= " ".$interval.""; $name .= "
"; } $posStart = strpos($remuneration, ""); $posEnd = strpos($remuneration, ""); if ($posStart !== false && $posEnd !== false) { $name .= "
Salary Range To: "; $name .= trim(substr($remuneration, $posStart+18, $posEnd-$posStart-18)); $name .= " ".$interval.""; $name .= "
"; } } } $name .= "
"; //outer div //SKILLS $posStart = strpos($positionDetail, ""); if ($posStart !== false && $posEnd !== false) { $name .= "
"; $name .= "
Skills & Competencies
"; $found=true; while ($found) { $posStart = strpos($positionDetail, ""); if ($posStart !== false && $posEnd !== false) { $skill = trim(substr($positionDetail, $posStart+18, $posEnd-$posStart-18)); $positionDetail = trim(substr($positionDetail, $posEnd+13)); $posEnd = strpos($skill, "\""); if ($posEnd !==false) { $name .= "
"; $name .= trim(substr($skill, 0, $posEnd)); $name .= "
"; } else { $found = false; } } //end if else { $found = false; } } //while $name .= "
"; //outer div } return $name; } ?>