extranet/www/pages/giant_identite.php

179 lines
5.6 KiB
PHP
Raw Normal View History

2010-08-31 13:55:19 +00:00
<?php
// --------------------------------------------------------------------------- //
// giant_identite.php
// --------------------------------------------------------------------------- //
$country = 'BE';
$provider = '001';
$company = $_GET['company'];
$gServiceHeader = new StdClass;
$gServiceHeader->ConsumerId = '006';
$gServiceHeader->Provider = new StdClass;
$gServiceHeader->Provider->ProviderId = $provider;
$gServiceHeader->Provider->CountryCode = $country;
$gServiceHeader->TimeStamp = date('Y-m-d\TH:i:s');
$gServiceHeader->TestIndication = true;
$soap_header =
new SoapHeader('http://services.giant-net.com/'.
'schema/services/shared/1.0',
'ServiceHeader', $gServiceHeader);
$soap_client =
new SoapClient('https://giant-tst.graydon.nl/search/v1?wsdl',
array('soap_version' => SOAP_1_1,
'login' => '006',
'password' => 'ClaudeMonet',
'trace' => true));
$soap_client->__setSoapHeaders($soap_header);
$o = new StdClass;
$o->Query = new StdClass;
$o->Query->VatNumber = $company;
$o->IncludePhoneticMatches = 'false';
$o->IncludeSuggestions = 'false';
try {
$O = $soap_client->__call('AdvancedSearch', array($o));
} catch (SoapFault $f) {
print_r($f);
print '<br/>';
print 'Requete: '.
htmlspecialchars($soap_client->__getLastRequest());
print '<br/>';
print 'Reponse: '.
htmlspecialchars($soap_client->__getLastResponse());
}
$soap_client2 =
new SoapClient('https://giant-tst.graydon.nl/credit-data/v1?wsdl',
array('soap_version' => SOAP_1_1,
'login' => '006',
'password' => 'ClaudeMonet',
'trace' => true));
$soap_client2->__setSoapHeaders($soap_header);
$o2 = new StdClass;
$o2->CompanyId = $company;
try {
$O2 = $soap_client2->__call('RetrieveOptions', array($o2));
} catch (SoapFault $f) {
print_r($f);
print '<br/>';
print 'Requete: '.
htmlspecialchars($soap_client2->__getLastRequest());
print '<br/>';
print 'Reponse: '.
htmlspecialchars($soap_client2->__getLastResponse());
}
// --------------------------------------------------------------------------- //
// afficheChamp
// --------------------------------------------------------------------------- //
function afficheChamp(&$obj, $champ)
{
if (isset($obj->$champ) == false) {
return;
}
print '<tr>';
print '<td width="30">&nbsp;</td>';
print '<td width="200" class="StyleInfoLib">'.$champ.'</td>';
print '<td width="350" class="StyleInfoData">'.$obj->$champ.'</td>';
print '</tr>';
}
// --------------------------------------------------------------------------- //
// Affichage identite simplifiee
// --------------------------------------------------------------------------- //
?>
<div id="center">
<h1 class="titre">IDENTIT&Eacute; INTERNATIONALE DE L&#039;ENTREPRISE</h1>
<table>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Fiche identité simplifiée<br/></td>
<td>
<u><b>Accès à la fiche identité approfondie :</b></u><br/><br/>
<?php
if (isset($O2->InvestigationOptions->InvestigationOption) == true) {
print '<b>Commandes de rapport :</b><br/><br/>';
$op = $O2->InvestigationOptions->InvestigationOption;
print '<table>';
foreach ($op->ServiceLevels->ServiceLevel as $lv) {
print '<tr>';
print '<td>';
print $lv->Name.' '.$lv->Duration.' '.$lv->DurationMetric.' : ';
print '</td>';
print '<td>';
foreach ($op->LanguageCodes->LanguageCode as $lang) {
print '<a href="?page=giant_enquete'.
'&country='.$country.
'&provider='.$provider.
'&company='.$company.
'&level='.$lv->Name.
'type=Full'.
'&lang='.$lang.'"><code>'.$lang.'&nbsp;&nbsp;</code></a>';
}
print '</td>';
print '</tr>';
}
print '</table>';
print '<br/>';
}
print '<b>Rapports immediats :</b><br/><br/>';
print '<table>';
foreach ($O2->DataSetOptions->DataSetOption as $op) {
print '<tr>';
print '<td>';
print $op->DataSetType->_.' : ';
print '</td>';
print '<td>';
foreach ($op->LanguageCodes->LanguageCode as $lang) {
print '<a href="?page=giant_enquete'.
'&country='.$country.
'&provider='.$provider.
'&company='.$company.
'&level=Immediate'.
'&type='.$op->DataSetType->_.
'&lang='.$lang.'"><code>'.$lang.'&nbsp;&nbsp;</code></a>';
}
print '</td>';
print '</tr>';
}
print '</table>';
?>
</td>
</tr>
<tr><td colspan="3">&nbsp;</td></tr>
</table>
<h2>Raison sociale et coordonnées :</h2>
<table>
<?php
$c = $O->Results->Company;
afficheChamp($c, 'RegisteredName');
afficheChamp($c, 'Building');
afficheChamp($c, 'Street');
afficheChamp($c, 'HouseNumber');
afficheChamp($c, 'HouseNumberAdd');
afficheChamp($c, 'City');
afficheChamp($c, 'Postcode');
afficheChamp($c, 'State');
afficheChamp($c, 'Country');
afficheChamp($c, 'EntireAddress');
afficheChamp($c, 'VatNumber');
afficheChamp($c, 'CompanyRegisterNumber');
afficheChamp($c, 'CompanyWebSite');
afficheChamp($c, 'CompanyEmail');
afficheChamp($c, 'ParentCompany');
afficheChamp($c, 'LegalForm');
afficheChamp($c, 'NaceCodes');
afficheChamp($c, 'PreviousRegisteredName');
afficheChamp($c, 'TelephoneNumbers');
afficheChamp($c, 'AddressType');
?>
</table>
</div>