2009-04-06 17:05:03 +00:00
|
|
|
|
<?php
|
|
|
|
|
|
2009-04-07 17:44:17 +00:00
|
|
|
|
require_once 'graydon/graydonws.php';
|
|
|
|
|
// Create the request parameters
|
|
|
|
|
$request = new StdClass();
|
|
|
|
|
// Initialise the request object
|
|
|
|
|
$request->Authentication_Parameters = $authentication;
|
|
|
|
|
$request->Country = $pays;
|
2009-04-16 16:34:13 +00:00
|
|
|
|
|
|
|
|
|
$path = PATH_DATA.'/graydon/method';
|
|
|
|
|
$fileName = strtolower('CompanyMatchIdentifiers-'.$pays);
|
|
|
|
|
|
|
|
|
|
if(!file_exists($path.'/'.$fileName)){
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
$result = $graydon->getCompanyMatchIdentifiers($request);
|
|
|
|
|
$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)){
|
2009-04-07 17:44:17 +00:00
|
|
|
|
$firephp->log($identifiers,'identifiers');
|
2009-04-16 16:34:13 +00:00
|
|
|
|
$count = 0;
|
2009-04-07 17:44:17 +00:00
|
|
|
|
foreach($identifiers as $identifier){
|
2009-04-06 17:05:03 +00:00
|
|
|
|
?>
|
2009-04-16 16:34:13 +00:00
|
|
|
|
<label><?php print $identifier->CompanyIdentifier->Description ?></label>
|
|
|
|
|
<input type="text" name="frmRecherche[Identifier]" value="" />
|
|
|
|
|
<?php
|
|
|
|
|
$count++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|