43 lines
1.6 KiB
PHP
43 lines
1.6 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 !');
|
|
|
|
$idEntreprise=trim(preg_replace('/[^0-9]/', '', $_REQUEST['idEntreprise']))*1; // Si id=0 alors non communiqué
|
|
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['siren'] = $etab['Siren'];
|
|
$tabEntrep['siret'] = $etab['Siret'];
|
|
$tabEntrep['tva'] = $etab['TvaNumero'];
|
|
$tabEntrep['isin'] = $etab['Isin'];
|
|
$tabEntrep['AutreId'] = $etab['AutreId'];
|
|
$tabEntrep['active'] = $etab['Statut'];
|
|
$tabEntrep['Source'] = $etab['Source'];
|
|
$tabEntrep['SourceId'] = $etab['SourceId'];
|
|
$tabEntrep['codeCommune'] = $etab['Dept'].$etab['codeCommune']; //Utilise pour les compétences territoriales
|
|
$tabEntrep['nafEn'] = $etab['NafEnt'];
|
|
$tabEntrep['nafEnLib'] = $etab['NafEntLib'];
|
|
$tabEntrep['nafEt'] = $etab['NafEtab'];
|
|
$tabEntrep['nafEtLib'] = $etab['NafEtabLib'];
|
|
$tabEntrep['fj'] = $etab['FJ'];
|
|
|
|
$_SESSION['tabInfo']['entrep'] = $tabEntrep; |