2009-02-19 16:28:12 +00:00
< ? if ( ! $_SESSION [ 'connected' ]) die ();
2009-03-04 16:46:29 +00:00
require_once ( realpath ( dirname ( __FILE__ ) . '/../../includes/' ) . '/utils.php' );
require_once ( FWK_PATH . '/common/dates.php' );
2009-03-05 16:19:38 +00:00
require_once ( realpath ( dirname ( __FILE__ ) . '/../../includes/' ) . '/cache.php' );
2009-02-19 16:28:12 +00:00
$siret = trim ( preg_replace ( '/[^0-9]/' , '' , $_REQUEST [ 'siret' ]));
if ( strlen ( $siret ) <> 0 && strlen ( $siret ) <> 9 && strlen ( $siret ) <> 14 ) die ( 'Param<61> tres incorrects !' );
2009-03-11 07:51:18 +00:00
$idEntreprise = trim ( preg_replace ( '/[^0-9]/' , '' , $_REQUEST [ 'idEntreprise' ])) * 1 ; // Si id=0 alors non communiqu<71>
if (( $siret * 1 ) == 0 && $idEntreprise == 0 ) die ( 'Param<61> tres incorrects !' );
2009-02-19 16:28:12 +00:00
$siren = substr ( $siret , 0 , 9 );
2009-03-10 15:07:24 +00:00
/*
* Limiter les appels au webservice / Mais n<EFBFBD> cessaire en session
* Supprimer la variable <EFBFBD> chaque affichage de recherche
*/
$firephp -> log ( 'getIdentite' , 'Appel WEBSERVICE' );
try {
2009-03-11 07:51:18 +00:00
$O = $client -> getIdentite ( $siret , $idEntreprise );
2009-03-10 15:07:24 +00:00
$etab = $O [ 'result' ];
$firephp -> log ( $etab , 'etab' );
$tabEntrep = array ();
$tabEntrep [ 'raisonSociale' ] = $etab [ 'Nom' ];
$tabEntrep [ 'siren' ] = $etab [ 'Siren' ];
$tabEntrep [ 'siret' ] = $etab [ 'Siret' ];
$tabEntrep [ 'tva' ] = $etab [ 'TvaNumero' ];
$tabEntrep [ 'isin' ] = $etab [ 'Isin' ];
$tabEntrep [ 'AutreId' ] = $etab [ 'AutreId' ];
$tabEntrep [ 'active' ] = $etab [ 'Statut' ];
$tabEntrep [ 'Source' ] = $etab [ 'Source' ];
$tabEntrep [ 'SourceId' ] = $etab [ 'SourceId' ];
2009-03-11 08:47:54 +00:00
$tabEntrep [ 'codeCommune' ] = $etab [ 'Dept' ] . $etab [ 'codeCommune' ]; //Utilise pour les comp<6D> tences territoriales
2009-03-10 15:07:24 +00:00
$tabEntrep [ 'nafEn' ] = $etab [ 'NafEnt' ];
2009-04-08 14:19:46 +00:00
$tabEntrep [ 'nafEnLib' ] = $etab [ 'NafEntLib' ];
2009-03-10 15:07:24 +00:00
$tabEntrep [ 'nafEt' ] = $etab [ 'NafEtab' ];
2009-04-08 14:19:46 +00:00
$tabEntrep [ 'nafEtLib' ] = $etab [ 'NafEtabLib' ];
2009-03-10 15:07:24 +00:00
$tabEntrep [ 'fj' ] = $etab [ 'FJ' ];
$_SESSION [ 'tabInfo' ][ 'entrep' ] = $tabEntrep ;
} catch ( SoapFault $fault ) {
include_once ( realpath ( dirname ( __FILE__ ) . '/../../' ) . '/includes/soaperror.php' );
processSoapFault ( $client , $fault , $tabInfo );
die ();
}
2009-03-05 16:19:38 +00:00
//G<> n<EFBFBD> rer un nom de fichier pour le cache et l'export des fichiers
2009-03-10 15:07:24 +00:00
if (( $siret * 1 ) == 0 || ( $siren * 1 ) < 100 ){
2009-03-05 16:19:38 +00:00
$fileName = $page2 . '-' . $idEntreprise ;
} else {
2009-03-10 15:07:24 +00:00
$fileName = $page2 . '-' . $siret ;
2009-03-05 16:19:38 +00:00
}
2009-03-10 15:07:24 +00:00
2009-03-05 16:19:38 +00:00
//Mise en Cache
2009-03-04 16:46:29 +00:00
$cache = new Cache ();
2009-03-10 09:13:05 +00:00
//Forcer la cr<63> ation de la page dans le cache lorsque l'utilisateur a le mode saisie
2009-03-11 18:31:26 +00:00
$firephp -> log ( $_SESSION , 'SESSION' );
if ( preg_match ( '/saisie/i' , $_SESSION [ 'tabInfo' ][ 'droits' ]) || $_SESSION [ 'tabInfo' ][ 'mode_edition' ] == 1 ) {
2009-03-10 09:13:05 +00:00
$cache -> disable = TRUE ;
$cache -> forceStart = TRUE ;
}
if ( $cache -> startCapture ( $fileName . '.html' ) == FALSE ){
2009-03-05 08:31:21 +00:00
print $cache -> displayCache ();
2009-03-04 16:46:29 +00:00
} else {
?>
< table width = " 580 " border = " 0 " align = " left " bgcolor = " #FFFFFF " >
< tr >
< td colspan = " 3 " >< img src = " ./img/rub_identite<?if ( $etab['Siege'] ==0) echo '_etab';?>.png " width = " 577 " height = " 36 " ></ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Num & eacute ; ro identifiant Siret </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = substr ( $etab [ 'Siren' ], 0 , 3 ) . ' ' . substr ( $etab [ 'Siren' ], 3 , 3 ) . ' ' . substr ( $etab [ 'Siren' ], 6 , 3 ) . ' <i>' . substr ( $etab [ 'Siret' ], 9 , 5 ) ?> </i></td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Num & eacute ; ro identifiant Siret du si & egrave ; ge </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = substr ( $etab [ 'SiretSiege' ], 0 , 3 ) . ' ' . substr ( $etab [ 'SiretSiege' ], 3 , 3 ) . ' ' . substr ( $etab [ 'SiretSiege' ], 6 , 3 ) . ' <i>' . substr ( $etab [ 'SiretSiege' ], 9 , 5 ) ?> </i></td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Num & eacute ; ro de TVA Intracom .</ td >
< td width = " 350 " class = " StyleInfoData " valign = " middle " >< ? if ( $etab [ 'Dept' ] * 1 == 97 ) {
echo '<a href="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:31991L0680:FR:HTML" target="_blank">Non attribué dans les D.O.M.</a>' ;
} else {
echo substr ( $etab [ 'TvaNumero' ], 0 , 2 ) . ' ' . substr ( $etab [ 'TvaNumero' ], 2 , 2 ) . ' ' . substr ( $etab [ 'TvaNumero' ], - 9 );
if ( ! $etab [ 'TvaAttribue' ])
2009-03-10 10:00:44 +00:00
echo ' <img src="./img/exclamation.png" title="Non valid<69> . Obligatoire sur factures, d<> clarations d\'<27> change de biens et de TVA !">' ;
2009-03-04 16:46:29 +00:00
} ?> </td>
</ tr >
2009-03-12 17:34:04 +00:00
< ? php
2009-03-04 16:46:29 +00:00
/**
** On recherche un logo
**/
$urlImg = '' ;
$siteWeb = '' ;
2009-02-19 16:28:12 +00:00
2009-03-04 16:46:29 +00:00
$locImg = PATH_LOGOS . $etab [ 'Siren' ];
2009-03-10 10:00:44 +00:00
if ( file_exists ( $locImg . '.gif' )) { $urlImg = './img/logos/' . $etab [ 'Siren' ] . '.gif' ; $ext = '.gif' ; }
elseif ( file_exists ( $locImg . '.png' )) { $urlImg = './img/logos/' . $etab [ 'Siren' ] . '.png' ; $ext = '.png' ; }
elseif ( file_exists ( $locImg . '.jpg' )) { $urlImg = './img/logos/' . $etab [ 'Siren' ] . '.jpg' ; $ext = '.jpg' ; }
elseif ( file_exists ( $locImg . '.jpeg' )) { $urlImg = './img/logos/' . $etab [ 'Siren' ] . '.jpeg' ; $ext = '.jpeg' ; }
2009-03-04 16:46:29 +00:00
if ( $urlImg == '' && $etab [ 'Isin' ] <> '' ) {
$locImg = PATH_LOGOS . $etab [ 'Isin' ];
2009-03-10 10:00:44 +00:00
if ( file_exists ( $locImg . '.gif' )) { $urlImg = './img/logos/' . $etab [ 'Isin' ] . '.gif' ; $ext = '.gif' ; }
elseif ( file_exists ( $locImg . '.png' )) { $urlImg = './img/logos/' . $etab [ 'Isin' ] . '.png' ; $ext = '.png' ; }
elseif ( file_exists ( $locImg . '.jpg' )) { $urlImg = './img/logos/' . $etab [ 'Isin' ] . '.jpg' ; $ext = '.jpg' ; }
elseif ( file_exists ( $locImg . '.jpeg' )) { $urlImg = './img/logos/' . $etab [ 'Isin' ] . '.jpeg' ; $ext = '.jpeg' ; }
2009-02-19 16:28:12 +00:00
}
2009-03-04 16:46:29 +00:00
if ( trim ( $etab [ 'Web' ]) <> '' ) {
if ( substr ( $etab [ 'Web' ], 0 , 7 ) <> 'http://' )
$siteWeb = 'http://' . $etab [ 'Web' ];
else
$siteWeb = $etab [ 'Web' ];
if ( $urlImg == '' && ( $_SESSION [ 'tabInfo' ][ 'login' ] == 'ylenaour' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'mpurcarin' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'mcochet' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'aegasse' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'jmartory' ) )
$urlImg = getLogo ( $siteWeb , $etab [ 'Siren' ]);
2009-02-19 16:28:12 +00:00
}
2009-03-04 16:46:29 +00:00
if ( $etab [ 'Isin' ] <> '' ) {
$bourse = $etab [ 'Bourse' ];
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Code ISIN </ td >
< td width = " 350 " class = " StyleInfoData " >< a href = " ./?page=bourse&siret=<?= $etab['Siret'] ?> " title = " Voir les informations boursiéres " >< ? = $etab [ 'Isin' ] ?> </a></td>
</ tr >
< ?
if ( $bourse [ 'capitalisation' ] <> 0 ) {
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Capitalisation </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = number_format ( $bourse [ 'capitalisation' ], 0 , '' , ' ' ) ?> € au <?=WDate::dateT('Y-m-d','d/m/Y',$bourse['derCoursDate'])?></td>
</ tr >
< ?
}
}
2009-03-12 17:34:04 +00:00
//Ne pas afficher le logo si il n'existe pas OU si le siren est <20> 0 OU si le siren est inf<6E> rieur a 100
if (( $siren * 1 != 0 ) || ( $siren * 1 > 100 )){
if ( $urlImg <> '' ) {
$tabTmp =@ getimagesize ( $locImg . $ext );
$w = $tabTmp [ 0 ];
$h = $tabTmp [ 1 ];
if ( $w > 350 ) $strSize =@ redimage ( $locImg . $ext , 350 , 150 );
else $strSize = '' ;
2009-03-04 16:46:29 +00:00
?>
2009-03-12 17:34:04 +00:00
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Logo </ td >
< td width = " 350 " class = " StyleInfoData " >< img src = " <?= $urlImg ?> " < ? = $strSize ?> /></td>
</ tr >
< ?
}
}
2009-03-04 16:46:29 +00:00
if ( $etab [ 'AutreId' ] <> '' ) {
$libTrib = '' ; ?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
2009-03-12 17:34:04 +00:00
< td width = " 200 " class = " StyleInfoLib " >
< ? if ( substr ( $etab [ 'AutreId' ], 0 , 1 ) == 'W' )
echo 'Identifiant Association WALDEC' ;
elseif ( preg_match ( '/(A|B|C|D)/i' , $etab [ 'AutreId' ])) {
echo 'Numéro R.C.' ;
$libTrib = ' RCS ' . preg_replace ( '/(^TC |^TI |^TGIcc )/i' , '' , $etab [ 'TribunalLib' ]);
}
?>
</ td >
2009-03-04 16:46:29 +00:00
< td width = " 350 " class = " StyleInfoData " >< ? = $etab [ 'AutreId' ] . $libTrib ?> </td>
</ tr >
< ? } ?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Etablissement actif < ?
2009-03-11 07:51:18 +00:00
if ( $etab [ 'Siege' ] == 0 ) echo '<br/><a title="Voir la fiche d\'identit<69> du si<73> ge de l\'entreprise" href="/?page=identite&siret=' . $etab [ 'Siren' ] . '&idEntreprise=' . $idEntreprise . '">Accès <20> la fiche du siège</a>' ; ?>
2009-03-04 16:46:29 +00:00
</ td >
< td width = " 350 " class = " StyleInfoData " >< ?
if ( $etab [ 'Actif' ] == 1 )
echo 'Oui' ;
else {
echo '<b>NON</b>' ;
$dateCloture = str_replace ( '-' , '' , $etab [ 'DateClotEn' ]);
if ( $etab [ 'DateClotEn' ] <> '' ) echo " <i> (Fin d'activit<69> enregistr<74> e en " . WDate :: dateT ( 'Ymd' , 'm/Y' , $dateCloture ) . ')</i>' ;
}
if ( $etab [ 'Siren' ] * 1 <> 0 /* && $_SESSION['tabInfo']['login']=='ylenaour'*/ )
echo ' <a title="Voir l\'avis de situation correspondant de l\'INSEE" target="_blank" href="/?page=avis&siret=' . $siret . '">(Situation au répertoire SIRENE)</a>' ;
?> </td>
</ tr >
< ?
if ( $etab [ 'SituationJuridique' ] == 'P' ) {
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Situation juridique </ td >
< td width = " 350 " class = " StyleInfoData " >< ?
if ( $etab [ 'SituationJuridique' ] == 'P' )
2009-03-11 08:47:54 +00:00
echo '<a href="./?page=annonces&siret=' . $etab [ 'Siret' ] . '&idEntreprise=' . $idEntreprise . '"><font color="red"><b>En procédure collective</b></font></a>' ;
2009-03-04 16:46:29 +00:00
2009-03-10 08:14:21 +00:00
if ( $_SESSION [ 'tabInfo' ][ 'mode_edition' ] == 1 &&
(
$_SESSION [ 'tabInfo' ][ 'login' ] == 'ylenaour' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'jmartory' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'mheitz' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'mcochet' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'mpurcarin' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'aegasse'
) || $_SESSION [ 'tabInfo' ][ 'login' ] == 'mricois'
)
2009-03-11 07:51:18 +00:00
echo ' <a href="./?page=saisie&siret=' . $etab [ 'Siret' ] . '&idEntreprise=' . $idEntreprise . '">(Edition)</a>' ;
2009-03-04 16:46:29 +00:00
// elseif ($etab['SituationJuridique']=='R') echo '<a href="./?page=annonces&siret='.$etab['Siret'].'">Radiée</a>';
// elseif ($etab['SituationJuridique']=='A') echo '<a href="./?page=annonces&siret='.$etab['Siret'].'">Absorbée</a>';
// else echo ' ';
?> </td>
</ tr >
2009-03-10 08:14:21 +00:00
< ? } elseif ( $_SESSION [ 'tabInfo' ][ 'mode_edition' ] == 1 &&
(
$_SESSION [ 'tabInfo' ][ 'login' ] == 'ylenaour' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'jmartory' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'mheitz' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'mpurcarin' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'mcochet' ||
$_SESSION [ 'tabInfo' ][ 'login' ] == 'aegasse'
) || $_SESSION [ 'tabInfo' ][ 'login' ] == 'mricois'
) {
?>
2009-03-04 16:46:29 +00:00
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Situation juridique </ td >
2009-03-11 07:51:18 +00:00
< td width = " 350 " class = " StyleInfoData " >< a href = " ./?page=saisie&siret=<?= $etab['Siret'] ?>&idEntreprise=<?= $idEntreprise ?> " > N<EFBFBD> ant </ a ></ td >
2009-03-04 16:46:29 +00:00
</ tr >
< ?
}
?>
< tr >
< td colspan = " 3 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 3 " >< img src = " ./img/srub_id.png " width = " 576 " height = " 27 " ></ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Raison Sociale </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $etab [ 'Nom' ];
if ( $etab [ 'Nom2' ] <> '' ) echo '<br/>' . $etab [ 'Nom2' ]; ?> </td>
</ tr >
< ?
if ( $etab [ 'Enseigne' ] <> '' && $etab [ 'Sigle' ] <> '' ) { $titre = 'Enseigne / Sigle' ; $lib = $etab [ 'Enseigne' ] . ' / ' . $etab [ 'Sigle' ]; }
elseif ( $etab [ 'Enseigne' ] <> '' && $etab [ 'Sigle' ] == '' ) { $titre = 'Enseigne' ; $lib = $etab [ 'Enseigne' ]; }
elseif ( $etab [ 'Enseigne' ] == '' && $etab [ 'Sigle' ] <> '' ) { $titre = 'Sigle' ; $lib = $etab [ 'Sigle' ]; }
else $titre = '' ;
if ( $titre <> '' ) {
?> <tr>
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " >< ? = $titre ?> </td>
< td width = " 350 " class = " StyleInfoData " >< ? = $lib ?> </td>
</ tr >< ? } ?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Forme juridique </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $etab [ 'FJ' ] . ' : ' . strWsToHtml ( $etab [ 'FJ_lib' ]); ?> </td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Date de cr & eacute ; ation de l ' entreprise </ td >
< td width = " 350 " class = " StyleInfoData " >< ? $dateCreationEn = str_replace ( '-' , '' , $etab [ 'DateCreaEn' ]);
if ( substr ( $dateCreationEn , - 2 ) * 1 == 0 )
echo WDate :: dateT ( 'Ymd' , 'm/Y' , $dateCreationEn );
else
echo WDate :: dateT ( 'Ymd' , 'd/m/Y' , $dateCreationEn ); ?> </td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Date de cr & eacute ; ation de l ' & eacute ; tablissement </ td >
< td width = " 350 " class = " StyleInfoData " >< ? $dateCreationEt = str_replace ( '-' , '' , $etab [ 'DateCreaEt' ]);
if ( $dateCreationEt * 1 <> 0 ) {
if ( substr ( $dateCreationEt , - 2 ) * 1 == 0 )
echo WDate :: dateT ( 'Ymd' , 'm/Y' , $dateCreationEt );
else
echo WDate :: dateT ( 'Ymd' , 'd/m/Y' , $dateCreationEt );
} else echo 'N/C' ; ?> </td>
2009-02-19 16:28:12 +00:00
2009-03-04 16:46:29 +00:00
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Adresse </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $etab [ 'Adresse' ] ?> <br/>
< ? if ( preg_match ( '/CHEZ SOFRADOM/i' , $etab [ 'Adresse2' ]))
2009-03-11 08:47:54 +00:00
$etab [ 'Adresse2' ] = '<a title="Voir la fiche d\'identit<69> du domiciliataire de cette entreprise" href="/?page=identite&siret=42495045900018&idEntreprise=6720043">CHEZ SOFRADOM</a>' ;
//http://extranet.devlocal.com/?page=identite&siret=42495045900018&idEntreprise=6720043
2009-03-04 16:46:29 +00:00
if ( $etab [ 'Adresse2' ] <> '' ) echo $etab [ 'Adresse2' ] . '<br/>' ; ?>
< ? $cp = $etab [ 'CP' ] * 1 ;
if ( $cp <> 0 ) echo $etab [ 'CP' ] . ' ' ; ?> <?=strWsToHtml($etab['Ville'])?>
< ? if ( $etab [ 'Pays' ] <> '' && strtoupper ( substr ( $etab [ 'Pays' ], 0 , 3 )) <> 'FRA' ) echo '<br/>' . strWsToHtml ( $etab [ 'Pays' ]); ?>
2009-02-19 16:28:12 +00:00
</ td >
2009-03-04 16:46:29 +00:00
</ tr >
< ? // if (@$etab['GeoInfos']['ZUS']<>'NON' || @$etab['GeoInfos']['ZFU']<>'NON' || @$etab['GeoInfos']['ZRU']<>'NON' || @$etab['GeoInfos']['CUCS']<>'NON') {/* && trim(@$etab['GeoInfos']['NCUCS'])<>'')) {*/
if ( @ $etab [ 'GeoInfos' ][ 'ZUS' ] == 'OUI' || @ $etab [ 'GeoInfos' ][ 'ZFU' ] == 'OUI' || @ $etab [ 'GeoInfos' ][ 'ZRU' ] == 'OUI' || @ $etab [ 'GeoInfos' ][ 'CUCS' ] == 'OUI' ) {
/* [ GeoInfos ] => Array
(
[ ZUS ] => OUI
[ NZUS ] => 1127020
[ ZFU ] => OUI
[ NZFU ] => 11270 ZF
[ CUCS ] => OUI
[ NCUCS ] => 1127020
)
*/
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Zones prioritaires </ td >
< td width = " 350 " class = " StyleInfoData " >< ?
if ( $etab [ 'GeoInfos' ][ 'ZUS' ] == 'OUI' ) echo '<a href="http://sig.ville.gouv.fr/Territoire/' . $etab [ 'GeoInfos' ][ 'NZUS' ] . '" target="_blank">ZUS n<> ' . $etab [ 'GeoInfos' ][ 'NZUS' ] . '</a><br/>' ;
// elseif ($etab['GeoInfos']['ZUS']=='NSP') echo 'Implantation en ZUS à vérifier<br/>';
if ( $etab [ 'GeoInfos' ][ 'ZFU' ] == 'OUI' ) echo '<a href="http://sig.ville.gouv.fr/Territoire/' . $etab [ 'GeoInfos' ][ 'NZFU' ] . '" target="_blank">ZFU n<> ' . $etab [ 'GeoInfos' ][ 'NZFU' ] . '</a><br/>' ;
// elseif ($etab['GeoInfos']['ZFU']=='NSP') echo 'Implantation en ZFU à vérifier<br/>';
if ( $etab [ 'GeoInfos' ][ 'ZRU' ] == 'OUI' ) echo '<a href="http://sig.ville.gouv.fr/Territoire/' . $etab [ 'GeoInfos' ][ 'NZRU' ] . '" target="_blank">ZRU n<> ' . $etab [ 'GeoInfos' ][ 'NZRU' ] . '</a><br/>' ;
// elseif ($etab['GeoInfos']['ZRU']=='NSP') echo 'Implantation en ZRU à vérifier<br/>';
if ( $etab [ 'GeoInfos' ][ 'CUCS' ] == 'OUI' ) echo '<a href="http://sig.ville.gouv.fr/Territoire/' . $etab [ 'GeoInfos' ][ 'NCUCS' ] . '" target="_blank">CUCS n<> ' . $etab [ 'GeoInfos' ][ 'NCUCS' ];
// elseif ($etab['GeoInfos']['CUCS']=='NSP') echo 'Implantation en CUCS à vérifier';
?> </td>
</ tr >
< ? } ?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > T & eacute ; l & eacute ; phone </ td >
< td width = " 350 " class = " StyleInfoData " >< ? if ( trim ( $etab [ 'Tel' ]) == '' ) echo 'N/C' ;
else echo $etab [ 'Tel' ];
if ( $etab [ 'Enseigne' ] <> '' ) $libNom = urlencode ( $etab [ 'Enseigne' ]);
else $libNom = urlencode ( $etab [ 'Nom' ]);
$adresse = $etab [ 'Adresse' ];
$i_adr = 0 ;
while ( substr ( $adresse , 0 , 1 ) == '0' ) {
$i_adr ++ ;
$adresse = substr ( $adresse , 1 , strlen ( $adresse ) - 1 );
if ( $i_adr > 4 ) break ;
}
?> <a title="Rechercher le numéro de téléphone dans l'annuaire" target="_blank" href="http://local.search.ke.voila.fr/S/searchproxi?act=&nom=<?=$libNom?>&adr=<?=urlencode(utf8_decode($adresse))?>&loc=<?=urlencode(utf8_decode($etab['CP'].' '.$etab['Ville']))?>&x=0&y=0&bhv=searchproxi&profil=enville&guidelocid=&guideregid=&guidedepid=&actid=&ke=&locid=">(Recherche annuaire)</a></td>
</ tr >
< ? if ( $etab [ 'Fax' ] * 1 > 0 ) { ?>
2009-02-19 16:28:12 +00:00
< tr >
< td width = " 30 " >& nbsp ; </ td >
2009-03-04 16:46:29 +00:00
< td width = " 200 " class = " StyleInfoLib " > Fax </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $etab [ 'Fax' ] ?> </td>
</ tr >
2009-02-19 16:28:12 +00:00
< ? }
2009-03-04 16:46:29 +00:00
if ( $siteWeb <> '' ) { ?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Site Internet </ td >
< td width = " 350 " class = " StyleInfoData " >< a href = " <?= $siteWeb ?> " target = " _blank " >< ? = $siteWeb ?> </a></td>
</ tr >
< ? }
if ( trim ( $etab [ 'Mail' ]) <> '' ) { ?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Courriel </ td >
< td width = " 350 " class = " StyleInfoData " >< a href = " mailto:<?= $etab['Mail'] ;?> " target = " _blank " >< ? = $etab [ 'Mail' ] ?> </a></td>
</ tr >
< ? } ?>
< tr >
< td colspan = " 3 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 3 " >< img src = " ./img/srub_activite.png " width = " 576 " height = " 27 " ></ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Activit & eacute ; de l ' entreprise </ td >
< td width = " 350 " class = " StyleInfoData " >< ?
if ( $etab [ 'Activite' ] <> '' && ! preg_match ( '/non pr(e|<7C> )cis(e|<7C> )/i' , utf8_decode ( $etab [ 'Activite' ]))) {
$texte = preg_replace_callback ( " /((?:[0-9] { 9,9})|(?:[0-9] { 3,3} [0-9] { 3,3} [0-9] { 3,3})|(?:[0-9] { 3,3} \ .[0-9] { 3,3} \ .[0-9] { 3,3})|(?:[0-9] { 3,3}-[0-9] { 3,3}-[0-9] { 3,3}))/ " , replace_siren , strWsToHtml ( $etab [ 'Activite' ]));
echo $texte . ' (' . $etab [ 'NafEnt' ] . ' : ' . strWsToHtml ( $etab [ 'NafEntLib' ]) . ')' ;
} else
echo $etab [ 'NafEnt' ] . ' : ' . strWsToHtml ( $etab [ 'NafEntLib' ]);
?> </td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Activit & eacute ; de l ' & eacute ; tablissement </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $etab [ 'NafEtab' ] . ' : ' . strWsToHtml ( $etab [ 'NafEtabLib' ]); ?> </td>
</ tr >
< ? php
if ( preg_match ( '/NAF4/i' , $_SESSION [ 'tabInfo' ][ 'pref' ]) && trim ( @ $etab [ 'Naf4Ent' ]) <> '' ) {
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Anciens codes NAF </ td >
< td width = " 350 " class = " StyleInfoData " >< b > Entr . :& nbsp ; & nbsp ; </ b >< ? = $etab [ 'Naf4Ent' ] . ' - ' . strWsToHtml ( $etab [ 'Naf4EntLib' ]); ?> <br/><b>Étab. :</b> <?=$etab['Naf4Etab'].' - '. strWsToHtml($etab['Naf4EtabLib']);?></td>
</ tr >
< ? php
2009-02-19 16:28:12 +00:00
}
2009-03-04 16:46:29 +00:00
$strActivite = '' ;
/* if ( $etab [ 'NatureActivite' ] * 1 > 0 && $etab [ 'NatureActivite' ] * 1 < 99 ) {
$tabNatureActivite = array ( 3 => 'Extraction' ,
4 => 'Fabrication, production' ,
5 => 'Montage, installation' ,
6 => 'R<> paration' ,
7 => 'Transport' ,
8 => 'Import, export' ,
9 => 'Commerce de gros ou interm<72> diaire du commerce' ,
10 => 'Commerce de d<> tail' ,
11 => 'Profession lib<69> rale' ,
12 => 'Services' ,
13 => 'Location de meubl<62> s' ,
14 => 'B<> timents, travaux publics' ,
15 => 'Services aux entreprises' ,
20 => 'Donneur d\'ordre' ,
);
$strActivite .= $tabNatureActivite [ $etab [ 'NatureActivite' ] * 1 ] . ' ' ;
} */
2009-02-19 16:28:12 +00:00
2009-03-04 16:46:29 +00:00
if ( /*trim($strActivite)<>''*/ $etab [ 'NatureActivite' ] == 1 && $etab [ 'Actif' ] == 1 ) {
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Nature de l ' activit<EFBFBD> </ td >
< td width = " 350 " class = " StyleInfoData " > Saisonni & egrave ; re </ td >
</ tr >
< ?
}
2009-02-19 16:28:12 +00:00
2009-03-04 16:46:29 +00:00
if ( ( $etab [ 'OrigineCreation' ] * 1 > 0 && $etab [ 'OrigineCreation' ] * 1 < 9 ) ||
$etab [ 'OrigineCreation' ] == 'A' || $etab [ 'OrigineCreation' ] == 'B' || $etab [ 'OrigineCreation' ] == 'C' ||
$etab [ 'OrigineCreation' ] == 'D' || $etab [ 'OrigineCreation' ] == 'E' ) {
$tabCreation = array ( 'a1' => 'Cr<43> ation' ,
'a3' => 'Achat' ,
'a4' => 'Apport' ,
'a6' => 'Prise en location g<> rance' ,
'a7' => 'Partage' ,
'a8' => 'Reprise' ,
'aA' => 'Reprise globale de l\'exploitation agricole' ,
'aB' => 'Poursuite de l\'exploitation agricole par le conjoint' ,
'aC' => 'Transfert de propri<72> t<EFBFBD> de l\'exploitation agricole' ,
'aD' => 'Apport d\'exploitation(s) agricole(s) individuelle(s)' ,
'aE' => 'Reprise d\'exploitation agricole individuelle' ,
);
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Origine du fonds </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $tabCreation [ 'a' . $etab [ 'OrigineCreation' ]] ?> </td>
</ tr >
< ?
}
2009-02-19 16:28:12 +00:00
2009-03-04 16:46:29 +00:00
if ( $etab [ 'NbEtab' ] <> 'N/C' ) {
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Nombre d ' & eacute ; tablissements actifs </ td >
2009-03-11 08:47:54 +00:00
< td width = " 350 " class = " StyleInfoData " >< a title = " Voir la liste des établissements " href = " /?page=etablissements&siret=<?= $etab['Siret'] ?>&idEntreprise=<?= $idEntreprise ?> " >< ? = number_format ( $etab [ 'NbEtab' ] * 1 , null , null , ' ' ) ?> </a><?
if ( $etab [ 'NbEtab' ] * 1 > 1 ) { ?> <a title="Voir la liste des établissements" href="/?page=etablissements&siret=<?=$etab['Siret']?>&idEntreprise=<?=$idEntreprise?>">(Liste)</a><? } ?>
2009-03-04 16:46:29 +00:00
</ td >
</ tr >
< ?
}
if ( $etab [ 'Capital' ] * 1 > 0 ) { ?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Capital </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = number_format ( $etab [ 'Capital' ], 0 , ',' , ' ' ) ?> <?
if ( $etab [ 'CapitalDev' ] == 'EUR' ) echo '€' ;
else {
echo $etab [ 'CapitalDev' ] . ' (' . strWsToHtml ( $etab [ 'CapitalLib' ]) . ')' ;
}
?> </td>
</ tr >
< ? } ?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Chiffre d ' affaire </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = strWsToHtml ( $etab [ 'TrancheCALib' ]); ?> </td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Principaux Dirigeants </ td >
< td width = " 350 " class = " StyleInfoData " >< u >< b >< ? = strWsToHtml ( ucfirst ( $etab [ 'dir1Titre' ])) ?> </b>
< ? /*if ($etab['dir1DateFct']) { echo ' au '.WDate::dateT('Y-m-d','d/m/Y',$etab['dir1DateFct']); }*/ ?> :</u><br/>
< ? = strWsToHtml ( $etab [ 'dir1NomPrenom' ]);
if ( $etab [ 'dir2Titre' ] <> '' ) { ?> <br/>
< u >< b >< ? = strWsToHtml ( ucfirst ( $etab [ 'dir2Titre' ])) ?> </b>
< ? /* if ($etab['dir2DateFct']) { echo ' au '.WDate::dateT('Y-m-d','d/m/Y',$etab['dir2DateFct']); }*/ ?> :</u><br/>
< ? = strWsToHtml ( $etab [ 'dir2NomPrenom' ]);
} ?> </td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Effectif de l ' entreprise </ td >
< td width = " 350 " class = " StyleInfoData " >< ? if ( $etab [ 'Effectif' ] == 0 ) echo 'N/C' ; else echo number_format ( $etab [ 'Effectif' ] * 1 , null , null , ' ' ) . ' salarié(s)' ; ?> </td>
</ tr >
< tr >
< td colspan = " 3 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 3 " >< img src = " ./img/srub_loc.png " width = " 576 " height = " 27 " ></ td >
</ tr >
< ? php
function normaliseVoie ( $voie ) {
switch ( strtoupper ( $voie )) {
case 'BD' : case 'BVD' : return 'BOULEVARD' ; break ;
case 'AV' : case 'AVE' : return 'AVENUE' ; break ;
case 'PL' : case 'PLA' : return 'PLACE' ; break ;
case 'ESP' : return 'ESPLANADE' ; break ;
//- 8E__ARRONDISSEMENT
default ; return strtoupper ( $voie ); break ;
2009-02-19 16:28:12 +00:00
}
}
2009-03-04 16:46:29 +00:00
$ville = ' ' . trim ( preg_replace ( '/([0-9]|BILLANCOURT|SUR.SEINE| PERRET|ARRONDISSEMENT|_)/i' , ' ' , $etab [ 'Ville' ])) . ' ' ;
$ville = trim ( strtr ( $ville , array ( ' EME ' => '' , ' ER ' => '' )));
if ( preg_match ( '/MAPPY/i' , $_SESSION [ 'tabInfo' ][ 'pref' ]) &&
preg_match ( '/(LILLE|CAEN|RENNES|BAULE|NANTES|NANCY|STRASBOURG|LYON|BORDEAUX|GRENOBLE|MONTPELLIER|TOULOUSE|MARSEILLE|CANNES|NICE|PARIS|NEUILLY|LEVALLOIS|ASNIERES|COURBEVOIE|NANTERRE|REUIL|BOULOGNE|SEVRES|VERSAILLES|MONTROUGE|MOULINEAUX)/' , $ville )) {
?>
< tr >
< td width = " 580 " colspan = " 3 " class = " StyleInfoData " >
< table >< tr >
2009-03-05 11:24:33 +00:00
< td width = " 340 " height = " 420 " >
< IFRAME src = " http://www.mappy.com/BtoB/scoresdecisions/photo?photo.town=<?= $ville ?>;photo.way=<?=trim(strtr(normaliseVoie( $etab['AdresseVoie'] ).' '. $etab['AdresseRue'] , array( ' ST '=>' SAINT ',' STE '=>' SAINTE ', )))?>;photo.num=<?= $etab['AdresseNum'] *1?>;photo.postal_code=<?= $etab['CP'] ?> " width = " 340 " height = " 420 " scrolling = " no " frameborder = " 0 " ></ IFRAME >
</ td >
2009-03-04 16:46:29 +00:00
< td width = " 240 " >< b > Information g & eacute ; ographique :</ b >< br />
2009-03-05 11:24:33 +00:00
< ? if ( $etab [ 'GeoPrecis' ] > 0 ) { ?>
Latitude : < ? = htmlentities ( dec2dms ( $etab [ 'GeoLat' ]), null , 'ISO-8859-1' ) ?> (<?=$etab['GeoLat']?>)<br/>
Longitude : < ? = htmlentities ( dec2dms ( $etab [ 'GeoLon' ]), null , 'ISO-8859-1' ) ?> (<?=$etab['GeoLon']?>)<br/><? } ?>
< a href = " ./?page=referer&part=gmap&siret=<?= $siret ?>&url=http://maps.google.com/maps?f=q%26hl=fr%26geocode=%26q=<?= $etab['AdresseNum'] ?>,+<?=urlencode( $etab['AdresseVoie'] )?>+<?=urlencode( $etab['AdresseRue'] )?>,+<?= $etab['CP'] ?>+<?=urlencode( $etab['Ville'] )?> " target = " _blank " > Afficher l ' adresse sur Google Map & copy ; </ a >< br />
< br />
< b > Code commune / Rivoli :</ b >< br />
< ? = $etab [ 'Dept' ] . ' ' . $etab [ 'codeCommune' ] ?> / <?=$etab['Rivoli']?>
</ td >
2009-03-04 16:46:29 +00:00
</ tr ></ table >
</ td >
</ tr >
< ? php
} else {
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Information g & eacute ; ographique </ td >
2009-03-05 11:24:33 +00:00
< td width = " 350 " class = " StyleInfoData " >
< ? if ( $etab [ 'GeoPrecis' ] > 0 ) { ?>
Latitude : < ? = htmlentities ( dec2dms ( $etab [ 'GeoLat' ]), null , 'ISO-8859-1' ) ?> (<?=$etab['GeoLat']?>)<br/>
Longitude : < ? = htmlentities ( dec2dms ( $etab [ 'GeoLon' ]), null , 'ISO-8859-1' ) ?> (<?=$etab['GeoLon']?>)<br/><? } ?>
< a href = " ./?page=referer&part=gmap&siret=<?= $siret ?>&url=http://maps.google.com/maps?f=q%26hl=fr%26geocode=%26q=<?= $etab['AdresseNum'] ?>,+<?=urlencode( $etab['AdresseVoie'] )?>+<?=urlencode( $etab['AdresseRue'] )?>,+<?= $etab['CP'] ?>+<?=urlencode( $etab['Ville'] )?> " target = " _blank " > Afficher l ' adresse sur Google Map & copy ; </ a ></ td >
2009-03-04 16:46:29 +00:00
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " class = " StyleInfoLib " > Code commune / Rivoli </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $etab [ 'Dept' ] . ' ' . $etab [ 'codeCommune' ] ?> / <?=$etab['Rivoli']?></td>
</ tr >
< ? php
}
?>
< tr >
< td colspan = " 3 " >& nbsp ; </ td >
</ tr >
< ?
if ( preg_match ( '/NEWS/i' , $_SESSION [ 'tabInfo' ][ 'pref' ])) {
2009-02-19 16:28:12 +00:00
2009-03-04 16:46:29 +00:00
/* Information presse
15 Aug 2007 09 : 21 : 49 GMT - */
require_once ( 'XML/RSS.php' );
$rss =& new XML_RSS ( 'http://news.google.fr/news?hl=fr&ned=fr&ie=ISO-8859-1&q=' . urlencode ( '"' . $etab [ 'Nom' ] . '"' ) . '&output=rss' );
$rss -> parse ();
$tabMonth = array ( 'Jan' => 1 , 'Feb' => 2 , 'Mar' => 3 , 'Apr' => 4 , 'May' => 5 , 'Jun' => 6 , 'Jul' => 7 , 'Aug' => 8 , 'Sep' => 9 , 'Oct' => 10 , 'Nov' => 11 , 'Dec' => 12 );
foreach ( $rss -> getItems () as $i => $item ) {
if ( $i == 0 ) { ?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " class = " StyleInfoLib " colspan = " 2 " > Information presse ( Source Google News & copy ;) < br />< ul >
< ? }
$tmp = explode ( ', ' , $item [ 'pubdate' ]);
$tabDate = explode ( ' ' , $tmp [ 1 ]);
//die($tabDate[1]);
$tabTime = explode ( ':' , $tabDate [ 3 ]);
$pubDate = date ( 'd/m/Y <20> H:i' , gmmktime ( $tabTime [ 0 ] - 1 , $tabTime [ 1 ], $tabTime [ 2 ], $tabMonth [ $tabDate [ 1 ]], $tabDate [ 0 ], $tabDate [ 2 ]));
$titre = utf8_decode ( $item [ 'title' ]);
echo '<li><a href="' . $item [ 'link' ] . '" target="_blank">Le ' . $pubDate . " - $titre </a></li> " ;
$i ++ ; if ( $i == 15 ) break ;
}
if ( $i > 0 ) echo '</ul></td></tr>' ;
2009-02-19 16:28:12 +00:00
2009-03-04 16:46:29 +00:00
}
?>
</ table >
< ?
2009-03-05 16:19:38 +00:00
//Exportation des donn<6E> es sous forme de fichier
2009-03-05 08:31:21 +00:00
function htmldecode ( $value ){
$value = is_array ( $value ) ? array_map ( 'htmldecode' , $value ) : html_entity_decode ( $value , ENT_QUOTES , 'UTF-8' );
return $value ;
}
2009-03-12 17:34:04 +00:00
$tabTemp = htmldecode ( $etab );
2009-03-05 16:19:38 +00:00
$tabForExport [ 0 ] = $tabTemp ;
2009-03-05 08:31:21 +00:00
require_once ( realpath ( dirname ( __FILE__ ) . '/../../includes/' ) . '/export.php' );
$array2csv = new ExportCSV ();
$array2csv -> records = $tabForExport ;
2009-03-05 16:19:38 +00:00
$array2csv -> writeCSV ( $fileName );
2009-03-10 15:07:24 +00:00
2009-03-05 08:31:21 +00:00
$array2xml = new ExportXML ();
2009-03-10 15:07:24 +00:00
$array2xml -> rootName = $page . 's' ;
$array2xml -> defaultTagName = $page ;
2009-03-05 08:31:21 +00:00
$array2xml -> records = $tabForExport ;
2009-03-05 16:19:38 +00:00
$array2xml -> writeXML ( $fileName );
2009-03-05 08:31:21 +00:00
} //Fin test mise en cache
2009-03-04 16:46:29 +00:00
$cache -> stopCapture (); //On arrete la capture pour le cache
2009-02-17 13:14:53 +00:00
?>