amélioration de la page rapport complet, issue #0000477
This commit is contained in:
parent
af625882a3
commit
41f3d8e13f
@ -171,9 +171,10 @@ function commentaires_graphique_couleur($content){
|
||||
}
|
||||
|
||||
|
||||
function commentaires_graphique($content){
|
||||
global $siret, $siren, $idEntreprise;
|
||||
$pattern = '/\[GRAPHIQUE id=(.*?) titre=\'(.*?)\',(.*)]/';
|
||||
function commentaires_graphique($content)
|
||||
{
|
||||
global $siret, $siren, $idEntreprise; //FB::log($content, 'G');
|
||||
$pattern = '/\[GRAPHIQUE id=(.*?) titre=\'(.*?)\',(.*)\]/';
|
||||
if( preg_match($pattern, $content, $matches) ){
|
||||
//FB::log($matches,'graphique');
|
||||
$image_id = $matches[1];
|
||||
@ -188,10 +189,10 @@ function commentaires_graphique($content){
|
||||
//Determine le type du graphique
|
||||
$type = '';
|
||||
$typePattern = array(
|
||||
'projection' => '/(R\[.*]#H,.*_Y#L)/',
|
||||
'stacked' => '/((R\[.*]#HS,?){1,};?){1,}/',
|
||||
'histo' => '/(Rs?\[.*]#[H|L],?){1,}/',
|
||||
'radar' => '/(R\[.*]#R,?){1,}/',
|
||||
'projection' => '/(R\[.*\]#H,.*_Y#L)/',
|
||||
'stacked' => '/((R\[.*\]#HS,?){1,};?){1,}/',
|
||||
'histo' => '/(Rs?\[.*\]#[H|L],?){1,}/',
|
||||
'radar' => '/(R\[.*\]#R,?){1,}/',
|
||||
);
|
||||
foreach($typePattern as $type => $pattern){
|
||||
if (preg_match($pattern,$matches[3], $match_type)>0){
|
||||
@ -200,7 +201,7 @@ function commentaires_graphique($content){
|
||||
}
|
||||
}
|
||||
|
||||
FB::log($titre, 'Graphique');
|
||||
//FB::log($type, 'Graphique');
|
||||
|
||||
switch($type){
|
||||
case 'histo':
|
||||
|
@ -137,8 +137,7 @@ function scoresws_annonces($siret, $siren, $idEntreprise, $vue, $idan)
|
||||
|
||||
function scoresws_ratios($siret, $siren, $idEntreprise)
|
||||
{
|
||||
global $client, $fileName, $bilansInfos, $ratiosSecteur, $ratiosEntrep,
|
||||
$ratiosInfos, $ratiosSecteur, $page, $firephp;
|
||||
global $client, $page;
|
||||
|
||||
$fileName = 'ratios-';
|
||||
if (($siret*1) == 0 || ($siren*1) < 100) {
|
||||
@ -425,9 +424,10 @@ function scoresws_evenements($siren, $nic = 0, $idEntreprise = 0, $vue = '') {
|
||||
$fileName = 'evenements-'.$idEntreprise;
|
||||
} else {
|
||||
$fileName = 'evenements-'.$siret;
|
||||
if (!empty($vue)) { $fileName.= $vue; }
|
||||
}
|
||||
|
||||
if (!empty($vue)) { $fileName.= '-'.$vue; }
|
||||
|
||||
cache_filename($fileName);
|
||||
if( cache_exist() && !hasModeEdition() ) {
|
||||
$return = cache_get('evens');
|
||||
@ -447,3 +447,91 @@ function scoresws_evenements($siren, $nic = 0, $idEntreprise = 0, $vue = '') {
|
||||
return $return;
|
||||
}
|
||||
|
||||
function scoresws_rapport($siren, $idEntreprise, $niveau = 3) {
|
||||
global $client;
|
||||
|
||||
if ( intval($siren) == 0 && intval($siren) < 100) {
|
||||
$fileName = 'rapport-'.$idEntreprise;
|
||||
} else {
|
||||
$fileName = 'rapport-'.$siren;
|
||||
|
||||
}
|
||||
if (!empty($niveau)) { $fileName.= '-'.$niveau; }
|
||||
|
||||
cache_filename($fileName);
|
||||
if( cache_exist() && !hasModeEdition() ) {
|
||||
$return['Identite'] = cache_get('Identite');
|
||||
$return['Dirigeants'] = cache_get('Dirigeants');
|
||||
$return['Liens'] = cache_get('Liens');
|
||||
$return['Ratios'] = cache_get('Ratios');
|
||||
$return['IndiScore'] = cache_get('IndiScore');
|
||||
$return['Annonces'] = cache_get('Annonces');
|
||||
} else {
|
||||
$return = null;
|
||||
try {
|
||||
$O = $client->getRapport($siren, $niveau, $idEntreprise);
|
||||
$elements = array(
|
||||
'Identite',
|
||||
'Dirigeants',
|
||||
'Liens',
|
||||
'IndiScore',
|
||||
'Annonces'
|
||||
);
|
||||
$return = array();
|
||||
cache_delete();
|
||||
foreach ($elements as $elem){
|
||||
if (array_key_exists('get'.$elem, $O['results'])) {
|
||||
$return[$elem] = $O['results']['get'.$elem]['result'];
|
||||
} else {
|
||||
$return[$elem] = null;
|
||||
}
|
||||
cache_add($elem, $return[$elem]);
|
||||
}
|
||||
|
||||
if (array_key_exists('getRatios', $O['results'])) {
|
||||
$result = $O['results']['getRatios']['result'];
|
||||
|
||||
$bilansInfos = $result['BilansInfos'];
|
||||
$ratiosInfos = $result['RatiosInfos'];
|
||||
$ratiosEntrep = $result['RatiosEntrep'];
|
||||
$ratiosEntrepEvol = $result['RatiosEntrepEvol'];
|
||||
$ratiosSecteur = $result['RatiosSecteur'];
|
||||
$nbEntNaf = $result['NbEntNaf'];
|
||||
if(count($bilansInfos)>0)
|
||||
{
|
||||
$format = formatRatios(
|
||||
$bilansInfos,
|
||||
$ratiosEntrep,
|
||||
$ratiosEntrepEvol,
|
||||
$ratiosInfos,
|
||||
$ratiosSecteur
|
||||
);
|
||||
while ( list($key, $val) = each( $format ) )
|
||||
{
|
||||
${$key} = $val;
|
||||
}
|
||||
}
|
||||
$return['Ratios'] = array(
|
||||
'bilansInfos' => $bilansInfos,
|
||||
'ratiosEntrep' => $ratiosEntrep,
|
||||
'ratiosEntrepEvol' => $ratiosEntrepEvol,
|
||||
'ratiosInfos' => $ratiosInfos,
|
||||
'ratiosSecteur' => $ratiosSecteur,
|
||||
'nbEntNaf' => $nbEntNaf,
|
||||
'dataActif' => $dataActif,
|
||||
'dataPassif' => $dataPassif,
|
||||
'dataSIG' => $dataSIG
|
||||
);
|
||||
} else {
|
||||
$return['Ratios'] = null;
|
||||
}
|
||||
cache_add('Ratios', $return['Ratios']);
|
||||
} catch (SoapFault $fault) {
|
||||
require_once 'soaperror.php';
|
||||
processSoapFault($client,$fault,$_SESSION['tabInfo']);
|
||||
$return = false;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,20 @@
|
||||
//Traitement des paramètres
|
||||
if (!page_checkParams()) die('Paramètres incorrects !');
|
||||
|
||||
$niveau = isset($_REQUEST['niveau']) ? $_REQUEST['niveau'] : '';
|
||||
$niveau = isset($_REQUEST['niveau']) ? $_REQUEST['niveau'] : 3;
|
||||
$niveau = 3;
|
||||
|
||||
require_once 'ratios/ratios.php';
|
||||
require_once 'scoresws/scoresws.php';
|
||||
|
||||
$O = scoresws_rapport($siren, $idEntreprise, $niveau);
|
||||
$etab = $O['Identite'];
|
||||
$annonces = $O['Annonces'];
|
||||
$dirs = $O['Dirigeants'];
|
||||
$liens = $O['Liens'];
|
||||
$ratios = $O['Ratios'];
|
||||
$indiscore = $O['IndiScore'];
|
||||
|
||||
?>
|
||||
<div id="center">
|
||||
<?php
|
||||
@ -13,7 +26,7 @@ require_once 'logos/logos.php';
|
||||
require_once 'scoresws/scoresws.php';
|
||||
require_once 'scoresws/identite.php';
|
||||
//=> BLOC IDENTITE
|
||||
$etab = scoresws_identite($siret, $siren, $idEntreprise);
|
||||
//$etab = scoresws_identite($siret, $siren, $idEntreprise);
|
||||
?>
|
||||
<h1>RAPPORT COMPLET</h1>
|
||||
|
||||
@ -23,171 +36,56 @@ require_once 'identite/content.php';
|
||||
//=> FIN BLOC IDENTITE
|
||||
|
||||
//=> BLOC ANNONCES
|
||||
require_once 'cache/cache.php';
|
||||
require_once 'partenaires/classMTva.php';
|
||||
require_once 'partenaires/classMMap.php';
|
||||
require_once 'partenaires/classMCoface.php';
|
||||
require_once 'common/dates.php';
|
||||
require_once 'scoresws/scoresws.php';
|
||||
|
||||
//Récupération des infos du webservice
|
||||
$annonces = scoresws_annonces($siret, $siren, $idEntreprise, $vue, $idan);
|
||||
|
||||
require_once 'annonces/annonces.php';
|
||||
$objAnnonces = new Annonces($annonces);
|
||||
?>
|
||||
<h1 class="titre page">ANNONCES LÉGALES</h1>
|
||||
<?php
|
||||
if (count($annonces)>0)
|
||||
if (count($annonces) > 0)
|
||||
{
|
||||
//Tri des annonces dans des tableaux différents
|
||||
$annoncesBodacc = array();
|
||||
$annoncesBalo = array();
|
||||
$annoncesAsso = array();
|
||||
foreach ($annonces as $i => $ann) {
|
||||
if ($ann['BodaccCode']=='BODA' || $ann['BodaccCode']=='BODB' || $ann['BodaccCode']=='BODC') {
|
||||
$annoncesBodacc[] = $ann;
|
||||
}elseif ($ann['BodaccCode']=='BALO') {
|
||||
$annoncesBalo[] = $ann;
|
||||
}elseif ($ann['BodaccCode']=='ASSO') {
|
||||
$annoncesAsso[] = $ann;
|
||||
}else {
|
||||
$annoncesBodacc[] = $ann;
|
||||
}
|
||||
}
|
||||
// Affichage de la liste des annonces
|
||||
//Affiche annonces Bodacc
|
||||
if (count($annoncesBodacc)>0)
|
||||
$typeAnnonces = array(
|
||||
'Bodacc' => 'EVÉNEMENTS LÉGAUX',
|
||||
'Balo' => 'BALO',
|
||||
'Bomp' => 'Marchés publics',
|
||||
'Asso' => 'Associations',
|
||||
);
|
||||
|
||||
foreach ($typeAnnonces as $type => $titre)
|
||||
{
|
||||
?>
|
||||
<h2>EVÉNEMENTS LÉGAUX</h2>
|
||||
<table>
|
||||
<?php
|
||||
foreach($annoncesBodacc as $i => $ann)
|
||||
$classType = 'annonces'.$type;
|
||||
if (count($objAnnonces->$classType)>0)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td width="140" class="StyleInfoLib">
|
||||
<span id="annoncesDate"><p>Le <?=WDate::dateT('Y-m-d','d/m/Y',$ann['DateParution']);?></p></span>
|
||||
<span id="annoncesImg">
|
||||
<?php
|
||||
$tabSource=explode('-', $ann['BodaccCode']);
|
||||
$source=$tabSource[0];
|
||||
$idSource=@$tabSource[1];
|
||||
if ($source[0] == 'B'){
|
||||
print '<img src="./img/logo_jo.png" title="Source BODACC '.$ann['BodaccNum'].' '.substr($source,-1).' '.substr($ann['DateParution'],0,4).'"/>';
|
||||
}elseif ($source[0] == 'G' || $source[0] == 'T'){
|
||||
print '<img src="./img/logo_greffe.png" title="Source Collecte Greffe"/>';
|
||||
}elseif ($source[0] == 'P'){
|
||||
print '<img src="./img/logo_inpi.png" title="Source Collecte RNCS"/>';
|
||||
}else{
|
||||
print '<img src="./img/logo_jal.png" title="Source Collecte JAL';
|
||||
if ($idSource>0) print ' $idSource';
|
||||
print '"/>';
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<h2><?=$titre?></h2>
|
||||
<table>
|
||||
<?php
|
||||
foreach($objAnnonces->$classType as $i => $ann)
|
||||
{
|
||||
$resume = $objAnnonces->getAnnonceResume($ann);
|
||||
?>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td width="140" class="StyleInfoLib">
|
||||
<span id="annoncesDate">Le <?=$resume['date']?> </span>
|
||||
<span id="annoncesImg"><?=$resume['logo']?></span>
|
||||
</td>
|
||||
<td width="450" colspan="2" class="StyleInfoData">
|
||||
<a href="/?page=annonces&siret=<?=$siret?>&idan=<?=$ann['id']?>&vue=bodacc">
|
||||
<?php
|
||||
foreach ($ann['evenements'] as $i=>$even) {
|
||||
print $even['LibEven'];
|
||||
$numEven=$even['CodeEven']*1;
|
||||
if ($numEven>3000 && $numEven<3999) print ' (clôture au '.WDate::dateT('Y-m-d','d/m/Y',$ann['dateEffet']).')';
|
||||
print '<br/>';
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
<a href="/?page=annonces&siret=<?=$siret?>&idEntreprise=<?=$idEntreprise?>&<?=$resume['href']?>">
|
||||
<?=$resume['lib']?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
//Affiche annonces Balo
|
||||
if (count($annoncesBalo)>0)
|
||||
{
|
||||
?>
|
||||
<h2>BALO</h2>
|
||||
<table>
|
||||
<?php
|
||||
foreach($annoncesBalo as $i => $ann){?>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td width="140" class="StyleInfoLib">
|
||||
<span id="annoncesDate">Le <?=WDate::dateT('Y-m-d','d/m/Y',$ann['DateParution']);?></span>
|
||||
<span id="annoncesImg">
|
||||
<?php
|
||||
if ($ann['BodaccCode'] == 'BALO'){
|
||||
print '<img src="./img/logo_jo.png" title="Source BALO n°'.$ann['BodaccNum'].'"/>';
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
</td>
|
||||
<td width="450" colspan="2" class="StyleInfoData">
|
||||
<a href="/?page=annonces&siret=<?=$siret?>&idan=<?=$ann['id']?>&vue=balo">
|
||||
<?php
|
||||
foreach ($ann['evenements'] as $i=>$even) {
|
||||
print $even['LibEven'];
|
||||
$numEven=$even['CodeEven']*1;
|
||||
if ($numEven>3000 && $numEven<3999) print ' (clôture au '.WDate::dateT('Y-m-d','d/m/Y',$ann['dateEffet']).')';
|
||||
print '<br/>';
|
||||
}
|
||||
?>
|
||||
</a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
//Affiche annonces Asso
|
||||
if (count($annoncesAsso)>0)
|
||||
{
|
||||
?>
|
||||
<h2>Associations</h2>
|
||||
<table>
|
||||
<?php
|
||||
foreach($annoncesAsso as $i => $ann){ ?>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td width="140" class="StyleInfoLib">
|
||||
<span id="annoncesDate">Le <?=WDate::dateT('Y-m-d','d/m/Y',$ann['DateParution']);?></span>
|
||||
<span id="annoncesImg">
|
||||
<?php
|
||||
if ($ann['BodaccCode'] == 'ASSO'){
|
||||
print '<img src="./img/logo_jo.png" title="Source JO ASSOCIATION n°'.$ann['BodaccNum'].'"/>';
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
</td>
|
||||
<td width="450" colspan="2" class="StyleInfoData">
|
||||
<a href="/?page=annonces&siret=<?=$siret?>&idan=<?=$ann['id']?>&vue=asso">
|
||||
<?php
|
||||
foreach ($ann['evenements'] as $i=>$even) {
|
||||
print $even['LibEven'];
|
||||
$numEven=$even['CodeEven']*1;
|
||||
if ($numEven>3000 && $numEven<3999) print ' (clôture au '.WDate::dateT('Y-m-d','d/m/Y',$ann['dateEffet']).')';
|
||||
print '<br/>';
|
||||
}
|
||||
?>
|
||||
</a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Aucune annonce bodacc pour cette entreprise
|
||||
/** Aucune annonce bodacc pour cette entreprise **/
|
||||
?>
|
||||
<h2>Evénements légaux</h2>
|
||||
<table>
|
||||
@ -211,7 +109,7 @@ require_once 'common/dates.php';
|
||||
require_once 'cache/cache.php';
|
||||
require_once 'scoresws/scoresws.php';
|
||||
|
||||
$dirs = scoresws_dirigeants($siret, $siren, $idEntreprise);
|
||||
//$dirs = scoresws_dirigeants($siret, $siren, $idEntreprise);
|
||||
?>
|
||||
<h1 class="page">DIRIGEANTS</h1>
|
||||
<h2>Liste des dirigeants actifs</h2>
|
||||
@ -292,7 +190,8 @@ require_once 'cache/cache.php';
|
||||
require_once 'ratios/ratios.php';
|
||||
require_once 'scoresws/scoresws.php';
|
||||
|
||||
$result = scoresws_ratios($siret, $siren, $idEntreprise);
|
||||
//$result = scoresws_ratios($siret, $siren, $idEntreprise);
|
||||
$result = $ratios;
|
||||
$bilansInfos = $result['bilansInfos'];
|
||||
$ratiosInfos = $result['ratiosInfos'];
|
||||
$ratiosEntrep = $result['ratiosEntrep'];
|
||||
@ -1338,7 +1237,8 @@ require_once 'scoresws/scoresws.php';
|
||||
|
||||
$tabInfo = $_SESSION['tabInfo'];
|
||||
|
||||
$etab = scoresws_indiscore($siret, $siren, $idEntreprise, $niveau);
|
||||
//$etab = scoresws_indiscore($siret, $siren, $idEntreprise, $niveau);
|
||||
$etab = $indiscore;
|
||||
$tabCommentaires = $etab['tabCommentaires'];
|
||||
$tabProjection = $etab['tabVariables'];
|
||||
FB::log($tabProjection, 'tabProjection');
|
||||
@ -1364,7 +1264,8 @@ if(count($tabCommentaires)>0){
|
||||
if(!is_array($commentaires) && !empty($commentaires)){
|
||||
//Traitement préalable des lignes
|
||||
$commentaires = html_entity_decode($commentaires,
|
||||
ENT_COMPAT,'utf-8');
|
||||
ENT_QUOTES,'utf-8');
|
||||
FB::log($commentaires, 'T');
|
||||
//Traitement des balises siren
|
||||
$commentaires = commentaires_siren($commentaires);
|
||||
//Traitement des balises lien
|
||||
|
Loading…
x
Reference in New Issue
Block a user