2009-07-20 16:17:33 +00:00
< ?
2009-03-06 16:29:16 +00:00
if ( ! $_SESSION [ 'connected' ]) die ();
2009-02-17 13:14:53 +00:00
$siret = trim ( preg_replace ( '/[^0-9]/' , '' , $_REQUEST [ 'siret' ]));
2010-02-10 17:27:03 +00:00
if ( strlen ( $siret ) <> 0 && strlen ( $siret ) <> 9 && strlen ( $siret ) <> 14 ) die ( 'Paramètres incorrects !' );
2009-02-17 13:14:53 +00:00
2010-02-10 17:27:03 +00:00
$idEntreprise = trim ( preg_replace ( '/[^0-9]/' , '' , $_REQUEST [ 'idEntreprise' ])) * 1 ; // Si id=0 alors non communiqué
if (( $siret * 1 ) == 0 && $idEntreprise == 0 ) die ( 'Paramètres incorrects !' );
2009-02-17 13:14:53 +00:00
$siren = substr ( $siret , 0 , 9 );
2009-10-15 15:09:54 +00:00
require_once 'partenaires/classMTva.php' ;
require_once 'partenaires/classMMap.php' ;
require_once 'common/dates.php' ;
require_once 'cache/cache.php' ;
require_once 'scoresws/scoresws.php' ;
2009-10-08 13:20:51 +00:00
$dirs = scoresws_dirigeants ( $siret , $siren , $idEntreprise );
2009-08-27 07:39:27 +00:00
?>
2009-08-31 15:45:35 +00:00
< div id = " center " >
< h1 > DIRIGEANTS </ h1 >
< table >
2009-08-27 07:39:27 +00:00
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Num & eacute ; ro identifiant Siren </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = substr ( $siren , 0 , 3 ) . ' ' . substr ( $siren , 3 , 3 ) . ' ' . substr ( $siren , 6 , 3 ) ?> </td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Raison Sociale </ td >
2009-10-08 13:20:51 +00:00
< td width = " 350 " class = " StyleInfoData " >< ? = $_SESSION [ 'tabInfo' ][ 'entrep' ][ 'raisonSociale' ] ?> </td>
2009-08-27 07:39:27 +00:00
</ tr >
2009-09-18 17:09:22 +00:00
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td colspan = " 2 " width = " 550 " class = " StyleInfoData " >
< ? php
require_once 'surveillance/surveillance.php' ;
2009-12-15 17:14:21 +00:00
echo getSurveillance ( 'dirigeants' , $siret );
2009-09-18 17:09:22 +00:00
?>
</ td >
</ tr >
2009-08-31 15:45:35 +00:00
</ table >
2009-08-27 07:39:27 +00:00
< ? php
2009-10-13 16:36:27 +00:00
if ( $_REQUEST [ 'vue' ] == 'histo' )
2009-08-27 07:39:27 +00:00
{
?>
2009-08-31 15:45:35 +00:00
< h2 > Historique des dirigeants </ h2 >
< table >
2009-08-27 07:39:27 +00:00
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td colspan = " 2 " width = " 550 " class = " StyleInfoData " >
< table >
2009-08-24 07:07:40 +00:00
< ? php
2009-10-08 13:20:51 +00:00
if ( count ( $dirs ) > 0 )
2009-08-24 07:07:40 +00:00
{
2009-10-08 13:20:51 +00:00
foreach ( $dirs as $i => $dir )
{
$nom = $dir [ 'Societe' ] . ' ' . $dir [ 'Nom' ] . ' ' . $dir [ 'Prenom' ];
2009-05-27 10:27:21 +00:00
?>
2009-10-08 13:20:51 +00:00
< tr >< td class = " StyleInfoData " width = " 100 " >< ? = $dir [ 'Titre' ] ?> </td>
< td class = " StyleInfoData " width = " 200 " >< ? = $nom ?> </td>
< td class = " StyleInfoData " width = " 200 " >
< ? php
if ( $dir [ 'DateFct' ] <> '' ) {
//if ($dir['Ancien']) echo 'Fonction abandonée le ';
//else echo 'Prise de fonction le ';
echo 'Modification le ' ;
echo WDate :: dateT ( 'Y-m-d' , 'd/m/Y' , $dir [ 'DateFct' ]);
}
?>
</ td >
</ tr >
< ? php
}
} else
{
2009-08-27 07:39:27 +00:00
echo '<tr><td class="StyleInfoData" width="550"> Aucune donnée n\'est présente dans notre base</td></tr>' ;
2009-10-08 13:20:51 +00:00
}
2009-08-27 07:39:27 +00:00
?>
</ table >
</ td >
</ tr >
2009-08-31 15:45:35 +00:00
</ table >
2009-08-27 07:39:27 +00:00
< ? php
} else {
?>
2009-08-31 15:45:35 +00:00
< h2 > Liste des dirigeants actifs </ h2 >
< table >
2009-08-27 07:39:27 +00:00
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td colspan = " 2 " width = " 550 " class = " StyleInfoData " >
< table >
< ? php
2009-10-08 13:20:51 +00:00
if ( count ( $dirs ) > 0 )
2009-08-27 07:39:27 +00:00
{
2009-10-08 13:20:51 +00:00
foreach ( $dirs as $i => $dir )
{
$societe = str_replace ( '&#160;' , ' ' , $dir [ 'Societe' ]);
$nom = str_replace ( '&#160;' , ' ' , $dir [ 'Societe' ] . ' ' . $dir [ 'Nom' ] . ' ' . $dir [ 'Prenom' ]);
if ( isset ( $dir [ 'Civilite' ]) && $dir [ 'Civilite' ] != '' ){ $nom = $dir [ 'Civilite' ] . '. ' . $nom ;}
?>
< tr >
2009-11-12 13:10:52 +00:00
< td class = " StyleInfoData " width = " 120 " >< ? = $dir [ 'Titre' ]; ?> </td>
2009-10-08 13:20:51 +00:00
< td class = " StyleInfoData " width = " 200 " >
2009-11-12 13:10:52 +00:00
< ? php
if ( $societe != '' )
{
?>
2010-02-10 17:27:03 +00:00
< a href = " /?page=recherche&vue=list&formR[type]=ent&formR[raisonSociale]=<?= $societe ?> " title = " Recherche à partir de la raison sociale " >
2009-11-12 13:10:52 +00:00
< ? = $societe ?>
2009-10-08 13:20:51 +00:00
</ a >
2009-08-24 07:07:40 +00:00
< ? php
2009-10-08 13:20:51 +00:00
}
2009-08-24 07:07:40 +00:00
?>
2009-10-08 13:20:51 +00:00
& nbsp ;
< ? php
2009-11-12 13:10:52 +00:00
if ( $nom != '' )
{
2009-10-08 13:20:51 +00:00
?>
2010-02-10 17:27:03 +00:00
< a href = " /?page=recherche&vue=list&formR[type]=dir&formR[dirNom]=<?= $dir['Nom'] ?>&formR[dirPrenom]=<?= $dir['Prenom'] ?>&formR[dirDateNaissJJ]=<?=substr( $dir['NaissDate'] ,0,2)?>&formR[dirDateNaissMM]=<?=substr( $dir['NaissDate'] ,3,2)?>&formR[dirDateNaissAAAA]=<?=substr( $dir['NaissDate'] ,6,4)?> " title = " Recherche à partir du nom du dirigeant " >
2009-11-12 13:10:52 +00:00
< ? = $nom ?>
2009-10-08 13:20:51 +00:00
</ a >
< ? php
}
?>
</ p >
</ td >
< td class = " StyleInfoData " width = " 230 " >< ?
if ( trim ( $dir [ 'NaissDate' ]) <> '' && trim ( $dir [ 'NaissVille' ] . ' ' . $dir [ 'NaissDepPays' ]) <> '' ) {
echo 'né(e) le ' . $dir [ 'NaissDate' ] . ' à ' . $dir [ 'NaissVille' ];
if ( trim ( $dir [ 'NaissDepPays' ]) <> '' )
echo ' (' . $dir [ 'NaissDepPays' ] . ')' ;
} elseif ( trim ( $dir [ 'NaissDate' ]) <> '' ) {
echo 'né(e) le ' . $dir [ 'NaissDate' ];
} elseif ( trim ( $dir [ 'NaissVille' ] . ' ' . $dir [ 'NaissDepPays' ]) <> '' ) {
echo 'né(e) à ' . $dir [ 'NaissVille' ];
echo ' (' . $dir [ 'NaissDepPays' ] . ')' ;
}
?>
</ td >
</ tr >
< ?
}
2009-02-17 13:14:53 +00:00
}
2009-10-08 13:20:51 +00:00
else
{
2009-08-27 07:39:27 +00:00
echo '<tr><td class="StyleInfoData" width="550"> Aucune donnée n\'est présente dans notre base</td></tr>' ;
2009-10-08 13:20:51 +00:00
}
2009-08-27 07:39:27 +00:00
?>
</ table >
</ td >
</ tr >
2009-08-31 15:45:35 +00:00
</ table >
2009-08-27 07:39:27 +00:00
< ? php
}
?>
2009-08-31 15:45:35 +00:00
</ div >
2009-08-27 07:39:27 +00:00
< ? php
2009-10-08 13:20:51 +00:00
if (( $siret * 1 ) == 0 && ( $siren * 1 ) < 100 ) { $fileName = 'dirigeants-' . $idEntreprise ;
} else { $fileName = 'dirigeants-' . $siret ; }
if ( $_REQUEST [ 'vue' ] == 'histo' ){ $fileName .= '-histo' ; }
2010-02-10 17:27:03 +00:00
//Exportation des données sous forme de fichier
2009-08-27 07:39:27 +00:00
function htmldecode ( $value ){
$value = is_array ( $value ) ? array_map ( 'htmldecode' , $value ) : html_entity_decode ( $value , ENT_QUOTES , 'UTF-8' );
return $value ;
}
$firephp -> log ( $dirs , 'Etablissements' );
$tabForExport = htmldecode ( $dirs );
if ( count ( $tabForExport ) > 0 ){
require_once 'export.php' ;
2009-07-20 16:17:33 +00:00
2009-08-27 07:39:27 +00:00
$array2csv = new ExportCSV ();
$array2csv -> records = $tabForExport ;
$array2csv -> writeCSV ( $fileName );
2009-07-20 16:17:33 +00:00
2009-08-27 07:39:27 +00:00
$array2xml = new ExportXML ();
$array2xml -> rootName = $page . 's' ;
$array2xml -> defaultTagName = $page ;
if ( $_REQUEST [ 'vue' ] == 'histo' ){
$array2xml -> rootName = 'historique' . $page . 's' ;
$array2xml -> defaultTagName = 'historique' . $page ;
2009-03-06 17:12:26 +00:00
}
2009-08-27 07:39:27 +00:00
$array2xml -> records = $tabForExport ;
$array2xml -> writeXML ( $fileName );
}
2009-02-17 13:14:53 +00:00
?>