Annonce TXT

This commit is contained in:
Michael RICOIS 2014-03-13 13:21:26 +00:00
parent e06d7570a2
commit 4669f48118

View File

@ -259,6 +259,7 @@ $tabDico = array(
'multiple' => array(
'actionnaires',
'participations',
'annoncetxt',
),
);
@ -431,7 +432,7 @@ require_once 'Scores/Enrichissement.php';
$dico = new Enrichissement();
//Liste des champs SQL
foreach($tabExtract as $key)
foreach($tabExtract as $i => $key)
{
$strKey = false;
@ -504,9 +505,12 @@ foreach($tabExtract as $key)
break;
}
if ( $element == 'data' && in_array($key, $select) )
if ( in_array($element, array('data', 'multiple')) && in_array($key, $select) )
{
${$key.'Data'} = $values;
if ( $values ) {
$tabExtract[$i] = $key;
}
}
}
}
@ -713,6 +717,7 @@ foreach($tabIdentifiant as $item)
//Retour lignes multiples
elseif ( $element == 'multiple' )
{
$values = false;
$isSelected = false;
foreach($select as $selectItem){
if ( in_array($selectItem, $tabExtract) ) {
@ -722,7 +727,10 @@ foreach($tabIdentifiant as $item)
}
$retour = array();
if ( $isSelected && function_exists($selectItem.'Multiple') ) {
$retour = call_user_func($selectItem.'Multiple', $siren, $nicV);
if( ${$selectItem.'Data'}!=false ){
$values = ${$selectItem.'Data'};
}
$retour = call_user_func($selectItem.'Multiple', $siren, $nicV, $values);
}
if (count($retour)>0) {
$originalLine = $tabNewData[$extendNbRow];
@ -1782,6 +1790,39 @@ function participationsMultiple($siren, $nic)
return $tabData;
}
function annoncetxtEntete()
{
return array(
'AnnonceLib',
'AnnonceDate',
'AnnonceDateParution',
'AnnonceTxt',
);
}
function annoncetxtMultiple($siren, $nic, $values = false)
{
$tabData = array();
if ( $values!==false ) {
$tabTmp = explode(',', $values);
$iInsee = new MInsee();
$response = $iInsee->getAnnoncesLegales($siren, 0, $tabTmp, false, true);
foreach ($response as $tabAnn){
foreach ($tabAnn['evenements'] as $codEve) {
$dateEven = $tabAnn['dateJugement'];
if ($dateEven=='0000-00-00') $dateEven=$tabAnn['dateEffet'];
if ($dateEven=='0000-00-00') $dateEven=$tabAnn['DateParution'];
$formatElement['AnnonceLib'] = strtr($codEve['LibEven'],array(','=>' ',"'"=>' ','"'=>' ',';'=>' '));
$formatElement['AnnonceDate'] = $dateEven;
$formatElement['AnnonceDateParution'] = $tabAnn['DateParution'];
$formatElement['AnnonceTxt'] = $tabAnn['texteAnnonce'];
$tabData[] = $formatElement;
}
}
}
return $tabData;
}
/* == FUNCTION == */