912 lines
28 KiB
PHP
912 lines
28 KiB
PHP
<?php
|
|
require_once 'user/permissions.php';
|
|
require_once 'user/preferences.php';
|
|
require_once 'cache/cache.php';
|
|
require_once realpath(dirname(__FILE__)).'/functions.php';
|
|
|
|
global $ws_soap_client_ent;
|
|
$ws_soap_client_ent =
|
|
new SoapClient('http://webservice.sd.lan/service?wsdl-auto',
|
|
array('login' => 'sbeaugrand',
|
|
'password' => 'seb2010',
|
|
'cache_wsdl' => WSDL_CACHE_NONE,
|
|
'soap_version' => SOAP_1_2,
|
|
'trace' => true,
|
|
'features' => SOAP_SINGLE_ELEMENT_ARRAYS));
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_identite
|
|
// -------------------------------------------------------------------------- //
|
|
function scoresws_identite($siret, $siren, $idEntreprise)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = 'identite-'.$idEntreprise;
|
|
} else {
|
|
$fileName = 'identite-'.$siret;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
$return = cache_get('etab');
|
|
} else {
|
|
$return = null;
|
|
try {
|
|
$o = new StdClass;
|
|
$o->siret = $siret;
|
|
$o->id = $idEntreprise;
|
|
//$o->forceVerif
|
|
|
|
$O = $ws_soap_client_ent->__call('getIdentite', array($o));
|
|
|
|
$return = $O->getIdentiteResult->result;
|
|
cache_delete();
|
|
cache_add('etab', $return);
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
$return = false;
|
|
}
|
|
}
|
|
return $return;
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_identitelight
|
|
// -------------------------------------------------------------------------- //
|
|
function scoresws_identitelight($siret, $siren, $idEntreprise)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = 'identitelight-'.$idEntreprise;
|
|
} else {
|
|
$fileName = 'identitelight-'.$siret;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
$return = cache_get('etab');
|
|
} else {
|
|
$return = null;
|
|
try {
|
|
$o = new StdClass;
|
|
$o->siret = $siret;
|
|
$o->id = $idEntreprise;
|
|
//$o->forceVerif
|
|
|
|
$O = $ws_soap_client_ent->__call('getIdentiteLight', array($o));
|
|
|
|
$return = $O->getIdentiteLightResult->result;
|
|
cache_delete();
|
|
cache_add('etab', $return);
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
$return = false;
|
|
}
|
|
}
|
|
return $return;
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_identite_ags
|
|
// -------------------------------------------------------------------------- //
|
|
function scoresws_identite_ags($siret, $siren, $idEntreprise)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = 'identiteags-'.$idEntreprise;
|
|
} else {
|
|
$fileName = 'identiteags-'.$siret;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
$return = cache_get('etab');
|
|
} else {
|
|
$return = null;
|
|
try {
|
|
$o = new StdClass;
|
|
$o->siret = $siret;
|
|
$o->id = $idEntreprise;
|
|
|
|
$O = $ws_soap_client_ent->__call('getIdentiteAGS', array($o));
|
|
|
|
$return = $O->getIdentiteAGSResult->result;
|
|
cache_delete();
|
|
cache_add('etab', $return);
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
$return = false;
|
|
}
|
|
}
|
|
return $return;
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_annonces
|
|
// -------------------------------------------------------------------------- //
|
|
function scoresws_annonces($siret, $siren, $idEntreprise,
|
|
$vue = '', $idan = false)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = 'annonces-'.$idEntreprise;
|
|
} else {
|
|
$fileName = 'annonces-'.$siren;
|
|
}
|
|
if ($vue != '' && $idan != false) {
|
|
$fileName .= '-'.$idan;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
$return = cache_get('annonces');
|
|
} else {
|
|
if ($vue == 'bodacc' || $_REQUEST['source'] == 1) $filtre = 1;
|
|
else if ($vue == 'balo') $filtre = 2;
|
|
else if ($vue == 'asso') $filtre = 3;
|
|
else $filtre = 0;
|
|
if ($_SESSION['tabInfo']['entrep']['fj'] > 9000 &&
|
|
$_SESSION['tabInfo']['entrep']['fj'] < 9999 &&
|
|
$siren == 0) {
|
|
$filtre = 3;
|
|
}
|
|
try {
|
|
$o = new StdClass;
|
|
$o->siren = $siren;
|
|
$o->filtre = $filtre;
|
|
if ($idan != false) {
|
|
$o->idAnn = $idan;
|
|
}
|
|
//$o->position = ;
|
|
//$o->nbRep = ;
|
|
|
|
$O = $ws_soap_client_ent->__call('getAnnonces', array($o));
|
|
|
|
$return = $O->getAnnoncesResult->result;
|
|
cache_delete();
|
|
cache_add('annonces', $return);
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
$return = false;
|
|
}
|
|
}
|
|
return $return;
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_infosreg
|
|
// -------------------------------------------------------------------------- //
|
|
function scoresws_infosreg($siret, $siren, $idEntreprise, $idCom)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = 'infosreg-'.$idEntreprise;
|
|
} else {
|
|
$fileName = 'infosreg-'.$siren;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
$return = cache_get('annonces');
|
|
} else {
|
|
try {
|
|
$o = new StdClass;
|
|
$o->siren = $siren;
|
|
$o->id = $idCom;
|
|
|
|
$O = $ws_soap_client_ent->__call('getInfosReg', array($o));
|
|
|
|
$return = $O->getInfosRegResult->result;
|
|
cache_delete();
|
|
cache_add('annonces', $return);
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
$return = false;
|
|
}
|
|
}
|
|
return $return;
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_ratios
|
|
// -------------------------------------------------------------------------- //
|
|
function scoresws_ratios($siret, $siren, $idEntreprise, $page = 'ratios')
|
|
{
|
|
$fileName = 'ratios-';
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName .= $idEntreprise;
|
|
} else {
|
|
$fileName .= $siren;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
$bilansInfos = cache_get('bilansInfos');
|
|
$ratiosEntrep = cache_get('ratiosEntrep');
|
|
$ratiosEntrepEvol = cache_get('ratiosEntrepEvol');
|
|
$ratiosInfos = cache_get('ratiosInfos');
|
|
$ratiosSecteur = cache_get('ratiosSecteur');
|
|
$nbEntNaf = cache_get('nbEntNaf');
|
|
$dataActif = cache_get('dataActif');
|
|
$dataPassif = cache_get('dataPassif');
|
|
$dataSIG = cache_get('dataSIG');
|
|
$return = array('bilansInfos' => $bilansInfos,
|
|
'ratiosEntrep' => $ratiosEntrep,
|
|
'ratiosEntrepEvol' => $ratiosEntrepEvol,
|
|
'ratiosInfos' => $ratiosInfos,
|
|
'ratiosSecteur' => $ratiosSecteur,
|
|
'nbEntNaf' => $nbEntNaf,
|
|
'dataActif' => $dataActif,
|
|
'dataPassif' => $dataPassif,
|
|
'dataSIG' => $dataSIG);
|
|
} else {
|
|
$ws = new WsScores();
|
|
$reponse = $ws->getRatios($siren, $page);
|
|
if ($reponse!=false){
|
|
$result = $reponse->result;
|
|
|
|
echo "<!-- ";
|
|
print_r($result);
|
|
echo "-->";
|
|
|
|
$bilansInfos = $result->BilansInfos->item;
|
|
$ratiosInfos = $result->RatiosInfos->item;
|
|
$ratiosEntrep = $result->RatiosEntrep->item;
|
|
$ratiosEntrepEvol = $result->RatiosEntrepEvol->item;
|
|
$ratiosSecteur = $result->RatiosSecteur->item;
|
|
$nbEntNaf = $result->NbEntNaf;
|
|
if (count($bilansInfos) > 0) {
|
|
$format =
|
|
formatRatios($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);
|
|
cache_add('nbEntNaf', $nbEntNaf);
|
|
cache_add('dataActif', $dataActif);
|
|
cache_add('dataPassif', $dataPassif);
|
|
cache_add('dataSIG', $dataSIG);
|
|
$return =
|
|
array('bilansInfos' => $bilansInfos,
|
|
'ratiosEntrep' => $ratiosEntrep,
|
|
'ratiosEntrepEvol' => $ratiosEntrepEvol,
|
|
'ratiosInfos' => $ratiosInfos,
|
|
'ratiosSecteur' => $ratiosSecteur,
|
|
'nbEntNaf' => $nbEntNaf,
|
|
'dataActif' => $dataActif,
|
|
'dataPassif' => $dataPassif,
|
|
'dataSIG' => $dataSIG);
|
|
} else {
|
|
$return = $reponse;
|
|
}
|
|
}
|
|
return $return;
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_listeBilans
|
|
// -------------------------------------------------------------------------- //
|
|
function scoresws_listeBilans($siret, $siren, $idEntreprise, $mil)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = 'liasse-'.$idEntreprise;
|
|
} else {
|
|
$fileName = 'liasse-'.$siret;
|
|
}
|
|
if ($mil != false) {
|
|
$indice = str_replace('/', '', substr($mil[0], 0, 11));
|
|
$fileName .= '-'.$indice;
|
|
}
|
|
|
|
cache_filename($fileName);
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
$tabBilans = cache_get('tabBilans');
|
|
$tabBilan = cache_get('tabBilan');
|
|
return array($tabBilans, $tabBilan);
|
|
} else {
|
|
try {
|
|
$o = new StdClass;
|
|
$o->siren = $siren;
|
|
|
|
$O = $ws_soap_client_ent->__call('getListeBilans', array($o));
|
|
|
|
$tabBilans = $O->getListeBilansResult->result;
|
|
// Tri du tableau
|
|
if ($tabBilans->nbReponses > 0) {
|
|
foreach ($tabBilans->liste->item as $key => $bilan) {
|
|
$cle[$key] = $bilan->dateExercice;
|
|
}
|
|
array_multisort($cle, SORT_DESC, $tabBilans->liste->item);
|
|
}
|
|
cache_delete();
|
|
cache_add('tabBilans', $tabBilans);
|
|
|
|
if ($mil != false) {
|
|
$o = new StdClass;
|
|
$o->siren = $siren;
|
|
$o->millesime = substr($mil[0], -10);
|
|
$o->typeBilan = substr($mil[0], 0, 1);
|
|
$o->ref = $mil[1];
|
|
|
|
$O = $ws_soap_client_ent->__call('getBilan', array($o));
|
|
|
|
$tabBilan = $O->getBilanResult->result;
|
|
cache_add('tabBilan', $tabBilan);
|
|
return array($tabBilans, $tabBilan);
|
|
} else {
|
|
return array($tabBilans);
|
|
}
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
die();
|
|
}
|
|
}
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_indiscore
|
|
// -------------------------------------------------------------------------- //
|
|
function scoresws_indiscore($siret, $siren, $idEntreprise, $niveau = 2)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = 'indiscore-'.$idEntreprise.'-'.$niveau;
|
|
} else {
|
|
$fileName = 'indiscore-'.$siren.'-'.$niveau;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
$return = cache_get('etab');
|
|
} else {
|
|
try {
|
|
$plus = false;
|
|
if (hasPerm('INDISCOREP') ||
|
|
hasPerm('INDISCORE2P') ||
|
|
hasPerm('INDISCORE3P')) {
|
|
$plus = true;
|
|
}
|
|
$params = new StdClass;
|
|
$params->siren = $siren;
|
|
if (strlen($siret) == 14) {
|
|
$params->nic = substr($siret, 9);
|
|
}
|
|
$params->accesDist = true;
|
|
if ($niveau != 2) {
|
|
$params->niveau = $niveau;
|
|
}
|
|
$params->plus = $plus;
|
|
$O = $ws_soap_client_ent->getIndiScore($params);
|
|
print '<pre>';
|
|
print_r($O);
|
|
print '</pre>';
|
|
$return = $O->getIndiScoreResult->result;
|
|
cache_delete();
|
|
cache_add('etab', $return);
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
$return = false;
|
|
}
|
|
}
|
|
return $return;
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_evenements
|
|
// -------------------------------------------------------------------------- //
|
|
function scoresws_evenements($siret, $siren, $idEntreprise)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = 'evenements-'.$idEntreprise;
|
|
} else {
|
|
$fileName = 'evenements-'.$siren;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
$return = cache_get('evens');
|
|
} else {
|
|
try {
|
|
$o = new StdClass;
|
|
$o->siren = $siren;
|
|
$o->nic = substr($siret, 9);
|
|
//$o->deb
|
|
//$o->max
|
|
|
|
$O = $ws_soap_client_ent->__call('getListeEvenements', array($o));
|
|
print '<pre>';
|
|
print_r($O);
|
|
print '</pre>';
|
|
|
|
$return = $O->getListeEvenementsResult->result;
|
|
cache_delete();
|
|
cache_add('evens', $return);
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
$return = false;
|
|
}
|
|
}
|
|
return $return;
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_dirigeants
|
|
// -------------------------------------------------------------------------- //
|
|
function scoresws_dirigeants($siret, $siren, $idEntreprise)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
if ($siret == 0 && $siren < 100) {
|
|
$fileName = 'dirigeants-'.$idEntreprise;
|
|
} else {
|
|
$fileName = 'dirigeants-'.$siret;
|
|
}
|
|
$histo = false;
|
|
if (isset($_REQUEST['vue']) && $_REQUEST['vue'] == 'histo') {
|
|
$fileName .= '-histo';
|
|
$histo = true;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
$return = cache_get('dirs');
|
|
} else {
|
|
try {
|
|
$o = new StdClass;
|
|
$o->siren = $siren;
|
|
$o->histo = $histo;
|
|
|
|
$O = $ws_soap_client_ent->__call('getDirigeants', array($o));
|
|
|
|
$return = $O->getDirigeantsResult->result;
|
|
cache_delete();
|
|
cache_add('dirs', $return);
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
$return = false;
|
|
}
|
|
}
|
|
return $return;
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_liens
|
|
// -------------------------------------------------------------------------- //
|
|
function scoresws_liens($siret, $siren, $idEntreprise)
|
|
{
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = 'liens-'.$idEntreprise;
|
|
} else {
|
|
$fileName = 'liens-'.$siret;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
$return = cache_get('liens');
|
|
} else {
|
|
$ws = new WsScores();
|
|
$return = $ws->getLiens($siren);
|
|
if ($return!=false){
|
|
cache_delete();
|
|
cache_add('liens', $return);
|
|
}
|
|
}
|
|
return $return;
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_banques
|
|
// -------------------------------------------------------------------------- //
|
|
function scoresws_banques($siret, $siren, $idEntreprise)
|
|
{
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = 'banque-'.$idEntreprise;
|
|
} else {
|
|
$fileName = 'banque-'.$siret;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && hasModeEdition() == false) {
|
|
$return = cache_get('rbanque');
|
|
} else {
|
|
$return = null;
|
|
$ws = new WsScores();
|
|
$reponse = $ws->getBanques($siren);
|
|
FB::log($reponse, 'getBanques');
|
|
if ($reponse !== false){
|
|
$return = $reponse->result;
|
|
cache_delete();
|
|
cache_add('rbanque', $return);
|
|
} else {
|
|
$return = false;
|
|
}
|
|
}
|
|
return $return;
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_etablissements
|
|
// -------------------------------------------------------------------------- //
|
|
function scoresws_etablissements($siret, $siren, $idEntreprise)
|
|
{
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = 'etablissements-'.$idEntreprise;
|
|
} else {
|
|
$fileName = 'etablissements-'.$siret;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && hasModeEdition() == false) {
|
|
$return = cache_get('etabs');
|
|
} else {
|
|
$return = null;
|
|
$ws = new WsScores();
|
|
$return = $ws->getListeEtablissements($siren);
|
|
if ($return != false){
|
|
cache_delete();
|
|
cache_add('etabs', $return);
|
|
}
|
|
}
|
|
return $return;
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_privileges
|
|
// -------------------------------------------------------------------------- //
|
|
function scorews_privileges($siret, $siren, $detail, $vue)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
$fileName = 'privileges-'.$siret;
|
|
if (empty($vue) == false) {
|
|
$fileName .= '-'.$vue;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
return cache_get('privileges');
|
|
}
|
|
|
|
try {
|
|
$o = new StdClass;
|
|
$o->siret = $siret;
|
|
$o->id = $idEntreprise;
|
|
$o->detail = $detail;
|
|
$o->vue = $vue;
|
|
|
|
$O = $ws_soap_client_ent->__call('getPrivileges', array($o));
|
|
|
|
$return = $O->getPrivilegesResult->result;
|
|
cache_delete();
|
|
cache_add('privileges', $return);
|
|
return $return;
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
die();
|
|
}
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_bourse
|
|
// -------------------------------------------------------------------------- //
|
|
function scorews_bourse($siret, $siren, $idEntreprise)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = 'bourse-'.$idEntreprise;
|
|
} else {
|
|
$fileName = 'bourse-'.$siret;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
return cache_get('etab');
|
|
}
|
|
|
|
try {
|
|
$o = new StdClass;
|
|
$o->siren = $siren;
|
|
|
|
$O = $ws_soap_client_ent->__call('getInfosBourse', array($o));
|
|
|
|
$return = $O->getInfosBourseResult->result;
|
|
|
|
cache_delete();
|
|
cache_add('etab', $return);
|
|
return $return;
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
die();
|
|
}
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_competences
|
|
// -------------------------------------------------------------------------- //
|
|
function scorews_competences($siret, $siren, $idEntreprise, $type, $codeComm)
|
|
{
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = 'competences-'.$idEntreprise;
|
|
} else {
|
|
$fileName = 'competences-'.$siret;
|
|
}
|
|
if ($type != '') {
|
|
$fileName .= '-'.$type;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
return cache_get('competences');
|
|
}
|
|
|
|
$ws = new WsScores();
|
|
$reponse = $ws->getListeCompetences($siren, $type, $codeComm);
|
|
FB::log($reponse, 'ListeCompetences');
|
|
if ($reponse!==false){
|
|
$return = $reponse->result;
|
|
cache_delete();
|
|
cache_add('competences', $return);
|
|
return $return;
|
|
}
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_conventions
|
|
// -------------------------------------------------------------------------- //
|
|
function scorews_conventions($siret, $siren, $idEntreprise)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = 'conventions-'.$idEntreprise;
|
|
} else {
|
|
$fileName = 'conventions-'.$siret;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
return cache_get('conventions');
|
|
}
|
|
|
|
try {
|
|
$o = new StdClass;
|
|
$o->siren = $siren;
|
|
|
|
$O = $ws_soap_client_ent->__call('getListeConventions', array($o));
|
|
|
|
$return = $O->getListeConventionsResult->result;
|
|
|
|
cache_delete();
|
|
cache_add('conventions', $return);
|
|
return $return;
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
die();
|
|
}
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_marques
|
|
// -------------------------------------------------------------------------- //
|
|
function scorews_marques($siret, $siren, $idEntreprise, $id)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
$label = 'marques';
|
|
|
|
if ($siret == 0 || $siren < 100) {
|
|
$fileName = $label.'-'.$idEntreprise;
|
|
} else {
|
|
$fileName = $label.'-'.$siret;
|
|
}
|
|
if ($id > 0) {
|
|
$fileName .= '-'.$id;
|
|
}
|
|
cache_filename($fileName);
|
|
|
|
if (cache_exist() && !(hasPerm('saisie') || hasModeEdition())) {
|
|
return cache_get($label);
|
|
}
|
|
|
|
try {
|
|
$o = new StdClass;
|
|
$o->siren = $siren;
|
|
|
|
$O = $ws_soap_client_ent->__call('getMarques', array($o));
|
|
|
|
$return = $O->getMarquesResult->result;
|
|
|
|
cache_delete();
|
|
cache_add($label, $return);
|
|
return $return;
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
die();
|
|
}
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_rechercheAnnonce
|
|
// -------------------------------------------------------------------------- //
|
|
function scorews_rechercheAnnonce($source, $dateAnnee,
|
|
$numParution, $numAnnonce)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
try {
|
|
$o = new StdClass;
|
|
$o->source = $source;
|
|
$o->dateAnnee = $dateAnnee;
|
|
$o->numParution = $numParution;
|
|
$o->numAnnonce = $numAnnonce;
|
|
|
|
$O = $ws_soap_client_ent->__call('rechercheAnnonce', array($o));
|
|
|
|
return $O->rechercheAnnonceResult->result;
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_setSurveillance
|
|
// -------------------------------------------------------------------------- //
|
|
function scorews_setSurveillance($siret, $email, $ref = '',
|
|
$source = 'annonces',
|
|
$delete = false, $encoursClient = 0)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
try {
|
|
$o = new StdClass;
|
|
$o->siret = $siret;
|
|
$o->email = $email;
|
|
if ($ref != '') {
|
|
$o->ref = $ref;
|
|
}
|
|
if ($source != 'annonces') {
|
|
$o->source = $source;
|
|
}
|
|
if ($delete != false) {
|
|
$o->delete = $delete;
|
|
}
|
|
if ($encoursClient != 0) {
|
|
$o->encoursClient = $encoursClient;
|
|
}
|
|
|
|
$O = $ws_soap_client_ent->__call('setSurveillance', array($o));
|
|
|
|
return $O->setSurveillanceResult->result;
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_setMandataire
|
|
// -------------------------------------------------------------------------- //
|
|
function scorews_setMandataire($tabInfos)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
try {
|
|
$o = new StdClass;
|
|
$o->tabInfos = $tabInfos;
|
|
|
|
$O = $ws_soap_client_ent->__call('setMandataire', array($o));
|
|
|
|
return $O->setMandataireResult->result;
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_getMandataire
|
|
// -------------------------------------------------------------------------- //
|
|
function scorews_getMandataire($idMand)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
try {
|
|
$o = new StdClass;
|
|
$o->idMand = $idMand;
|
|
|
|
$O = $ws_soap_client_ent->__call('getMandataire', array($o));
|
|
|
|
return $O->getMandataireResult->result;
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_searchMandataire
|
|
// -------------------------------------------------------------------------- //
|
|
function scorews_searchMandataire($nom, $type = array(), $cpDep = 0)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
try {
|
|
$o = new StdClass;
|
|
$o->nom = $nom;
|
|
if (empty($type) == false) {
|
|
$o->type = $type;
|
|
}
|
|
if ($cpDep != 0) {
|
|
$o->cpDep = $cpDep;
|
|
}
|
|
|
|
$O = $ws_soap_client_ent->__call('searchMandataire', array($o));
|
|
|
|
return $O->searchMandataireResult->result;
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
// scoresws_getTVA
|
|
// -------------------------------------------------------------------------- //
|
|
function scorews_getTVA($siren)
|
|
{
|
|
global $ws_soap_client_ent;
|
|
|
|
try {
|
|
$o = new StdClass;
|
|
$o->siren = $siren;
|
|
|
|
$O = $ws_soap_client_ent->__call('getTVA', array($o));
|
|
|
|
return $O->getTVAResult;
|
|
} catch (SoapFault $f) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($ws_soap_client_ent, $f, $_SESSION['tabInfo']);
|
|
return false;
|
|
}
|
|
}
|