extranet/www/pages_saisie/searchMandataires.php

43 lines
1.2 KiB
PHP
Raw Normal View History

<?php
$q = (!$_GET["q"])? "" : strtolower($_GET["q"]);
if (!$q) return;
$firephp->log($q, 'q');
session_start();
$separator = "|";
/** Utilisation du WS **/
$client = new SoapClient(null, array( 'trace' => 1,
'soap_version' => SOAP_1_1,
'location' => WEBSERVICE_URL,
'uri' => WEBSERVICE_URI,
'login' => $_SESSION['tabInfo']['login'],
'password' => $_SESSION['tabInfo']['password'],
// 'encoding' => 'UTF-8'
));
//raisonSociale adresse codePostal Ville Siege actif deb nbRep maxRep Pertinence AvecSIREN naf
try {
2009-03-30 16:27:40 +00:00
$O = $client->searchMandataires($q, array('V', 'N', 'H', 'A', 'M')); //array pour trier les types de mandataires
$tableResults = array();
$tableResults = $O['result'];
$firephp->log($tableResults, 'Result');
$firephp->log(count($tableResults), 'count');
$return = 'A l\'adresse du bien vendu'.$separator.'adresse';
print $return;
if( count($tableResults)>0 ){
$i=0;
foreach ($tableResults as $code=>$lib){
$return = $lib;
$return.= $separator;
$return.= $code;
$return.= "\n";
//Send String|Id for the autocompleter
print $return;
}
}
}catch (SoapFault $fault){
print 'Erreur durant la recherche';
}
?>