2014-01-10 2 views
0

드루팔 (Drupal) 메뉴가 하나 있습니다. 페이지 콜백은 best_quote이고 파일은 handle.php.inc입니다. best_quotes에서drupal 7 menu 글로벌 결과를 반환합니다.

<?php 

function best_quote(){ 
$token=get_token('RT1IADDOH2014-01-20T00:00:00DOHIAD2014-03-05T00:00:00NAENNN100QR0000USD'); 
get_search_results($token); 
$results=get_search_results($token); 
return $results; 
} 



function get_token($entry){ 
    $client = new SoapClient(); 
    $result=$client->do_LowfareSearch(array('rq'=>$array));// return the token 
    $token= $result->do_LowfareSearchResult; 
    return $token; 

} 
function get_search_results($token){ 
    $client = new SoapClient(); 
    $polling_array=array(); 
    $polling_array['rid']=$token; 
    $response= $client->do_Polling($polling_array); 
    $results= $response->do_PollingResult; 
    $xml = simplexml_load_string($results); 
    $json = json_encode($xml); 
    $array = json_decode($json,TRUE); 
      $search_results_first_part=$array["PricedItineraries"]['PricedItinerary']; 
    $priced_itineraries_count= count($search_results_first_part); 
    if($priced_itineraries_count==0){ 
     get_search_results($token); 
    }else if($priced_itineraries_count==4){ 
     get_search_results($token); 
    }else { 
    return $xml; 

} 

} 

() 함수는, 내가 결과를 반환하기를 원하지만 페이지가 비어 다음 handle.php.inc의 내용이다. 뭐가 잘못 됐는지 알아? 감사.

답변

0

문제가 발견되었습니다. if 조건에서 get_search_results ($ token); 돌아올 것이 없을 때.