2009-03-20 09:07:19 +00:00
|
|
|
<?php
|
2009-10-15 15:09:54 +00:00
|
|
|
|
|
|
|
function htmlentitydecode_deep($value)
|
|
|
|
{
|
|
|
|
$value = is_array($value) ?
|
|
|
|
array_map('htmlentitydecode_deep', $value) :
|
|
|
|
html_entity_decode($value);
|
|
|
|
|
|
|
|
return $value;
|
|
|
|
}
|
|
|
|
|
2009-07-21 15:08:08 +00:00
|
|
|
$siren = isset($_REQUEST['siren'])? trim($_REQUEST['siren']) : '';
|
2009-03-31 16:11:11 +00:00
|
|
|
$siren = str_replace(' ','',$siren); //Remplacer les espaces
|
2009-03-20 09:07:19 +00:00
|
|
|
|
|
|
|
if ( $siren=='' || strlen($siren)<9 || strlen($siren)>9 ) exit;
|
2009-07-21 15:08:08 +00:00
|
|
|
|
2009-03-20 09:07:19 +00:00
|
|
|
$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'],
|
|
|
|
));
|
|
|
|
|
|
|
|
$tabEntrep=array();
|
|
|
|
try {
|
2010-01-12 16:58:19 +00:00
|
|
|
$O = $client->getIdentite($siren, 0, false);
|
2009-03-20 09:07:19 +00:00
|
|
|
$tabEntrep=$O['result'];
|
|
|
|
|
2009-10-15 15:09:54 +00:00
|
|
|
} catch (SoapFault $fault) {}
|
2009-03-20 09:07:19 +00:00
|
|
|
|
|
|
|
//Retourner le tableau sous forme json
|
2009-10-15 15:09:54 +00:00
|
|
|
$tabEntrepD = htmlentitydecode_deep($tabEntrep);
|
|
|
|
$firephp->log($tabEntrepD, 'result');
|
|
|
|
echo json_encode($tabEntrepD);
|
2009-03-20 09:07:19 +00:00
|
|
|
|
|
|
|
?>
|