Doctrine
This commit is contained in:
parent
715bc738bb
commit
33dd6ce019
@ -130,30 +130,35 @@ class Entreprise extends Scores_Ws_Server
|
||||
}
|
||||
|
||||
$codePaysIso2='FR';
|
||||
if ($entrep['Dept']>98) {
|
||||
$codePaysInsee=$entrep['codeCommune'];
|
||||
$iDb=new Metier_Util_Db();
|
||||
$tabTmp=$iDb->select('jo.tabPays j, insee.insee_tabPays i',
|
||||
'j.codPays, j.numPays, j.codPays3, j.codePaysInpi, j.libPays, i.LIBCOG, i.ACTUAL',
|
||||
"j.codePaysInsee=$codePaysInsee AND j.codePaysInsee=substring( i.COG, 3, 3 ) AND i.ACTUAL IN (1,4) AND j.numPays is NOT NULL", true, MYSQL_ASSOC);
|
||||
if (count($tabTmp)==1) {
|
||||
$codePaysIso2=$tabTmp[0]['codPays'];
|
||||
if ($entrep['Dept'] > 98) {
|
||||
$codePaysInsee = $entrep['codeCommune'];
|
||||
|
||||
$sql = "SELECT j.codPays, j.numPays, j.codPays3, j.codePaysInpi, j.libPays, i.LIBCOG, i.ACTUAL
|
||||
FROM jo.tabPays j, insee.insee_tabPays i
|
||||
WHERE j.codePaysInsee=:codePays AND j.codePaysInsee=substring(i.COG, 3, 3) AND i.ACTUAL IN (1,4) AND j.numPays is NOT NULL";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('codePays', $codePaysInsee);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount() == 1) {
|
||||
$result = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
$codePaysIso2 = $result['codPays'];
|
||||
} else {
|
||||
$codePaysIso2='';
|
||||
foreach ($tabTmp as $tabTmp2) {
|
||||
if (trim(strtoupper(strtr($tabTmp2['libPays'],
|
||||
'àáâãäåæçèéêëìíîïðñòóôõöùúûüýÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝ',
|
||||
"aaaaaaaceeeeiiiionooooouuuuyyAAAAAAACEEEEIIIIONOOOOOUUUUY")))==trim(strtoupper($tabTmp2['LIBCOG']))) {
|
||||
$codePaysIso2=$tabTmp2['codPays'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
$codePaysIso2 = '';
|
||||
while ($result = $stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
if (trim(strtoupper(strtr($result['libPays'],
|
||||
'àáâãäåæçèéêëìíîïðñòóôõöùúûüýÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝ',
|
||||
"aaaaaaaceeeeiiiionooooouuuuyyAAAAAAACEEEEIIIIONOOOOOUUUUY")))==trim(strtoupper($result['LIBCOG']))) {
|
||||
$codePaysIso2 = $result['codPays'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$autreId=$entrep['AutreId'];
|
||||
if ($params->siret>0 && $waldec<>'')
|
||||
$autreId=$waldec;
|
||||
$autreId = $entrep['AutreId'];
|
||||
if ($params->siret > 0 && $waldec != '') {
|
||||
$autreId = $waldec;
|
||||
}
|
||||
|
||||
// Source RNCS prioritaire pour les infos entreprises
|
||||
$nom=$entrep['nomLong'];
|
||||
|
Loading…
Reference in New Issue
Block a user