';
foreach($tab as $identifiant => $value){
printRow($identifiant, $value);
}
print '';
}
//Contient l'identité de l'entreprise
function dIdentite($tab){
print '
';
//Affichage raison sociale
if($tab['Company']['Subject'][0]['Name']){ printRow('Raison Sociale', $tab['Company']['Subject'][0]['Name']); }
//Affichage autres noms
if($tab['Name']['Trade']){ printRow('Enseigne', $tab['Name']['Trade']); }
//Affichage Forme légale
foreach($tab['LegalForm'] as $name => $forme){
switch($name){
case "Current" :
printRow('Forme légale', $forme);
break;
case "Previous" :
printRow('Forme légale précédente', $forme);
break;
}
}
//Afficage date
if($tab['Company']['Subject'][0]['Date']['Age_of_Company']){ printRow('Date de Création', $tab['Company']['Subject'][0]['Date']['Age_of_Company']); }
//Affichage adresses
$typeAddress = array('Registered', 'Trading', 'Previous Trading');
$oldAddress = '';
foreach($typeAddress as $address){
$currentAddress = $tab['Address'][$address]['EntireAddress'];
if($oldAddress != $currentAddress && $tab['Address'][$address]['EntireAddress']){
switch($address){
case "Registered" :
printRow('Adresse', $currentAddress);
break;
case "Trading" :
printRow('Adresse commerciale', $currentAddress);
break;
case "Previous Trading" :
printRow('Adresse commerciale précédente', $currentAddress);
break;
}
}
$oldAddress = $currentAddress;
}
//Affichage Communication
if($tab['Communication']){
foreach($tab['Communication'] as $name => $value){
switch($name){
case "Telephone" :
printRow('Téléphone', $value);
break;
case "Fax" :
printRow('Fax', $value);
break;
}
}
}
print '
';
}
//Contient l'activité
function dActivite($tab){
print '';
//Code NACE
if($tab['Taxonomy']){
$activite = '';
foreach($tab['Taxonomy'] as $item){
if($item['Type'] == 'Nace'){
$activite.= $item['Code'].' - '.$item['Value'].'
';
}
}
if($activite) printRow('Activité', $activite);
}
if($tab['Text']['Activities']){
$text = '';
foreach($tab['Text']['Activities'] as $item){
$text.= $item.'
';
}
printRow('', 'Informations complémentaires:
'.$text);
}
//Effectif
if($tab['Employees']['Staff_Employed']){
printRow('Effectif', $tab['Employees']['Staff_Employed']);
}
//Capital
if($tab['ShareCapitalSummary']['ShareCapital']){
foreach($tab['ShareCapitalSummary']['ShareCapital'] as $item){
foreach($item['Amount'] as $name => $value){
printRow($name, $value);
}
}
}
//Chiffre d'affaire
//Principaux dirigeants
if($tab['DirectorsDetail']){
$text = '';
foreach($tab['DirectorsDetail'] as $item){
$text.= formatName($item['Name']);
$text.= ' ('.$item['Type'].')';
$text.= '
';
}
printRow('Principaux dirigeants', $text);
}
print '
';
}
function dCredit($tab){
print '';
if($tab['CreditRating']){
if($tab['CreditRating']['Credit_Score']){
printRow('Score actuel', $tab['CreditRating']['Credit_Score']['Value']);
}
if($tab['CreditRating']['Previous_Credit_Score']){
printRow('Score précédent', $tab['CreditRating']['Previous_Credit_Score']['Value']);
}
if($tab['CreditRating']['Credit_Score']['Text']['Credit_Score_Description']){
printRow('', 'Description :
'.$tab['CreditRating']['Credit_Score']['Text']['Credit_Score_Description']);
}
if($tab['CreditRating']['Credit_Score']['Text']['Credit_Score_Explanation']){
printRow('', 'Explication :
'.$tab['CreditRating']['Credit_Score']['Text']['Credit_Score_Explanation']);
}
if($tab['CreditRating']['Maximum_Credit_Guide']){
$value = $tab['CreditRating']['Maximum_Credit_Guide']['Value'];
$value.= ' '.$tab['CreditRating']['Maximum_Credit_Guide']['Currency'];
printRow('Credit maximum (Guide)', $value);
}
}
print '
';
}
function dResume($tab){
print '';
/*
Trade Morality
Payments
Leverage Percentage
Quick Ratio Percentage
Issued Capital
Nominal Capital
Net Sales
Sales
Net Income
Total Equity
Total Fixed Assets
Stocks
Summary
*/
if($tab['FinancialSummary']['Text']){
foreach($tab['FinancialSummary']['Text'] as $name => $value){
printRow($name, $value);
}
}
if($tab['FinancialSummary']['Date']){
foreach($tab['FinancialSummary']['Date'] as $name => $value){
printRow($name, $value);
}
}
print '
';
}
function dLiens($tab){
global $firephp;
print '';
$oldKey = '';
foreach($tab['Company'] as $kCompany => $company){
if($kCompany != 'Subject'){
$text = '';
foreach($company as $detail){
$text.= $detail['Name'];
if($detail['Address']['Main']['EntireAddress']) $text.= ' ('.$detail['Address']['Main']['EntireAddress'].')
';
if($detail['Address']['Branch']['EntireAddress']) $text.= ' ('.$detail['Address']['Branch']['EntireAddress'].')
';
$text.='
';
}
printRow($kCompany, $text);
}
}
print '
';
}
function dBilans($tab){
if($tab['AccountItem']){
foreach($tab['AccountItem'] as $kAccount => $account){
print ''.$kAccount.'
';
print ' The following figures are shown in units of '.$account['Units'].'';
//Entête du tableau
print '';
print '';
print ' | ';
foreach($account['AccountingPeriod'] as $index => $period){
print ''.$period['Date'].' | ';
}
print '
';
print '';
print 'Currency | ';
foreach($account['AccountingPeriod'] as $index => $period){
print ''.$period['Currency'].' | ';
}
print '
';
//Contenu du tableau
foreach($account['AccountElement'] as $intitule => $values){
print '';
print ''.$intitule.' | ';
foreach($values as $value){
print ''.$value.' | ';
}
print '
';
}
print '
';
}
}
}
function formatName($name){
if(is_array($name)){
if($name['Family']){ $text.= $name['Family']; }
if($name['Christian']){ $text.= ' '.$name['Christian']; }
}else{
$text = $name;
}
return $text;
}
function printRow($title, $value){
print '
|
'.$title.' |
'.$value.' |
';
}
?>