56 lines
1.9 KiB
PHP
56 lines
1.9 KiB
PHP
<?php
|
|
if (!$_SESSION['connected']) die();
|
|
if ($_SESSION['tabInfo']['idClient']==34){ $_SESSION['nowAuthorized']=TRUE; }
|
|
|
|
require_once 'utils.php';
|
|
require_once 'common/dates.php';
|
|
require_once 'cache/cache.php';
|
|
require_once 'user/user.php';
|
|
require_once 'logos/logos.php';
|
|
require_once 'scoresws/scoresws.php';
|
|
require_once 'scoresws/identite.php';
|
|
|
|
//Traitement des paramètres
|
|
$siret = trim( preg_replace('/[^0-9]/', '', $_REQUEST['siret']) );
|
|
if ( strlen($siret)!=0 && strlen($siret)!=9 && strlen($siret)!=14 ){
|
|
die('Paramètres incorrects !');
|
|
}
|
|
// Si id=0 alors non communiqué
|
|
$idEntreprise = isset($_REQUEST['idEntreprise']) ?
|
|
$_REQUEST['idEntreprise'] : '';
|
|
$idEntreprise = trim( preg_replace('/[^0-9]/', '', $idEntreprise) )*1;
|
|
if ( ($siret*1)==0 && $idEntreprise==0 ){
|
|
die('Paramètres incorrects !');
|
|
}
|
|
$siren = substr($siret,0,9);
|
|
|
|
//Récupération des infos du webservice
|
|
$etab = scoresws_identite($siret, $siren, $idEntreprise);
|
|
$firephp->log($etab, 'etab');
|
|
|
|
//Enregistrement des elements dans la session
|
|
$tabEntrep = array();
|
|
$tabEntrep['raisonSociale'] = $etab['Nom'];
|
|
$tabEntrep['id'] = $etab['id'];
|
|
$tabEntrep['siren'] = $etab['Siren'];
|
|
$tabEntrep['siret'] = $etab['Siret'];
|
|
$tabEntrep['tva'] = $etab['TvaNumero'];
|
|
if (isset($etab['Isin'])) {
|
|
$tabEntrep['isin'] = $etab['Isin'];
|
|
}
|
|
$tabEntrep['AutreId'] = $etab['AutreId'];
|
|
if (isset($etab['Statut'])) {
|
|
$tabEntrep['active'] = $etab['Statut'];
|
|
}
|
|
$tabEntrep['Source'] = $etab['Source'];
|
|
$tabEntrep['SourceId'] = $etab['SourceId'];
|
|
// Utilise pour les compétences territoriale
|
|
$tabEntrep['codeCommune'] = $etab['Dept'].$etab['codeCommune'];
|
|
$tabEntrep['nafEn'] = $etab['NafEnt'];
|
|
$tabEntrep['nafEnLib'] = $etab['NafEntLib'];
|
|
$tabEntrep['nafEt'] = $etab['NafEtab'];
|
|
$tabEntrep['nafEtLib'] = $etab['NafEtabLib'];
|
|
$tabEntrep['fj'] = $etab['FJ'];
|
|
$tabEntrep['Dept'] = $etab['Dept'];
|
|
|
|
$_SESSION['tabInfo']['entrep'] = $tabEntrep; |