Ajout de la méthode getDirigeantsPrin($siren, $nbDirs=2) qui retourne par défaut les 2 principaux dirigeants RNCS
This commit is contained in:
parent
9929e50f5f
commit
69d948e4d3
@ -985,5 +985,87 @@ class MRncs {
|
||||
$this->libErreur='Infogreffe indisponible !';
|
||||
return false;
|
||||
}
|
||||
|
||||
function getDirigeantsPrin($siren, $nbDirs=2) {
|
||||
$siren=$siren*1;
|
||||
$tabRet=array();
|
||||
$dirs=$this->iDb->select(
|
||||
'rncs_dirigeants',
|
||||
'siren, raisonSociale, dirRS, civilite, nom, prenom, naissance_nom, naissance_date, naissance_lieu, fonction_code, fonction_lib, cinf, dateFin, flux, dateInsert',
|
||||
"siren=$siren AND actif%10=1 ORDER BY fonction_code DESC", true, MYSQL_ASSOC);
|
||||
$numDir=0;
|
||||
foreach ($dirs as $k=>$dir) {
|
||||
$numDir++;
|
||||
if ($dir['naissance_date']<>'0000-00-00')
|
||||
$dateNaiss=Wdate::dateT('Y-m-d','d/m/Y', $dir['naissance_date']);
|
||||
else
|
||||
$dateNaiss='';
|
||||
if ($dir['flux']<>'0000-00-00')
|
||||
$dateModif=Wdate::dateT('Y-m-d','d/m/Y', $dir['flux']);
|
||||
else
|
||||
$dateModif=Wdate::dateT('Y-m-d','d/m/Y', $dir['dateInsert']);
|
||||
$nom=trim($dir['nom']);
|
||||
$nomUsage='';
|
||||
if (trim($dir['naissance_nom'])<>'') {
|
||||
$nom=trim($dir['naissance_nom']);
|
||||
$nomUsage=trim($dir['nom']);
|
||||
}
|
||||
$tabRet[]=array( 'Fonction' =>$dir['fonction_code'],
|
||||
'Titre' =>$dir['fonction_lib'],
|
||||
'Societe' =>$dir['dirRS'],
|
||||
'Civilite' =>$dir['civilite'],
|
||||
'Nom' =>$nom,
|
||||
'Prenom' =>$dir['prenom'],
|
||||
'NomUsage' =>$nomUsage,
|
||||
'NaissDate' =>$dateNaiss,
|
||||
'NaissVille' =>$dir['naissance_lieu'],
|
||||
'NaissDepPays' =>'', // 25
|
||||
'Ancien' =>0,
|
||||
'DateFct' =>$dateModif,
|
||||
'Cinf' =>$dir['cinf'],
|
||||
);
|
||||
if ($numDir>=$nbDirs) break;
|
||||
}
|
||||
if ($numDir==0) {
|
||||
$dirs=$this->iDb->select(
|
||||
'rncs_entrep',
|
||||
"siren, raisonSociale, '' AS dirRS, IF(sexe='M', 'M', IF(sexe='F', 'MME', '')) AS civilite, nom, prenom, nomUsage AS naissance_nom, dateNaiss AS naissance_date, lieuNaiss AS naissance_lieu, 1050 AS fonction_code, 'Personne Physique' AS fonction_lib, 0 AS cinf, dateFer AS dateFin, flux, dateInsert",
|
||||
"siren=$siren", true, MYSQL_ASSOC);
|
||||
$numDir=0;
|
||||
foreach ($dirs as $k=>$dir) {
|
||||
$numDir++;
|
||||
if ($dir['naissance_date']<>'0000-00-00')
|
||||
$dateNaiss=Wdate::dateT('Y-m-d','d/m/Y', $dir['naissance_date']);
|
||||
else
|
||||
$dateNaiss='';
|
||||
if ($dir['flux']<>'0000-00-00')
|
||||
$dateModif=Wdate::dateT('Y-m-d','d/m/Y', $dir['flux']);
|
||||
else
|
||||
$dateModif=Wdate::dateT('Y-m-d','d/m/Y', $dir['dateInsert']);
|
||||
$nom=trim($dir['nom']);
|
||||
$nomUsage='';
|
||||
if (trim($dir['naissance_nom'])<>'') {
|
||||
$nom=trim($dir['naissance_nom']);
|
||||
$nomUsage=trim($dir['nom']);
|
||||
}
|
||||
$tabRet[]=array( 'Fonction' =>$dir['fonction_code'],
|
||||
'Titre' =>$dir['fonction_lib'],
|
||||
'Societe' =>$dir['dirRS'],
|
||||
'Civilite' =>$dir['civilite'],
|
||||
'Nom' =>$nom,
|
||||
'Prenom' =>$dir['prenom'],
|
||||
'NomUsage' =>$nomUsage,
|
||||
'NaissDate' =>$dateNaiss,
|
||||
'NaissVille' =>$dir['naissance_lieu'],
|
||||
'NaissDepPays' =>'', // 25
|
||||
'Ancien' =>0,
|
||||
'DateFct' =>$dateModif,
|
||||
'Cinf' =>$dir['cinf'],
|
||||
);
|
||||
}
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue
Block a user