$requestObject = new QueryPacket(); $requestObject->id = $id; $requestObject->weight = $weight; $requestObject->localWeight = $localWeight; $requestObject->inputCategory[0] = "city"; $requestObject->inputValue[0] = $city; for ($i = 1; $i <= count($act); $i++) { $requestObject->inputCategory[$i] = "activity"; $requestObject->inputValue[$i] = $act[$i]; } $requestObject->expectedResponse[0] = "name"; $requestObject->expectedResponse[1] = "displaycontent"; $requestObject->expectedResponse[2] = "store"; //echo '<br/><br/>'; //var_dump($requestObject); $responseObjectArray = queryProcessing($requestObject, "activity", false, true, ""); if (empty($responseObjectArray)) { echo "No results found"; } else { //var_dump($responseObjectArray); for ($outer = 1; $outer <= count($act); $outer++) { $countofres = 0; if (isset($responseObjectArray[$act[$outer]])) { //echo 'count dee '.count($responseObjectArray[$act[$outer]]).'</br>'; ?> <div class="mid-banner"> <div class="wrap"> <h3 style="color:#FFFFFF;"><?php $whichact = $act[$outer]; echo $act[$outer]; ?>
$requestObject->inputCategory[1] = "name"; $requestObject->inputValue[1] = $term; $requestObject->expectedResponse[0] = "name"; $requestObject->expectedResponse[1] = "displaycontent"; $requestObject->weight = $weight; $requestObject->localWeight = $localWeight; $responseObjectArray = queryProcessing($requestObject, "", false, true); /*Most popular*/ $requestformostpop = new QueryPacket(); $requestformostpop->inputCategory[0] = "city"; $requestformostpop->inputValue[0] = $city; $requestformostpop->inputCategory[1] = "activity"; $requestformostpop->inputValue[1] = $activity; $requestformostpop->expectedResponse[0] = "name"; $requestformostpop->expectedResponse[1] = "displaycontent"; $respObArrformostpop = queryProcessing($requestformostpop, "activity", false, true); //var_dump($respObArrformostpop); $resutformorpop = $respObArrformostpop[$activity]; //var_dump($resutformorpop); $res = $responseObjectArray[0]; $content; $outputCatArr = $res->outputCategory; $outputValArr = $res->outputValue; $valInd; $descInd; foreach ($outputValArr as $index => $responseValue) { if (strcmp($outputCatArr[$index], "displaycontent") == 0) { $descInd = $index; break; } }
//echo 'hie'; if (isset($_GET["divID"])) { $act1 = explode(',', $_GET["divID"]); } for ($ind = 1; $ind < count($act1); $ind++) { $act[$ind] = $act1[$ind - 1]; } //var_dump($act); //$act=array(0=>$_GET["activity1"],1=>$_GET["activity2"]); //$act=array("title"=>"Buffalo","activity"=>$aaa); $requestObject = new QueryPacket(); for ($i = 1; $i <= count($act); $i++) { $requestObject->inputCategory[$i - 1] = "activity"; $requestObject->inputValue[$i - 1] = $act[$i]; } $responseObjectArray = queryProcessing($requestObject, "city", true); //$_SESSION['getcity_response_obj']=serialize($responseObjectArray); $resp_for_spell = ''; for ($ind = 1; $ind <= count($act); $ind++) { if (strcmp($responseObjectArray["spell"]->spellSuggest[$act[$ind]], "correct_spell") == 0) { //$resp_for_spell=$resp_for_spell.''.$ind.')'.$act[$ind].': Correctly Spelt, '; } else { if (strcmp($responseObjectArray["spell"]->spellSuggest[$act[$ind]], "refine_search") == 0) { $resp_for_spell = $resp_for_spell . 'Misspelled word- ' . $act[$ind] . ': ' . 'Refine search, '; } else { $resp_for_spell = $resp_for_spell . 'Misspelled word- ' . $act[$ind] . ': ' . "Showing results for- " . $responseObjectArray["spell"]->spellSuggest[$act[$ind]]; } } } //echo $arrlength; ?>
echo $act[$ind]; $ind++; } else { break; } } $requestObject = new QueryPacket(); $requestObject->inputCategory[0] = "city"; $requestObject->inputValue[0] = $city; for ($i = 1; $i <= count($act); $i++) { $requestObject->inputCategory[$i] = "activity"; $requestObject->inputValue[$i] = $act[$i]; } $requestObject->expectedResponse[0] = "name"; //$requestObject->expectedResponse[1] = "content"; $responseObjectArray = queryProcessing($requestObject, "activity"); if (empty($responseObjectArray)) { echo "null"; } else { echo "</br>"; echo "</br>"; for ($outer = 1; $outer <= count($act); $outer++) { $actvalues = $responseObjectArray[$act[$outer]]; print_r($actvalues); echo "</br>"; echo "</br>"; } } ?> </body>