IncludePhoneticMatches = 'false'; $o->IncludeSuggestions = 'false'; if (empty($siret) == false) { $o->Query = new StdClass; $o->Query->CompanyId = $siret; $fonction = 'AdvancedSearch'; } else { $o->Query = "$raisonSociale $numVoie $libVoie $cp $ville"; if (isset($position) == true) { $o->StartRow = $position; } else { $o->StartRow = 0; } $o->NumRows = NUM_ROWS; $fonction = 'Search'; } try { $O = $soap_client->AdvancedSearch($o); } catch (SoapFault $f) { getErreurSoap($soap_client, $f); } // --------------------------------------------------------------------------- // // afficheCompany // --------------------------------------------------------------------------- // function IssetObject($var) { if (isset($var)) return ($var); } function InformationChecked($information, $object) { switch($information) { case 'VatNumber': IssetObject($object); break; case 'IssetStreet': return IssetObject($object); break; case 'PostCode': return(IssetObject($object)); break; case 'City' : return (IssetObject($object)); break; default: return(FALSE); } } function afficheCompany(&$c, $deb, $num, $pays) { echo '
  • '.$c->RegisteredName.'
    Register number '.$c->CompanyRegisterNumber.'
    '. ''.InformationChecked('VatNumber', $c->VatNumber).' '.$c->Address->HouseNumber . ' '.$c->Address->AddressType.' '.InformationChecked('IssetStreet', $c->Address->Street).'
    '.InformationChecked('PostCode', $c->Address->PostCode).' ' .InformationChecked('City', $c->Address->City).'
    Forme : '.$c->LegalForm.'

  • '; } // --------------------------------------------------------------------------- // // affichage // --------------------------------------------------------------------------- // if (isset($O->Results->Company) == true) { print '
      '; if (is_array($O->Results->Company) == true) { foreach ($O->Results->Company as $i => $c) { afficheCompany($c, $O->StartRow, $i, $pays); } } else { afficheCompany($O->Results->Company, 0, 0, $pays); } print '
    '; print ''; print ''; $curPage = $O->StartRow / NUM_ROWS + 1; $totPage = min(intval($O->NumberOfHits / NUM_ROWS), MAX_ROWS / NUM_ROWS); print ''; print ''; print '
    '; if ($O->StartRow >= NUM_ROWS) { print ''; print ''; print ''; } print ''; if ($totPage > 1) { print 'Page '.$curPage.'/'.$totPage; } print ''; if ($O->NumberOfHits - $O->StartRow > NUM_ROWS && $O->StartRow + NUM_ROWS < MAX_ROWS) { print ''; print ''; print ''; } print '
    '; } else { print 'Aucun résultat.'; if (DEBUG_SOAP) { print '

    '; print 'Requete: '.htmlspecialchars($soap_client->__getLastRequest()); print '

    '; print 'Reponse: '.htmlspecialchars($soap_client->__getLastResponse()); } } ?>