$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 "function buildHTMLoutputJD($result='') { $tag_style_2b = "style='vertical-align: top; text-align: center; white-space:nowrap; font-size:10pt; font-weight: bold; background-color: #777777; color: #ffffff; padding: 1px;'"; $tag_style_2c = "style='vertical-align:middle; text-align:right; font-size:12pt; font-weight:bold; color:gainsboro; padding-left:200px;'"; $tag_style_2d = "style='white-space:normal; vertical-align:middle; text-align:left; font-size:12pt; font-weight:bold; color:#333333"; //background-color:steelblue; background:linear-gradient(steelblue, slategrey); color:#ffffff; padding:5px;'"; $tag_style_3a = "style='vertical-align:top; word-wrap:break-word; font-weight:550; font-size:12pt; padding: 0px; color:#333333'"; $tag_style_3b = "style='vertical-align:top; text-align:left; white-space:normal; font-size:14pt; font-weight:bold; color:#333333;'"; $tag_style_3bb = "style='vertical-align:top; text-align:left; white-space:normal; font-size:14pt; font-weight:bold; color:#333333'"; $tag_style_3c = "style='vertical-align:top; text-align:left; white-space:normal; font-size:14pt; font-weight:400; color:#333333'"; $tag_style_3e = "style='vertical-align:top; white-space:normal; width:10%; font-weight:550; font-size:14pt; color:lightslategrey;'"; $posStart = strpos($result,"{"); if ($posStart !== false && $posStart == 0) { $json = true; } else { $json = false; } //////////////////////////////////////////// JSON OUTPUT /////////////////////////////////////////////////// if ($json !== false) { //print $result; $var = json_decode($result, true); $var1 = $var["Results"][0]["HireAbilityJSONResults"][0]; $title = $var1["Title"]; $id = $var1["Id"]; $industry = $var1["Industry"]; $location = $var1["Location"]; $positionTitle = $var1["PositionTitle"]; $minEduLevel = $var1["MinimumEducationLevel"]; $requiredMinWorkExp = $var1["RequiredMinimumWorkExperience"]; $requiredWorkExp = $var1["RequiredWorkExperience"]; $skill = $var1["PersonCompetency"]; $name .= "
".$result; } // kill object unset($client); } header("Content-type: text/html; charset=utf-8"); $output = "". "HireAbility Job Order Parsing Demo ". "". "". "". "". "\r". "". "\r". ""; echo $output; ?>