This commit is contained in:
Michael RICOIS 2013-01-29 14:52:40 +00:00
parent 1f94f5de48
commit c019b9a8dd

View File

@ -179,7 +179,10 @@ $tabDico = array(
'nationalite' => 'nationalite', 'nationalite' => 'nationalite',
'pays' => 'pays', 'pays' => 'pays',
'nafEnRncs' => 'naf AS nafEnRncs', 'nafEnRncs' => 'naf AS nafEnRncs',
'cjRncs' => 'cj AS cjRncs', 'cjRncs' => array(
'sql' => 'cj AS cjRncs',
'table' => 'SELECT * FROM jo.tabFJur',
),
'dateImma' => 'dateImma', 'dateImma' => 'dateImma',
'dateRad' => 'dateRad', 'dateRad' => 'dateRad',
'capitalType' => 'capitalType', 'capitalType' => 'capitalType',
@ -442,8 +445,7 @@ foreach($tabExtract as $key)
} else { } else {
$stmt = $dbMetier->query($elementsup['table']); $stmt = $dbMetier->query($elementsup['table']);
$result = $stmt->fetchAll(); ${'tab'.ucfirst($key)} = $stmt->fetchAll();
${'tab'.ucfirst($key)} = $result;
} }
if( array_key_exists('sql', $select['cle'][$key]) && $select['cle'][$key]['sql']!='' ) { if( array_key_exists('sql', $select['cle'][$key]) && $select['cle'][$key]['sql']!='' ) {
@ -671,25 +673,24 @@ foreach($tabIdentifiant as $item)
} }
} }
} }
}
//Traitement des libellés génériques //Traitement des libellés génériques
foreach($select as $item) foreach($select as $item)
{ {
if ( in_array($item.'Lib', $tabEntete) && isset(${'tab'.ucfirst($item)}) ) if ( in_array($item.'Lib', $tabEntete) && isset(${'tab'.ucfirst($item)}) )
{ {
$retour = 'Non trouvé'; $retour = 'Non trouvé';
$codeFromData = $tabData[$row][$item]; $codeFromData = $tabData[$row][$item];
foreach( ${'tab'.ucfirst($item)} as $code => $label ) { foreach( ${'tab'.ucfirst($item)} as $code => $label ) {
if ( $codeFromData == $code ) { if ( $codeFromData == $code ) {
$retour = $label; $retour = $label;
break; break;
} }
} }
$tabData[$row] = $tabData[$row] + $retour; $tabData[$row] = $tabData[$row] + $retour;
} }
}
} }
} }
//Enregistrement clés de doublon pour rappel //Enregistrement clés de doublon pour rappel
@ -823,6 +824,10 @@ function situationJuridiqueData($siren, $nic, $values = false)
$tabData['situationDernEven']=''; $tabData['situationDernEven']='';
} }
if (empty($tabData['situationJuridique'])) {
$tabData['situationJuridique'] = 'NC';
}
return $tabData; return $tabData;
} }