167 lines
6.9 KiB
PHP
167 lines
6.9 KiB
PHP
<?php
|
||
|
||
function formatPct($pct) {
|
||
$pct=round($pct/10,0)*10;
|
||
if ($pct==0) $pct=10;
|
||
return $pct;
|
||
}
|
||
|
||
function block_indiscore($wsresult)
|
||
{
|
||
global $firephp;
|
||
|
||
$etab = $wsresult;
|
||
$page = array();
|
||
$page['titre'] = 'INDISCORE©';
|
||
$page['blocks'] = array();
|
||
|
||
$i=0;
|
||
$page['blocks'][$i]['titre'] = 'Évaluation';
|
||
|
||
$i++;
|
||
$page['blocks'][$i]['table'] = array();
|
||
$lignes = array();
|
||
$lignes[] = array( 'width'=>'30', 'content'=>' ' );
|
||
$lignes[] = array( 'width'=>'550', 'content'=>info_evaluation( array('AnalyseConfor'=>$etab['AnalyseConfor'], 'ScoreConfor'=>$etab['ScoreConfor'], 'AnalyseDirigeance'=>$etab['AnalyseDirigeance'], 'ScoreDirigeance'=>$etab['ScoreDirigeance'], 'AnalyseSolvabilite'=>$etab['AnalyseSolvabilite'], 'Indiscore'=>$etab['Indiscore']) ) );
|
||
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
||
|
||
$millesimeMax=date('Ymd', mktime(0, 0, 0, date('m'), date('d'), date('Y')-2));
|
||
if ($etab['NbBilansScore']>0 && $etab['Bilans'][0]['Millesime']>=$millesimeMax)
|
||
{
|
||
$lignes = array();
|
||
$lignes[] = array( 'width'=>'30', 'content'=>' ' );
|
||
$lignes[] = array( 'width'=>'550', 'content'=>info_evaluationtxt( array('NbBilansScore'=>$etab['NbBilansScore'], 'Bilans'=>$etab['Bilans'], 'tabInfosNotations'=>$etab['tabInfosNotations']) ) );
|
||
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
||
|
||
$lignes = array();
|
||
$lignes[] = array( 'width'=>'30', 'content'=>' ' );
|
||
$lignes[] = array( 'width'=>'550', 'content'=>info_evaluationautre( array('scores'=>$etab['scores']) ) );
|
||
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
||
|
||
}else{
|
||
$lignes = array();
|
||
$lignes[] = array( 'width'=>'30', 'content'=>' ' );
|
||
$lignes[] = array( 'width'=>'550', 'content'=>info_evaluationtxt( array('NbBilansScore'=>$etab['NbBilansScore'], 'Bilans'=>$etab['Bilans'], 'tabInfosNotations'=>$etab['tabInfosNotations']) ) );
|
||
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
||
}
|
||
|
||
$i++;
|
||
$page['blocks'][$i]['titre'] = 'Conclusion';
|
||
|
||
$i++;
|
||
$page['blocks'][$i]['table'] = array();
|
||
$lignes = array();
|
||
$lignes[] = array( 'width'=>'30', 'content'=>' ' );
|
||
$lignes[] = array( 'width'=>'550', 'content'=>info_evaluationconclusion( array('Indiscore'=>$etab['Indiscore'],'infoEncours'=>$etab['infoEncours'],'encours'=>$etab['encours'], 'TendanceIndiscore'=>$etab['TendanceIndiscore']) ) );
|
||
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
||
|
||
$lignes = array();
|
||
$lignes[] = array( 'colspan'=>'2', 'content'=>'<img src="./img/logo_indiscore.png"/>' );
|
||
$page['blocks'][$i]['table']['row'][] = array( 'content'=>$lignes );
|
||
|
||
return $page;
|
||
}
|
||
|
||
function info_evaluation($info)
|
||
{
|
||
if(count($info)>0) foreach($info as $key => $v) { ${$key} = $v; }
|
||
$html = '';
|
||
$html.= 'L\'évaluation indiScore© c\'est en partie bas<61>e sur les points notables suivantes :<br/>'."\n";
|
||
|
||
$html.= '<h3><u>Conformité légale :</u></h3>'."\n";
|
||
$html.= '<div class="stats gradiant_pic">'."\n";
|
||
$html.= '<ul>'."\n";
|
||
$html.= ' <li>'."\n";
|
||
$html.= ' <i>'.$AnalyseConfor.'</i>'."\n";
|
||
$html.= ' <div class="blocdegrade clearfix">'."\n";
|
||
$html.= ' <span class="textdegrade">Conformité</span>'."\n";
|
||
$html.= ' <div class="imgdegrade"><img class="borderimg" src="./img/indiscore/imgscores-'.formatPct($ScoreConfor).'.png"/></div>'."\n";
|
||
$html.= ' <div class="regle"><img src="./img/sgradiant2.png" /></div>'."\n";
|
||
$html.= ' </div>'."\n";
|
||
$html.= ' </li>'."\n";
|
||
$html.= '</ul>'."\n";
|
||
$html.= '</div>'."\n";
|
||
|
||
$html.= '<h3><u>Dirigeance :</u></h3>'."\n";
|
||
$html.= '<div class="stats gradiant_pic">'."\n";
|
||
$html.= '<ul>'."\n";
|
||
$html.= ' <li>'."\n";
|
||
$html.= ' <i>'.$AnalyseDirigeance.'</i>'."\n";
|
||
$html.= ' <div class="blocdegrade clearfix">'."\n";
|
||
$html.= ' <span class="textdegrade">Dirigeance</span>'."\n";
|
||
$html.= ' <div class="imgdegrade"><img class="borderimg" src="./img/indiscore/imgscores-'.formatPct($ScoreDirigeance).'.png"/></div>'."\n";
|
||
$html.= ' <div class="regle"><img src="./img/sgradiant2.png" /></div>'."\n";
|
||
$html.= ' </div>'."\n";
|
||
$html.= ' </li>'."\n";
|
||
$html.= '</ul>'."\n";
|
||
$html.= '</div>'."\n";
|
||
|
||
|
||
$html.= '<h3><u>Solvabilité :</u></h3>'."\n";
|
||
$html.= '<div class="stats gradiant_pic">'."\n";
|
||
$html.= '<ul>'."\n";
|
||
$html.= ' <li>'."\n";
|
||
$html.= ' <i>L\'analyse de la solvabilité est '.$AnalyseSolvabilite.'</i>'."\n";
|
||
$html.= ' <div class="blocdegrade clearfix">'."\n";
|
||
$html.= ' <span class="textdegrade">Solvabilité</span>'."\n";
|
||
$html.= ' <div class="imgdegrade"><img class="borderimg" src="./img/indiscore/imgscores-'.formatPct($Indiscore).'.png"/></div>'."\n";
|
||
$html.= ' <div class="regle"><img src="./img/sgradiant2.png" /></div>'."\n";
|
||
$html.= ' </div>'."\n";
|
||
$html.= ' </li>'."\n";
|
||
$html.= '</ul>'."\n";
|
||
$html.= '</div>'."\n";
|
||
|
||
return $html;
|
||
}
|
||
|
||
function info_evaluationtxt($info)
|
||
{
|
||
if(count($info)>0) foreach($info as $key => $v) { ${$key} = $v; }
|
||
$millesimeMax = date('Ymd', mktime(0, 0, 0, date('m'), date('d'), date('Y')-2));
|
||
$html = '';
|
||
if ( $NbBilansScore>0 && $Bilans[0]['Millesime'] >= $millesimeMax )
|
||
{
|
||
$html.='A la lecture du dernier bilan, la situation financière de l\'entreprise '.$Nom.' est <b>'.$tabInfosNotations['SituationFinanciere'].'</b>.<br/>'."\n";
|
||
|
||
if (html_entity_decode($tabInfosNotations['ProbabiliteDefaut'])<>'En d<>faut')
|
||
$html.= 'La probabilité de défaillance associée à cette note avoisine les '.number_format($tabInfosNotations['ProbabiliteDefaut'],3,',',' ') .' %'."\n";
|
||
else
|
||
$html.= 'Cette entreprise est défaillante ou sur le point de le devenir.'."\n";
|
||
|
||
} else {
|
||
$html.='La situation financière de l\'entreprise ne peut <20>tre <20>valu<6C>e en d<>tail car';
|
||
if ($Bilans[0]['Millesime']<$millesimeMax && count($Bilans)>0 ) {
|
||
$html.= 'le dernier bilan disponible date de '.substr($Bilans[0]['Millesime'],0,4).'.'."\n";
|
||
} else {
|
||
$html.= 'aucun bilan n\'est disponible.'."\n";
|
||
}
|
||
}
|
||
return $html;
|
||
}
|
||
|
||
function info_evaluationautre($info)
|
||
{
|
||
if(count($info)>0) foreach($info as $key => $v) { ${$key} = $v; }
|
||
$html = '<i>Pour information, les m<>thodes standards donnent : Conan & Holder = <b>'.$scores['ConanH'].'</b>, Afdcc2 = <b>'.$scores['Afdcc2'].'</b> et Score Z = <b>'.$scores['Z'].'</b>.</i>'."\n";
|
||
return $html;
|
||
}
|
||
|
||
|
||
function info_evaluationconclusion($info)
|
||
{
|
||
if(count($info)>0) foreach($info as $key => $v) { ${$key} = $v; }
|
||
$html.= 'Compte tenu des informations disponibles auprès des sources officielles Scores et Décisions présente la conclusion suivante :<br/>'."\n";
|
||
$html.= '<h3>LE SCORE EST DE '.$Indiscore.' SUR 100 POINTS</h3>'."\n";
|
||
|
||
if($infoEncours!='' && !is_numeric($encours) && $encours=='N/A'){
|
||
$html.='<h3>'.$infoEncours.'</h3>';
|
||
}else{
|
||
if ($Indiscore!=0) {
|
||
$html.= '<i>La tendance de la note est '.$TendanceIndiscore.'</i>'."\n";
|
||
$html.= '<h3>L\'ENCOURS MAXIMUM CONSEILLÉ EST DE '.round($encours/1000).' K€</h3>'."\n";
|
||
}
|
||
$html.= '<h3>'.$infoEncours.'</h3>'."\n";
|
||
}
|
||
return $html;
|
||
}
|