245 lines
6.4 KiB
PHP
Raw Normal View History

<?php
2009-04-27 15:16:02 +00:00
//Contient les Num<75>ros 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<69> 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<70>c<EFBFBD>dente', $forme);
break;
}
}
//Afficage date
if($tab['Company']['Subject'][0]['Date']['Age_of_Company']){ printRow('Date de Cr<43>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<70>c<EFBFBD>dente', $currentAddress);
break;
}
}
$oldAddress = $currentAddress;
}
//Affichage Communication
foreach($tab['Communication'] as $name => $value){
switch($name){
case "Telephone" :
printRow('T<>l<EFBFBD>phone', $value);
break;
case "Fax" :
printRow('Fax', $value);
break;
}
}
print '</table>';
}
//Contient l'activit<69>
function dActivite($tab){
print '<table>';
//Code NACE
if($tab['Taxonomy']){
2009-04-27 15:16:02 +00:00
$activite = '';
foreach($tab['Taxonomy'] as $item){
if($item['Type'] == 'Nace'){
2009-04-27 15:16:02 +00:00
$activite.= $item['Code'].' - '.$item['Value'].'<br/>';
}
}
if($activite) printRow('Activit<69>', $activite);
}
if($tab['Text']['Activities']){
2009-04-27 15:16:02 +00:00
$text = '';
foreach($tab['Text']['Activities'] as $item){
2009-04-27 15:16:02 +00:00
$text.= $item.'<br/>';
}
printRow('', '<b><u>Informations compl<70>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<70>c<EFBFBD>dent', $tab['CreditRating']['Previous_Credit_Score']['Value']);
}
if($tab['CreditRating']['Credit_Score']['Text']['Credit_Score_Description']){
printRow('', '<b><u>Description :</u></b><br/>'.$tab['CreditRating']['Credit_Score']['Text']['Credit_Score_Description']);
}
if($tab['CreditRating']['Credit_Score']['Text']['Credit_Score_Explanation']){
printRow('', '<b><u>Explication :</u></b><br/>'.$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 '</table>';
}
function dResume($tab){
2009-04-27 16:29:57 +00:00
print '<table id="resume">';
/*
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>';
}
2009-04-27 15:16:02 +00:00
function dLiens($tab){
global $firephp;
print '<table>';
$oldKey = '';
foreach($tab['Company'] as $kCompany => $company){
if($kCompany != 'Subject'){
$text = '';
foreach($company as $detail){
$text.= $detail['Name'];
if($detail['Address']['Main']['EntireAddress']) $text.= ' (<i>'.$detail['Address']['Main']['EntireAddress'].'</i>)<br/>';
if($detail['Address']['Branch']['EntireAddress']) $text.= ' (<i>'.$detail['Address']['Branch']['EntireAddress'].'</i>)<br/>';
$text.='<br/>';
}
printRow($kCompany, $text);
}
}
print '</table>';
}
function dBilans($tab){
foreach($tab['AccountItem'] as $kAccount => $account){
2009-04-27 16:29:57 +00:00
print '<div class="bilans">'.$kAccount.'</div>';
print '<span class="bilans"> The following figures are shown in units of '.$account['Units'].'</span>';
2009-04-27 15:16:02 +00:00
//Ent<6E>te du tableau
2009-04-27 16:29:57 +00:00
print '<table class="bilans">';
2009-04-27 15:16:02 +00:00
print '<thead><tr>';
print '<th>&nbsp;</th>';
foreach($account['AccountingPeriod'] as $index => $period){
2009-04-27 16:29:57 +00:00
print '<th class="right">'.$period['Date'].'</th>';
2009-04-27 15:16:02 +00:00
}
print '</tr></thead>';
print '<tr>';
print '<td>Currency</td>';
foreach($account['AccountingPeriod'] as $index => $period){
2009-04-27 16:29:57 +00:00
print '<td class="right">'.$period['Currency'].'</td>';
2009-04-27 15:16:02 +00:00
}
print '</tr>';
//Contenu du tableau
foreach($account['AccountElement'] as $intitule => $values){
print '<tr>';
print '<td>'.$intitule.'</td>';
foreach($values as $value){
2009-04-27 16:29:57 +00:00
print '<td class="right">'.$value.'</td>';
2009-04-27 15:16:02 +00:00
}
print '</tr>';
}
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>';
}
?>