54 lines
1.6 KiB
PHP
54 lines
1.6 KiB
PHP
<?php
|
|
|
|
require_once 'graydon/graydonws.php';
|
|
// Create the request parameters
|
|
$request = new StdClass();
|
|
// Initialise the request object
|
|
$request->Authentication_Parameters = $authentication;
|
|
$request->Country = $pays;
|
|
|
|
$path = PATH_DATA.'/graydon/method';
|
|
$fileName = strtolower('CompanyMatchIdentifiers-'.$pays);
|
|
|
|
if(!file_exists($path.'/'.$fileName)){
|
|
|
|
try
|
|
{
|
|
$result = $graydon->getCompanyMatchIdentifiers($request);
|
|
|
|
//Enregistrement de l'action dans les logs
|
|
$transactionIdentifier = $result->Service_Log->TransactionIdentifier;
|
|
$sessionID = $result->Service_Log->SessionID;
|
|
graydonRequeteLog($_SESSION['tabInfo']['login'], $page, 'getCompanyMatchIdentifiers', $transactionIdentifier, $sessionID);
|
|
|
|
$count = count($result->CompanyMatchIdentifiers->CompanyMatchIdentifier);
|
|
if ($count>1){
|
|
$identifiers = $result->CompanyMatchIdentifiers->CompanyMatchIdentifier;
|
|
}elseif($count==1){
|
|
$identifiers[] = $result->CompanyMatchIdentifiers->CompanyMatchIdentifier;
|
|
}
|
|
|
|
//Stockage du résultat de la méthode en cache
|
|
file_put_contents($path.'/'.$fileName, serialize($identifiers));
|
|
|
|
}catch( SoapFault $fault ){
|
|
require_once 'soaperror.php';
|
|
processSoapFault($client,$fault,$tabInfo);
|
|
}
|
|
}else{
|
|
$identifiers = unserialize(file_get_contents($path.'/'.$fileName));
|
|
}
|
|
|
|
if(isset($identifiers)){
|
|
$firephp->log($identifiers,'identifiers');
|
|
$count = 0;
|
|
foreach($identifiers as $identifier){
|
|
?>
|
|
<input type="hidden" name="method" value="identifier" />
|
|
<label><?php print $identifier->CompanyIdentifier->Description ?></label>
|
|
<input type="text" name="frmRecherche[Identifier]" value="" />
|
|
<?php
|
|
$count++;
|
|
}
|
|
}
|
|
?>
|