Enregistrement de la raison sociale et autres informations sur certaines requêtes
This commit is contained in:
parent
59a50fce3b
commit
6e6015b9f2
@ -125,8 +125,8 @@ class WsScore
|
||||
$iDbCrm = new WDB('sdv1');
|
||||
|
||||
if (strlen($siret)==14) {
|
||||
$siren=substr($siret,0,9);
|
||||
$nic=substr($siret,9,5);
|
||||
$siren = substr($siret,0,9);
|
||||
$nic = substr($siret,9,5);
|
||||
} elseif (strlen($siret)==9) {
|
||||
$siren=$siret;
|
||||
$nic='';
|
||||
@ -137,13 +137,27 @@ class WsScore
|
||||
} else {
|
||||
$test=0;
|
||||
}
|
||||
|
||||
$tabRdvInsee=array();
|
||||
if (in_array($service, array('identite')))
|
||||
{
|
||||
if ($siren>1000 && $nic>9) $strNic=" AND nic=$nic ";
|
||||
elseif ($siren==0 && $ref>0) $strNic=" AND id=$ref ";
|
||||
elseif ($siren>1000) $strNic=" AND siege=1 ORDER BY actif DESC, nic DESC ";
|
||||
|
||||
$rs = '';
|
||||
$cp = '';
|
||||
$vil = '';
|
||||
|
||||
$tabRdvInsee = array();
|
||||
if (in_array($service,
|
||||
array(
|
||||
'identite',
|
||||
'greffe_bilans',
|
||||
'greffe_actes',
|
||||
'liens',
|
||||
'dirigeants',
|
||||
'etablissements',
|
||||
'dirigeantsOp',
|
||||
'kbis',
|
||||
'indiscore', 'indiscore2', 'indiscore3', 'rapport2', 'rapport3')
|
||||
)) {
|
||||
if (intval($siren)>1000 && intval($nic)>9) $strNic=" AND nic=$nic ";
|
||||
elseif (intval($siren)==0 && $ref>0) $strNic=" AND id=$ref ";
|
||||
elseif (intval($siren)>1000) $strNic=" AND siege=1 ORDER BY actif DESC, nic DESC ";
|
||||
else return;
|
||||
$rep = $iDbCrm->select('jo.etablissements',
|
||||
'siren, nic, actif, siege, raisonSociale, adr_cp, adr_ville, source',
|
||||
@ -155,7 +169,7 @@ class WsScore
|
||||
$tabRdvInsee['source']=$tabRep['source'];
|
||||
if ($tabRep['actif']==0)
|
||||
$tabRdvInsee['actifInsee']=0;
|
||||
elseif ($siren>1000) {
|
||||
elseif (intval($siren)>1000) {
|
||||
$tabRdvInsee['actifInsee']=1;
|
||||
$rep=$iDbCrm->select('jo.rncs_entrep', 'count(*) AS nb', "siren=$siren", false, MYSQL_ASSOC);
|
||||
$tabRep=$rep[0];
|
||||
|
Loading…
x
Reference in New Issue
Block a user