177 lines
4.3 KiB
PHP

<?php
//Contient les Numéro d'identifiant
function dIdentifiant($tab){
$tab = $tab['Company']['Subject'][0]['CompanyId'];
print '<table>';
foreach($tab as $identifiant => $value){
printRow($identifiant, $value);
}
print '</table>';
}
//Contient l'identité de l'entreprise
function dIdentite($tab){
print '<table>';
//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
$oldAddress = '';
foreach($tab['Address'] as $name => $address){
switch($name){
case "Registered" :
printRow('Adresse', $address['EntireAddress']);
break;
case "Trading" :
printRow('Adresse commerciale', $address['EntireAddress']);
break;
}
$oldAddress = $address['EntireAddress'];
}
//Affichage Communication
foreach($tab['Communication'] as $name => $value){
switch($name){
case "Telephone" :
printRow('Téléphone', $value);
break;
case "Fax" :
printRow('Fax', $value);
break;
}
}
print '</table>';
}
//Contient l'activité
function dActivite($tab){
print '<table>';
//Code NACE
if($tab['Taxonomy']){
foreach($tab['Taxonomy'] as $item){
if($item['Type'] == 'Nace'){
printRow('Activité', $item['Code'].' - '.$item['Value']);
}
}
}
if($tab['Text']['Activities']){
foreach($tab['Text']['Activities'] as $item){
$text = $item.'<br/>';
}
printRow('', '<b><u>Informations complémentaires:</u></b><br/>'.$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.= '<br/>';
}
printRow('Principaux dirigeants', $text);
}
print '</table>';
}
function dCredit($tab){
print '<table>';
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('', '<b><u>Note :</u></b><br/>'.$tab['CreditRating']['Credit_Score']['Text']['Credit_Score_Description']);
}
if($tab['CreditRating']['Credit_Score']['Text']['Credit_Score_Explanation']){
printRow('', '<b><u>Note :</u></b><br/>'.$tab['CreditRating']['Credit_Score']['Text']['Credit_Score_Explanation']);
}
}
print '</table>';
}
function dResume($tab){
print '<table>';
/*
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 '</table>';
}
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 '<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">'.$title.'</td>
<td width="350" class="StyleInfoData">'.$value.'</td>
</tr>';
}
?>