extranet/www/pages/indiscore.php

289 lines
10 KiB
PHP
Raw Normal View History

2009-03-11 07:51:18 +00:00
<?php
2010-04-27 08:09:23 +00:00
if (!page_checkParams()) die('Paramètres incorrects !');
function formatPct($pct) {
$pct=round($pct/10,0)*10;
if ($pct==0) $pct=10;
return $pct;
}
require_once 'cache/cache.php';
2009-05-20 15:49:08 +00:00
require_once 'partenaires/classMTva.php';
require_once 'partenaires/classMMap.php';
require_once 'partenaires/classMCoface.php';
require_once 'common/dates.php';
2009-10-08 13:20:51 +00:00
require_once 'scoresws/scoresws.php';
2009-04-01 12:45:45 +00:00
$tabInfo = $_SESSION['tabInfo'];
2009-10-08 13:20:51 +00:00
$etab = scoresws_indiscore($siret, $siren, $idEntreprise);
?>
<div id="center">
<h1 class="titre">INDISCORE©</h1>
<table>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro identifiant Siren</td>
<td width="350" class="StyleInfoData"><?=substr($etab['Siren'],0,3).' '.substr($etab['Siren'],3,3).' '.substr($etab['Siren'],6,3)?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro identifiant Siret du si&egrave;ge</td>
<td width="350" class="StyleInfoData"><?=substr($etab['Siren'],0,3).' '.substr($etab['Siren'],3,3).' '.substr($etab['Siren'],6,3).' '.substr($etab['Siret'],-5)?></td>
</tr>
<? if (isset($etab['NumRC']) == true && $etab['NumRC']*1<>0) { ?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro R.C.</td>
<td width="350" class="StyleInfoData"><?=$etab['NumRC']?></td>
</tr>
<? } ?>
<tr><td colspan="3">&nbsp;</td></tr>
</table>
<h2>Raison sociale &amp; coordonnées</h2>
<table>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Raison Sociale</td>
<td width="350" class="StyleInfoData"><?=$etab['Nom'];
if (isset($etab['Nom2']) == true && $etab['Nom2']<>'') {
echo '<br/>'.$etab['Nom2'];
} ?></td>
</tr>
<?
if ($etab['Enseigne']<>'' && $etab['Sigle']<>'') { $titre='Enseigne / Sigle'; $lib=$etab['Enseigne'].' / '.$etab['Sigle']; }
elseif ($etab['Enseigne']<>'' && $etab['Sigle']=='') { $titre='Enseigne'; $lib=$etab['Enseigne']; }
elseif ($etab['Enseigne']=='' && $etab['Sigle']<>'') { $titre='Sigle'; $lib=$etab['Sigle']; }
else $titre='';
if ($titre<>'') {
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib"><?=$titre?></td>
<td width="350" class="StyleInfoData"><?=$lib?></td>
</tr><? } ?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Forme juridique</td>
<td width="350" class="StyleInfoData"><?=$etab['FJ_lib'];//@todo INSEE //.' ('.$etab['FJ']?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Date de cr&eacute;ation de l'entreprise</td>
<td width="350" class="StyleInfoData"><? $dateCreation=str_replace('-','',$etab['DateCreaEn']);
$date = new WDate;
print $date->dateT('Ymd', 'm/Y', $dateCreation);?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Adresse</td>
<td width="350" class="StyleInfoData"><?=$etab['Adresse']?><br/>
<? if ($etab['Adresse2']<>'') echo $etab['Adresse2'].'<br/>';?>
<?=$etab['CP']?>&nbsp;<?=$etab['Ville']?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">T&eacute;l&eacute;phone</td>
<td width="350" class="StyleInfoData"><?=$etab['Tel']?></td>
</tr>
<tr>
2009-05-20 15:49:08 +00:00
<td width="30">&nbsp;</td>
2009-05-22 12:26:07 +00:00
<td colspan="2" width="550" class="StyleInfoData">
<?php
2009-05-20 15:49:08 +00:00
require_once 'surveillance/surveillance.php';
echo getSurveillance('score', $siret);
2009-05-20 15:49:08 +00:00
?>
</td>
</tr>
<tr><td colspan="3">&nbsp;</td></tr>
</table>
<h2>&Eacute;valuation</h2>
<table>
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="2" class="StyleInfoData">L'&eacute;valuation indiScore&copy; est en partie basée sur les points notables suivants :<br/>
<h3><u>Conformit&eacute; l&eacute;gale :</u></h3>
<div class="stats gradiant_pic">
<ul>
<li>
<i><?=$etab['AnalyseConfor']?></i>
<div class="blocdegrade clearfix">
<span class="textdegrade">Conformit&eacute;</span>
<div class="imgdegrade"><img class="borderimg" src="./img/indiscore/imgscores-<?=formatPct($etab['ScoreConfor'])?>.png"/></div>
<div class="regle"><img src="./img/sgradiant2.png" /></div>
</div>
</li>
</ul>
</div>
<h3><u>Dirigeance :</u></h3>
<div class="stats gradiant_pic">
<ul>
<li>
<i><?=$etab['AnalyseDirigeance']?></i>
<div class="blocdegrade clearfix">
<span class="textdegrade">Dirigeance</span>
<div class="imgdegrade"><img class="borderimg" src="./img/indiscore/imgscores-<?=formatPct($etab['ScoreDirigeance'])?>.png"/></div>
<div class="regle"><img src="./img/sgradiant2.png" /></div>
</div>
</li>
</ul>
</div>
<h3><u>Solvabilit&eacute; :</u></h3>
<div class="stats gradiant_pic">
<ul>
<li>
<i>L'analyse de la solvabilit&eacute; est <?=$etab['AnalyseSolvabilite']?></i>
<div class="blocdegrade clearfix">
<span class="textdegrade">Solvabilit&eacute;</span>
<div class="imgdegrade"><img class="borderimg" src="./img/indiscore/imgscores-<?=formatPct($etab['Indiscore'])?>.png"/></div>
<div class="regle"><img src="./img/sgradiant2.png" /></div>
</div>
</li>
</ul>
</div>
</td>
</tr>
<?
$millesimeMax=date('Ymd', mktime(0, 0, 0, date('m'), date('d'), date('Y')-2));
if ($etab['NbBilansScore']>0 && $etab['Bilans'][0]['Millesime']>=$millesimeMax)
{
?>
<tr>
<td width="30">&nbsp;</td>
2009-07-22 16:59:19 +00:00
<td width="550" colspan="2" class="StyleInfoData">A la lecture du dernier bilan, la situation financi&egrave;re de l'entreprise <?=$etab['Nom']?> est <b><?=$etab['tabInfosNotations']['SituationFinanciere']?></b>.<br/>
<!-- Cette notation financi&egrave;re est <?=$etab['tabInfosNotations']['Notation']?>.<br/>-->
<?php
if (html_entity_decode($etab['tabInfosNotations']['ProbabiliteDefaut'])<>'En défaut')
echo 'La probabilit&eacute; de d&eacute;faillance associ&eacute;e &agrave; cette note avoisine les '.
number_format($etab['tabInfosNotations']['ProbabiliteDefaut'],3,',',' ') .' %';
else
echo 'Cette entreprise est d&eacute;faillante ou sur le point de le devenir.';
//[EquivalenceBDF]
?></td>
</tr>
2009-12-18 09:21:50 +00:00
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="2" class="StyleInfoData">
<i>Pour information, les méthodes standards donnent : Conan &amp; Holder = <b><?=$etab['scores']['ConanH']?></b>, Afdcc2 = <b><?=$etab['scores']['Afdcc2']?></b> et Score Z = <b><?=$etab['scores']['Z']?></b>.</i>
</td>
</tr>
<? } else { ?>
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="2" class="StyleInfoData">La situation financi&egrave;re de l'entreprise ne peut être évaluée en détail car <?if ($etab['Bilans'][0]['Millesime']<$millesimeMax && count($etab['Bilans'])>0 ) {
echo 'le dernier bilan disponible date de '.substr($etab['Bilans'][0]['Millesime'],0,4).'.';
} else {
echo 'aucun bilan n\'est disponible.';
} ?></td>
</tr>
<? } ?>
<tr><td colspan="3">&nbsp;</td></tr>
</table>
<h2>Paiements</h2>
<table>
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="2" class="StyleInfoData">
<?=html_entity_decode($etab['infoPaiement'])?>
</td>
</tr>
</table>
<h2>Conclusion</h2>
<table>
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="2" class="StyleInfoData">
Compte tenu des informations disponibles aupr&egrave;s des sources officielles Scores et D&eacute;cisions pr&eacute;sente la conclusion suivante :<br/>
<?php
2010-01-13 16:29:44 +00:00
switch($_SESSION['tabInfo']['typeScore'])
{
case '20':
$maxIndiscore = $_SESSION['tabInfo']['typeScore'];
$indiscore = $etab['Indiscore20'];
break;
case '100':
default:
$maxIndiscore = empty($_SESSION['tabInfo']['typeScore'])? '100' : $_SESSION['tabInfo']['typeScore'];
2010-01-13 16:29:44 +00:00
$indiscore = $etab['Indiscore'];
break;
}
?>
<h3>LE SCORE EST DE <?=$indiscore?> SUR <?=$maxIndiscore?> POINTS</h3>
<?php
if($etab['infoEncours']!='' && !is_numeric($etab['encours']) && $etab['encours']=='N/A'){ ?>
<h3><?=$etab['infoEncours'];?></h3>
<?php
}else{ ?>
<?php
2010-01-13 16:29:44 +00:00
if ($indiscore!=0) { ?>
<i>La tendance de la note est <?=$etab['TendanceIndiscore']?></i>
<h3>L'ENCOURS MAXIMUM CONSEILL&Eacute; EST DE <?=round($etab['encours']/1000)?> K&euro;</h3>
<?php } ?>
<h3><?=$etab['infoEncours'];?></h3>
<?php
}
?>
</td>
</tr>
<tr><td colspan="3" align="center"><img src="./img/logo_indiscore.png"/></td></tr>
</table>
2010-04-12 14:49:55 +00:00
<p class="confidentiel blockh2">
<?php
require_once 'cgu/cgu.php';
echo afficheCgu();
?>
</p>
</div>
<?
// --------------------------------------------------------------------------- //
// Export
// --------------------------------------------------------------------------- //
require_once 'export.php';
if (isset($siret) == true) {
$fileName = $page.'-'.$siret;
} else {
$fileName = $page.'-'.$idEntreprise;
}
2010-05-24 12:24:02 +00:00
$export = array('siren' => $etab['Siren'],
'siretSiege' => $etab['Siret'],
'raisonSociale' => $etab['Nom'],
'analyseConformite' => $etab['AnalyseConfor'],
'scoreConformite' => $etab['ScoreConfor'],
'analyseDirigeance' => $etab['AnalyseDirigeance'],
'scoreDirigeance' => $etab['ScoreDirigeance'],
'analyseSolvabilite' => $etab['AnalyseSolvabilite'],
'scoreSolvabilite' => $etab['ScoreSolvabilite'],
'situationFinanciere' =>
$etab['tabInfosNotations']['SituationFinanciere'],
'probabiliteDefaut' =>
$etab['tabInfosNotations']['ProbabiliteDefaut'],
'conanHolder' => $etab['scores']['ConanH'],
'afdcc2' => $etab['scores']['Afdcc2'],
'scoreZ' => $etab['scores']['Z'],
'paiement' => $etab['infoPaiement'],
'indiscore' => $indiscore,
'indiscoreMax' => $maxIndiscore,
'tendance' => $etab['TendanceIndiscore'],
'encoursMaxConseille' => $etab['encours']);
$parseTab = new tabExport;
2010-05-24 12:24:02 +00:00
$parseTab->tab = array($export);
$parseTab->type = array();
$array2csv = new ExportCSV;
$array2csv->records = $parseTab->convertTable();
$array2csv->writeCSV($fileName);
$array2xml = new ExportXML;
2010-05-24 12:24:02 +00:00
$array2xml->rootName = $page;
$array2xml->records = $export;
$array2xml->writeXML($fileName);
?>