2009-04-07 17:44:17 +00:00
|
|
|
|
<?php
|
2009-04-20 16:32:11 +00:00
|
|
|
|
session_start();
|
2009-04-07 17:44:17 +00:00
|
|
|
|
if (!$_SESSION['connected']) die();
|
|
|
|
|
|
2009-04-16 16:34:13 +00:00
|
|
|
|
$tabInfo = $_SESSION['tabInfo'];
|
|
|
|
|
|
2009-04-07 17:44:17 +00:00
|
|
|
|
$identifier = $_REQUEST['identifier'];
|
|
|
|
|
$CompanyProductIdentifier = $_REQUEST['pidentifier'];
|
|
|
|
|
|
2009-04-20 16:32:11 +00:00
|
|
|
|
require_once 'i18n/cleanchar.php';
|
2009-04-09 17:10:02 +00:00
|
|
|
|
require_once 'graydon/functions.php';
|
2009-04-07 17:44:17 +00:00
|
|
|
|
require_once 'graydon/graydonws.php';
|
|
|
|
|
|
2009-04-20 12:41:56 +00:00
|
|
|
|
function dVal($value){
|
|
|
|
|
if($value == '' || $value == NULL){
|
|
|
|
|
print 'NC';
|
|
|
|
|
}else{
|
|
|
|
|
print $value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<div id="center">
|
|
|
|
|
<?php
|
|
|
|
|
|
2009-04-09 17:10:02 +00:00
|
|
|
|
$path = PATH_DATA.'/graydon';
|
2009-04-20 12:41:56 +00:00
|
|
|
|
$fileName = strtolower(str_replace( array(':',' '), '-', $identifier).'.xml');
|
2009-04-07 17:44:17 +00:00
|
|
|
|
|
2009-04-09 17:10:02 +00:00
|
|
|
|
if(!file_exists($path.'/'.$fileName)){
|
|
|
|
|
/*
|
|
|
|
|
placeOrder
|
|
|
|
|
CompanyProductIdentifier
|
|
|
|
|
Language
|
|
|
|
|
CreditOpinionCurrency
|
|
|
|
|
Country
|
|
|
|
|
|
|
|
|
|
getCompanyReport
|
|
|
|
|
OrderReference
|
|
|
|
|
MimeType
|
|
|
|
|
*/
|
|
|
|
|
//placeOrder
|
2009-04-07 17:44:17 +00:00
|
|
|
|
$request = new StdClass();
|
|
|
|
|
$request->Authentication_Parameters = $authentication;
|
2009-04-09 17:10:02 +00:00
|
|
|
|
$request->OrderCreatorEmail = 'mricois@scores-decisions.com';
|
|
|
|
|
$request->CompanyProductIdentifier = $CompanyProductIdentifier;
|
|
|
|
|
$request->PartnerData = '';
|
2009-04-07 17:44:17 +00:00
|
|
|
|
|
|
|
|
|
$firephp->log($request,'requete');
|
|
|
|
|
try
|
|
|
|
|
{
|
2009-04-09 17:10:02 +00:00
|
|
|
|
$placeOrderResult = $graydon->placeOrder($request);
|
|
|
|
|
$firephp->log($placeOrderResult,'placeOrder');
|
2009-04-16 16:34:13 +00:00
|
|
|
|
}catch( SoapFault $fault ){
|
|
|
|
|
require_once 'soaperror.php';
|
|
|
|
|
processSoapFault($client,$fault,$tabInfo);
|
2009-04-07 17:44:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-04-09 17:10:02 +00:00
|
|
|
|
//On v<>rifie l'<27>tat de le demande
|
|
|
|
|
if (isset($placeOrderResult) && $placeOrderResult->OrderStatus->OrderState == 'Completed'){
|
|
|
|
|
//getCompanyReport
|
|
|
|
|
$request = new StdClass();
|
|
|
|
|
$request->Authentication_Parameters = $authentication;
|
|
|
|
|
$request->LanguageCode = 'E'; //Sp<53>cifier la langue du rapport
|
|
|
|
|
$request->OrderReference = $placeOrderResult->OrderStatus->OrderReference;
|
|
|
|
|
$request->MimeType = 'xml';
|
|
|
|
|
|
|
|
|
|
$firephp->log($request,'requete');
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
$reportResult = $graydon->getCompanyReport($request);
|
|
|
|
|
$firephp->log($reportResult,'reportResult');
|
|
|
|
|
$xml = $reportResult->ReportXML;
|
|
|
|
|
|
|
|
|
|
//Enregistrement du fichier xml
|
|
|
|
|
$xml = $reportResult->ReportXML->any;
|
|
|
|
|
file_put_contents($path.'/'.$fileName, $xml);
|
|
|
|
|
|
2009-04-16 16:34:13 +00:00
|
|
|
|
}catch( SoapFault $fault ){
|
|
|
|
|
require_once 'soaperror.php';
|
|
|
|
|
processSoapFault($client,$fault,$tabInfo);
|
|
|
|
|
die();
|
2009-04-09 17:10:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//On prend les donn<6E>es du fichier
|
|
|
|
|
}else{
|
|
|
|
|
$firephp->log('Data depuis fichier XML');
|
|
|
|
|
$xml = file_get_contents($path.'/'.$fileName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//========= Affichage des informations =========
|
|
|
|
|
if(isset($xml) && $xml!=''){
|
|
|
|
|
?>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<h1 class="titre">IDENTITÉ INTERNATIONALE DE L'ENTREPRISE</h1>
|
2009-04-09 17:10:02 +00:00
|
|
|
|
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<table>
|
2009-04-09 17:10:02 +00:00
|
|
|
|
<?php
|
|
|
|
|
$tabCompany = array();
|
|
|
|
|
//Cr<43>ation du DOM
|
|
|
|
|
$doc = new DOMDocument;
|
|
|
|
|
$doc->preserveWhiteSpace = false;
|
|
|
|
|
$doc->loadxml($xml);
|
|
|
|
|
$xpath = new DOMXPath($doc);
|
2009-04-16 16:34:13 +00:00
|
|
|
|
$tabCompany['Identite']['Subject'] = parseCompany('Subject');
|
|
|
|
|
$tabCompany['Identite']['FormeLegale'] = parseLegal_Form();
|
|
|
|
|
$tabCompany['Identite']['Address'] = parseCompanyAddress();
|
|
|
|
|
$tabCompany['Identite']['Communication'] = parseCommunication();
|
|
|
|
|
$tabCompany['Identite']['Dirigeants'] = parseDirectorDetails();
|
|
|
|
|
$tabCompany['Identite']['Activite'] = parseTaxonomy('Nace');
|
2009-04-20 12:41:56 +00:00
|
|
|
|
$tabCompany['Identite']['Activite']['Text'] = parseFreeText('//GraydonUKCompanySchema/CompanyReportPage/CompanyReport/FreeText[@Type="Activities"]');
|
2009-04-16 16:34:13 +00:00
|
|
|
|
$tabCompany['Identite']['Effectif'] = parseEmployees('Staff_Employed');
|
|
|
|
|
$tabCompany['Identite']['Capital'] = parseShare_Capital();
|
|
|
|
|
$tabCompany['Identite']['ResumeFinance'] = parseFinancial_Summary();
|
2009-04-23 06:53:26 +00:00
|
|
|
|
$tabCompany['Identite']['CreditRating'] = parseCredit_Rating();
|
|
|
|
|
|
|
|
|
|
require_once 'graydon/functions2.php';
|
|
|
|
|
$tabReport = parseReportXML($xml);
|
|
|
|
|
$firephp->log($tabReport, 'tabReport');
|
|
|
|
|
|
2009-04-20 16:32:11 +00:00
|
|
|
|
|
|
|
|
|
function utf8decode_deep($value)
|
|
|
|
|
{
|
|
|
|
|
$value = is_array($value) ?
|
|
|
|
|
array_map('utf8decode_deep', $value) :
|
|
|
|
|
cleanutf8($value);
|
|
|
|
|
return $value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//$tabCompany = utf8decode_deep($tabCompany);
|
|
|
|
|
|
2009-04-16 16:34:13 +00:00
|
|
|
|
$firephp->log($tabCompany,'tabCompany');
|
|
|
|
|
?>
|
|
|
|
|
<?php foreach($tabCompany['Identite']['Subject']['CompanyId'] as $identifiant => $value){ ?>
|
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td width="200" class="StyleInfoLib"><?php print $identifiant;?></td>
|
|
|
|
|
<td width="350" class="StyleInfoData"><?php print $value;?></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php }?>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
</table>
|
2009-04-09 17:10:02 +00:00
|
|
|
|
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<h2>Raison sociale et coordonn<EFBFBD>es : </h2>
|
2009-04-09 17:10:02 +00:00
|
|
|
|
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<table>
|
2009-04-16 16:34:13 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td width="200" class="StyleInfoLib">Raison Sociale : </td>
|
|
|
|
|
<td width="350" class="StyleInfoData"><?php print $tabCompany['Identite']['Subject']['Name'];?></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td width="200" class="StyleInfoLib">Forme l<EFBFBD>gale : </td>
|
|
|
|
|
<td width="350" class="StyleInfoData">
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<?php
|
|
|
|
|
if(count($tabCompany['Identite']['FormeLegale'])==0){print 'NC';}
|
|
|
|
|
else{
|
|
|
|
|
foreach($tabCompany['Identite']['FormeLegale'] as $item => $value){
|
|
|
|
|
print $value.' - ('.$item.')<br/>';
|
|
|
|
|
}
|
2009-04-16 16:34:13 +00:00
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2009-04-09 17:10:02 +00:00
|
|
|
|
|
2009-04-16 16:34:13 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td width="200" class="StyleInfoLib">Date de cr<EFBFBD>ation : </td>
|
|
|
|
|
<td width="350" class="StyleInfoData">
|
|
|
|
|
<?php
|
2009-04-20 12:41:56 +00:00
|
|
|
|
dVal($tabCompany['Identite']['Subject']['Date']['Age_of_Company']);
|
2009-04-16 16:34:13 +00:00
|
|
|
|
?>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2009-04-09 17:10:02 +00:00
|
|
|
|
|
2009-04-16 16:34:13 +00:00
|
|
|
|
<?php
|
2009-04-20 12:41:56 +00:00
|
|
|
|
if(count($tabCompany['Identite']['Address'])==0){print 'Aucune adresse d<>finie';}
|
|
|
|
|
else{
|
|
|
|
|
foreach($tabCompany['Identite']['Address'] as $type => $elements){
|
2009-04-16 16:34:13 +00:00
|
|
|
|
?>
|
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td width="200" class="StyleInfoLib"><?php print $type;?></td>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<td width="350" class="StyleInfoData"><?php print $elements['EntireAddress'];?></td>
|
2009-04-16 16:34:13 +00:00
|
|
|
|
</tr>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<?php
|
2009-04-16 16:34:13 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2009-04-23 06:53:26 +00:00
|
|
|
|
|
|
|
|
|
if(count($tabCompany['Identite']['Communication'])!=0){
|
|
|
|
|
foreach($tabCompany['Identite']['Communication'] as $type => $elements){
|
2009-04-16 16:34:13 +00:00
|
|
|
|
?>
|
2009-04-23 06:53:26 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td width="200" class="StyleInfoLib"><?php print $type;?></td>
|
|
|
|
|
<td width="350" class="StyleInfoData"><?php print $elements;?></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
|
2009-04-20 12:41:56 +00:00
|
|
|
|
</table>
|
2009-04-09 17:10:02 +00:00
|
|
|
|
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<h2>Activit<EFBFBD>(s) et chiffre d'affaire de l'entreprise : </h2>
|
2009-04-09 17:10:02 +00:00
|
|
|
|
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<table>
|
2009-04-16 16:34:13 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td width="200" class="StyleInfoLib">Activit<EFBFBD> : </td>
|
|
|
|
|
<td width="350" class="StyleInfoData">
|
|
|
|
|
<?php
|
|
|
|
|
foreach($tabCompany['Identite']['Activite'] as $item => $value){
|
2009-04-20 12:41:56 +00:00
|
|
|
|
if($item != 'Text'){
|
|
|
|
|
print $item.' : '.$value['Code'].' - '.$value['Value'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(count($tabCompany['Identite']['Activite']['Text'])!=0){
|
|
|
|
|
?>
|
|
|
|
|
<br/><br>
|
|
|
|
|
<u>Informations compl<EFBFBD>mentaires :</u><br/>
|
|
|
|
|
<?php
|
|
|
|
|
foreach($tabCompany['Identite']['Activite']['Text'] as $value){
|
|
|
|
|
print $value.'<br/>';
|
|
|
|
|
}
|
2009-04-16 16:34:13 +00:00
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</td>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
</tr>
|
|
|
|
|
|
2009-04-20 16:32:11 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
2009-04-23 06:53:26 +00:00
|
|
|
|
<td width="200" class="StyleInfoLib">Effectif :</td>
|
|
|
|
|
<td width="350" class="StyleInfoData">
|
|
|
|
|
<?php dVal($tabCompany['Identite']['Effectif']);?>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2009-04-09 17:10:02 +00:00
|
|
|
|
|
2009-04-07 17:44:17 +00:00
|
|
|
|
<tr>
|
2009-04-16 16:34:13 +00:00
|
|
|
|
<td width="30"> </td>
|
2009-04-23 06:53:26 +00:00
|
|
|
|
<td width="200" class="StyleInfoLib">Capital :</td>
|
2009-04-16 16:34:13 +00:00
|
|
|
|
<td width="350" class="StyleInfoData">
|
2009-04-23 06:53:26 +00:00
|
|
|
|
Issued Capital : <?php dVal($tabCompany['Identite']['Capital']['Issued_Capital']);?><br/>
|
|
|
|
|
Nominal Capital : <?php dVal($tabCompany['Identite']['Capital']['Nominal_Capital']);?><br/>
|
2009-04-16 16:34:13 +00:00
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
2009-04-23 06:53:26 +00:00
|
|
|
|
<td width="200" class="StyleInfoLib">Chiffre d'affaire :</td>
|
2009-04-16 16:34:13 +00:00
|
|
|
|
<td width="350" class="StyleInfoData">
|
2009-04-23 06:53:26 +00:00
|
|
|
|
<?php dVal($tabCompany['Identite']['ResumeFinance']['Working Capital']);?>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
2009-04-23 06:53:26 +00:00
|
|
|
|
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
2009-04-23 06:53:26 +00:00
|
|
|
|
<td width="200" class="StyleInfoLib"></td>
|
|
|
|
|
<td width="350" class="StyleInfoData"></td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td width="200" class="StyleInfoLib">Principaux Dirigeants :</td>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<td width="350" class="StyleInfoData">
|
2009-04-23 06:53:26 +00:00
|
|
|
|
<?php
|
|
|
|
|
foreach($tabCompany['Identite']['Dirigeants'] as $element){
|
|
|
|
|
print $element['Name'].' ('.$element['Type'].')'.'<br/>';
|
|
|
|
|
//Affichage de l'adresse
|
|
|
|
|
if (isset($element['Address']['EntireAddress'])) print '<br/><i>'.$element['Address']['EntireAddress'].'</i><br/>';
|
|
|
|
|
}
|
|
|
|
|
?>
|
2009-04-16 16:34:13 +00:00
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2009-04-23 06:53:26 +00:00
|
|
|
|
</table>
|
2009-04-16 16:34:13 +00:00
|
|
|
|
|
2009-04-23 06:53:26 +00:00
|
|
|
|
<h2> Financial Summary : </h2>
|
|
|
|
|
|
|
|
|
|
<table>
|
|
|
|
|
<?php
|
|
|
|
|
foreach($tabCompany['Identite']['ResumeFinance'] as $key => $value){
|
|
|
|
|
?>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
2009-04-23 06:53:26 +00:00
|
|
|
|
<td width="200" class="StyleInfoLib"><?php print $key; ?> :</td>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<td width="350" class="StyleInfoData">
|
2009-04-23 06:53:26 +00:00
|
|
|
|
<?php dVal($value);?>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2009-04-23 06:53:26 +00:00
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
<h2> Credit Rating : </h2>
|
|
|
|
|
|
|
|
|
|
<table>
|
|
|
|
|
<?php
|
|
|
|
|
foreach($tabCompany['Identite']['CreditRating'] as $key => $element){
|
|
|
|
|
?>
|
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td width="200" class="StyleInfoLib"><?php print $key; ?> :</td>
|
|
|
|
|
<td width="350" class="StyleInfoData">
|
|
|
|
|
<?php
|
|
|
|
|
dVal($element['value']);
|
|
|
|
|
if (isset($element['text'])){
|
|
|
|
|
print '<br/>';
|
|
|
|
|
foreach($element['text'] as $text){
|
|
|
|
|
print $text;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-16 16:34:13 +00:00
|
|
|
|
|
2009-04-07 17:44:17 +00:00
|
|
|
|
<?php
|
|
|
|
|
}else{
|
|
|
|
|
?>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
<table>
|
2009-04-07 17:44:17 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td width="30"> </td>
|
|
|
|
|
<td width="500" class="StyleInfoLib">Aucune information disponible.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</table>
|
2009-04-20 12:41:56 +00:00
|
|
|
|
</div>
|
2009-04-07 17:44:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|