diff --git a/library/WsScore/WsScore.php b/library/WsScore/WsScore.php index 9e7ee137..e2de4de0 100644 --- a/library/WsScore/WsScore.php +++ b/library/WsScore/WsScore.php @@ -132,23 +132,26 @@ class WsScore $nic=''; } - if ($tabInfoUser['clientTest']=='Oui' || $tabInfoUser['typeCompte']=='TEST') { + if ($this->tabInfoUser['clientTest']=='Oui' || $this->tabInfoUser['typeCompte']=='TEST') { $test=1; } else { $test=0; } $tabRdvInsee=array(); - if ($service=='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 "; + 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 "; else return; - $rep=$iDbCrm->select('jo.etablissements', 'siren, nic, actif, siege, raisonSociale, adr_cp, adr_ville, source', "siren=$siren $strNic", false, MYSQL_ASSOC); - $tabRep=$rep[0]; - $rs= $tabRep['raisonSociale']; - $cp= $tabRep['adr_cp']; - $vil=$tabRep['adr_ville']; + $rep = $iDbCrm->select('jo.etablissements', + 'siren, nic, actif, siege, raisonSociale, adr_cp, adr_ville, source', + "siren=$siren $strNic", false, MYSQL_ASSOC); + $tabRep = $rep[0]; + $rs = $tabRep['raisonSociale']; + $cp = $tabRep['adr_cp']; + $vil = $tabRep['adr_ville']; $tabRdvInsee['source']=$tabRep['source']; if ($tabRep['actif']==0) $tabRdvInsee['actifInsee']=0;