getIdentite($siret, $idEntreprise); $return = $O['result']; cache_delete(); cache_add('etab', $return); } catch (SoapFault $fault) { require_once 'soaperror.php'; processSoapFault($client,$fault,$_SESSION['tabInfo']); $return = false; } } return $return; } function scoresws_annonces($siret, $siren, $idEntreprise, $vue, $idan) { global $client, $firephp; //Générer un nom de fichier pour le cache et l'export des fichiers if (($siret*1)==0 || ($siren*1)<100){ $fileName = 'annonces-'.$idEntreprise; }else{ $fileName = 'annonces-'.$siren; } if($vue!=''){$fileName.= '-'.$idan;} cache_filename($fileName); if( cache_exist() && !( preg_match('/saisie/i', $_SESSION['tabInfo']['droits']) || $_SESSION['tabInfo']['mode_edition']==1 ) ){ $annonces = cache_get('annonces'); $return = $annonces; }else{ if ($vue=='bodacc' || $_REQUEST['source']==1) $filtre=1; elseif ($vue=='balo') $filtre=2; elseif ($vue=='asso') $filtre=3; else $filtre=0; if ($_SESSION['tabInfo']['entrep']['fj']>9000 && $_SESSION['tabInfo']['entrep']['fj']<9999 && $siren==0) { $filtre=3; } try { $O = $client->getAnnonces($siren, $filtre, $idan); $annonces = $O['result']; cache_delete(); cache_add('annonces', $annonces); $return = $annonces; } catch (SoapFault $fault) { require_once 'soaperror.php'; processSoapFault($client,$fault,$_SESSION['tabInfo']); $return = false; } } return $return; } function scoresws_synthese($siret, $siren, $idEntreprise) { global $client, $firephp, $fileName; isset($_REQUEST['ratio'])? $ratio=$_REQUEST['ratio'] : $ratio=''; if (($siret*1)==0 || ($siren*1)<100){ $fileName = 'synthese-'.$idEntreprise; }else{ $fileName = 'synthese-'.$siren; } if($ratio!=''){$fileName.='-'.$ratio;} cache_filename($fileName); $ratiosEntrep = array(); $ratiosInfos = array(); $bilansInfos = array(); $ratiosEntrepEvol = array(); if( cache_exist() && !( preg_match('/saisie/i', $_SESSION['tabInfo']['droits']) || $_SESSION['tabInfo']['mode_edition']==1 ) ){ $ratiosEntrep = cache_get('ratiosEntrep'); $ratiosInfos = cache_get('ratiosInfos'); $bilansInfos = cache_get('bilansInfos'); $ratiosEntrepEvol = cache_get('ratiosEntrepEvol'); $return = array('bilansInfos'=>$bilansInfos, 'ratiosInfos'=>$ratiosInfos, 'ratiosEntrep'=>$ratiosEntrep, 'ratiosEntrepEvol'=>$ratiosEntrepEvol); }else{ try { $O = $client->getRatios($siren, 'synthese'); $bilansInfos = $O['result']['BilansInfos']; $ratiosInfos = $O['result']['RatiosInfos']; $ratiosEntrep = $O['result']['RatiosEntrep']; $ratiosEntrepEvol = $O['result']['RatiosEntrepEvol']; $format = ratiosRatios($bilansInfos, $ratiosEntrep, $ratiosEntrepEvol, $ratiosInfos, $ratiosSecteur); while ( list($key, $val) = each( $format ) ) { ${$key} = $val; } cache_delete(); cache_add('ratiosEntrep',$ratiosEntrep); cache_add('bilansInfos',$bilansInfos); cache_add('ratiosInfos',$ratiosInfos); cache_add('ratiosEntrepEvol',$ratiosEntrepEvol); $return = array('bilansInfos'=>$bilansInfos, 'ratiosInfos'=>$ratiosInfos, 'ratiosEntrep'=>$ratiosEntrep, 'ratiosEntrepEvol'=>$ratiosEntrepEvol); }catch (SoapFault $fault) { require_once 'soaperror.php'; processSoapFault($client,$fault,$_SESSION['tabInfo']); $return = false; } } return $return; } function scoresws_bilans($siret, $siren, $idEntreprise) { global $client, $ratiosEntrep, $firephp; if (($siret*1)==0 || ($siren*1)<100){ $fileName = 'bilans-'.$idEntreprise; }else{ $fileName = 'bilans-'.$siren; } cache_filename($fileName); if( cache_exist() && !( preg_match('/saisie/i', $_SESSION['tabInfo']['droits']) || $_SESSION['tabInfo']['mode_edition']==1 ) ) { $bilansInfos = cache_get('bilansInfos'); $ratiosInfos = cache_get('ratiosInfos'); $ratiosEntrep = cache_get('ratiosEntrep'); $ratiosEntrepEvol = cache_get('ratiosEntrepEvol'); $dataActif = cache_get('dataActif'); $dataPassif = cache_get('dataPassif'); $dataSIG = cache_get('dataSIG'); $return = array('bilansInfos'=> $bilansInfos, 'ratiosInfo'=>$ratiosInfos, 'ratiosEntrep'=>$ratiosEntrep, 'ratiosEntrepEvol'=>$ratiosEntrepEvol,'dataActif'=>$dataActif, 'dataPassif'=>$dataPassif, 'dataSIG'=>$dataSIG); } else { try { $O = $client->getRatios($siren, 'bilan'); $bilansInfos = $O['result']['BilansInfos']; $ratiosInfos = $O['result']['RatiosInfos']; $ratiosEntrep = $O['result']['RatiosEntrep']; $ratiosEntrepEvol = $O['result']['RatiosEntrepEvol']; $format = ratiosBilans($bilansInfos, $ratiosEntrep, $ratiosEntrepEvol, $ratiosInfos); while ( list($key, $val) = each( $format ) ) { ${$key} = $val; } cache_delete(); cache_add('bilansInfos', $bilansInfos); cache_add('ratiosInfos', $ratiosInfos); cache_add('ratiosEntrep', $ratiosEntrep); cache_add('ratiosEntrepEvol', $ratiosEntrepEvol); cache_add('dataActif', $dataActif); cache_add('dataPassif', $dataPassif); cache_add('dataSIG', $dataSIG); $return = array('bilansInfos'=> $bilansInfos, 'ratiosInfo'=>$ratiosInfos, 'ratiosEntrep'=>$ratiosEntrep, 'ratiosEntrepEvol'=>$ratiosEntrepEvol,'dataActif'=>$dataActif, 'dataPassif'=>$dataPassif, 'dataSIG'=>$dataSIG); }catch (SoapFault $fault) { require_once 'soaperror.php'; processSoapFault($client,$fault,$_SESSION['tabInfo']); $return = false; } } return $return; } function scoresws_ratios($siret, $siren, $idEntreprise) { global $client, $fileName, $bilansInfos, $ratiosSecteur, $ratiosEntrep, $ratiosInfos, $firephp; if (($siret*1)==0 || ($siren*1)<100){ $fileName = 'ratios-'.$idEntreprise; }else{ $fileName = 'ratios-'.$siren; } cache_filename($fileName); if( cache_exist() && !( preg_match('/saisie/i', $_SESSION['tabInfo']['droits']) || $_SESSION['tabInfo']['mode_edition']==1 ) ) { $bilansInfos = cache_get('bilansInfos'); $ratiosEntrep = cache_get('ratiosEntrep'); $ratiosEntrepEvol = cache_get('ratiosEntrepEvol'); $ratiosInfos = cache_get('ratiosInfos'); $ratiosSecteur = cache_get('ratiosSecteur'); $return = array('bilansInfos'=>$bilansInfos, 'ratiosEntrep'=>$ratiosEntrep, 'ratiosEntrepEvol'=>$ratiosEntrepEvol, 'ratiosInfos'=>$ratiosInfos,'ratiosSecteur'=>$ratiosSecteur); }else{ try { $O = $client->getRatios($siren, 'bilan'); $bilansInfos = $O['result']['BilansInfos']; $ratiosInfos = $O['result']['RatiosInfos']; $ratiosEntrep = $O['result']['RatiosEntrep']; $ratiosEntrepEvol = $O['result']['RatiosEntrepEvol']; $ratiosSecteur = $O['result']['RatiosSecteur']; $format = ratiosRatios($bilansInfos, $ratiosEntrep, $ratiosEntrepEvol, $ratiosInfos, $ratiosSecteur); while ( list($key, $val) = each( $format ) ) { ${$key} = $val; } cache_delete(); cache_add('bilansInfos', $bilansInfos); cache_add('ratiosEntrep', $ratiosEntrep); cache_add('ratiosEntrepEvol', $ratiosEntrepEvol); cache_add('ratiosInfos', $ratiosInfos); cache_add('ratiosSecteur', $ratiosSecteur); $return = array('bilansInfos'=>$bilansInfos, 'ratiosEntrep'=>$ratiosEntrep, 'ratiosEntrepEvol'=>$ratiosEntrepEvol, 'ratiosInfos'=>$ratiosInfos,'ratiosSecteur'=>$ratiosSecteur); }catch (SoapFault $fault) { require_once 'soaperror.php'; processSoapFault($client,$fault,$_SESSION['tabInfo']); $return = false; } } return $return; } function scoresws_indiscore($siret, $siren, $idEntreprise) { global $client, $firephp; if (($siret*1)==0 || ($siren*1)<100){ $fileName = 'indiscore-'.$idEntreprise; }else{ $fileName = 'indiscore-'.$siren; } cache_filename($fileName); if( cache_exist() && !( preg_match('/saisie/i', $_SESSION['tabInfo']['droits']) || $_SESSION['tabInfo']['mode_edition']==1 ) ){ $etab = cache_get('etab'); $return = $etab; }else{ try { $O = $client->getIndiscore($siren); $etab = $O['result']; cache_delete(); cache_add('etab', $etab); $return = $etab; } catch (SoapFault $fault) { require_once 'soaperror.php'; processSoapFault($client,$fault,$_SESSION['tabInfo']); $return = false; } } return $return; } function scoresws_dirigeants($siret, $siren, $idEntreprise) { global $client, $firephp; if (($siret*1)==0 && ($siren*1)<100) { $fileName = 'dirigeants-'.$idEntreprise; }else{ $fileName = 'dirigeants-'.$siret; } $histo = false; if ($_REQUEST['vue']=='histo'){ $fileName .= '-histo'; $histo=true; } cache_filename($fileName); if( cache_exist() && !( preg_match('/saisie/i', $_SESSION['tabInfo']['droits']) || $_SESSION['tabInfo']['mode_edition']==1 ) ){ $dirs = cache_get('dirs'); $return = $dirs; }else{ try { $O = $client->getDirigeants($siren, $histo); $dirs = $O['result']; cache_delete(); cache_add('dirs', $dirs); $return = $dirs; } catch (SoapFault $fault) { require_once 'soaperror.php'; processSoapFault($client,$fault,$_SESSION['tabInfo']); $return = false; } } return $return; } function scoresws_liens($siret, $siren, $idEntreprise) { global $client, $firephp; if (($siret*1)==0 || ($siren*1)<100){ $fileName = 'liens-'.$idEntreprise; }else{ $fileName = 'liens-'.$siret; } cache_filename($fileName); if( cache_exist() && !( preg_match('/saisie/i', $_SESSION['tabInfo']['droits']) || $_SESSION['tabInfo']['mode_edition']==1 ) ){ $liens = cache_get('liens'); $return = $liens; }else{ try { $O = $client->getLiens($siren, true); $liens = $O['result']; cache_delete(); cache_add('liens', $liens); } catch (SoapFault $fault) { require_once 'soaperror.php'; processSoapFault($client,$fault,$_SESSION['tabInfo']); $return = false; } } return $return; }