extranet/www/pages/identite.php

599 lines
27 KiB
PHP
Raw Normal View History

<? 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');
$siret=trim(preg_replace('/[^0-9]/', '', $_REQUEST['siret']));
if (strlen($siret)<>0 && strlen($siret)<>9 && strlen($siret)<>14) die('Param<61>tres incorrects !');
$iden=trim(preg_replace('/[^0-9]/', '', $_REQUEST['iden']))*1; // Si id=0 alors non communiqu<71>
if (($siret*1)==0 && $iden==0) die('Param<61>tres incorrects !');
$siren=substr($siret,0,9);
2009-03-05 16:19:38 +00:00
//Forcer la cr<63>ation de la page dans le cache lorsque l'utilisateur a le mode saisie
if(preg_match('/saisie/i', $_SESSION['tabInfo']['droits'])) $forceCache = TRUE;
else $forceCache = FALSE;
//G<>n<EFBFBD>rer un nom de fichier pour le cache et l'export des fichiers
if ($siren==0){
$fileName = $page2.'-'.$idEntreprise;
}else{
$fileName = $page2.'-'.$siren;
}
//Mise en Cache
2009-03-04 16:46:29 +00:00
$cache = new Cache();
2009-03-05 16:19:38 +00:00
if ( $cache->startCapture($fileName.'.html',$forceCache) == FALSE){
2009-03-05 08:31:21 +00:00
print $cache->displayCache();
2009-03-04 16:46:29 +00:00
}else{
/** Utilisation du WS **/
$client = new SoapClient(null, array( 'trace' => 1,
'soap_version' => SOAP_1_1,
'location' => WEBSERVICE_URL,
'uri' => WEBSERVICE_URI,
'login' => $_SESSION['tabInfo']['login'],
'password' => $_SESSION['tabInfo']['password'],
// 'encoding' => 'UTF-8'
));
try {
$O = $client->getIdentite($siret, $iden);
$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'];
$tabEntrep['codeCommune']=$etab['Dept'].$etab['codeCommune'];
$tabEntrep['nafEn']=$etab['NafEnt'];
$tabEntrep['nafEt']=$etab['NafEtab'];
$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-04 16:46:29 +00:00
?>
<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).'&nbsp; <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).'&nbsp; <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&eacute 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'])
echo '&nbsp;<img src="img/exclamation.png"/ title="Non valid<69>. Obligatoire sur factures, d<>clarations d\'<27>change de biens et de TVA !">';
} ?></td>
</tr>
<?
/**
** On recherche un logo
**/
$urlImg='';
$siteWeb='';
2009-03-04 16:46:29 +00:00
$locImg=PATH_LOGOS.$etab['Siren'];
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'; }
if ($urlImg=='' && $etab['Isin']<>'') {
$locImg=PATH_LOGOS.$etab['Isin'];
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-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-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&eacute;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,'', ' ')?> &euro; au <?=WDate::dateT('Y-m-d','d/m/Y',$bourse['derCoursDate'])?></td>
</tr>
<?
}
}
if ($urlImg<>'') {
$tabTmp=@getimagesize($locImg.$ext);
$w=$tabTmp[0];
$h=$tabTmp[1];
if ($w>350) $strSize=@redimage($locImg.$ext,350,150);
else $strSize='';
?>
<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>
<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&eacute;ro R.C.';
$libTrib=' RCS '.preg_replace('/(^TC |^TI |^TGIcc )/i','',$etab['TribunalLib']);
}
?></td>
<td width="350" class="StyleInfoData"><?=$etab['AutreId'].$libTrib?></td>
</tr>
<? } ?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Etablissement actif<?
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'].'">Acc&egrave;s <20> la fiche du si&egrave;ge</a>'; ?>
</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>&nbsp;(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 '&nbsp;&nbsp;&nbsp;<a title="Voir l\'avis de situation correspondant de l\'INSEE" target="_blank" href="/?page=avis&siret='.$siret.'">(Situation au r&eacute;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')
echo '<a href="./?page=annonces&siret='.$etab['Siret'].'"><font color="red"><b>En proc&eacute;dure collective</b></font></a>';
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') )
echo '&nbsp;&nbsp;<a href="./?page=saisie&siret='.$etab['Siret'].'">(Edition)</a>';
// elseif ($etab['SituationJuridique']=='R') echo '<a href="./?page=annonces&siret='.$etab['Siret'].'">Radi&eacute;e</a>';
// elseif ($etab['SituationJuridique']=='A') echo '<a href="./?page=annonces&siret='.$etab['Siret'].'">Absorb&eacute;e</a>';
// else echo '&nbsp;';
?></td>
</tr>
<? } 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') ) { ?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Situation juridique</td>
<td width="350" class="StyleInfoData"><a href="./?page=saisie&siret=<?=$etab['Siret']?>">N<EFBFBD>ant</a></td>
</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-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']))
$etab['Adresse2']='<a title="Voir la fiche d\'identit<69> du domiciliataire de cette entreprise" href="/?page=identite&siret=424950459">CHEZ SOFRADOM</a>';
if ($etab['Adresse2']<>'') echo $etab['Adresse2'].'<br/>';?>
<? $cp=$etab['CP']*1;
if ($cp<>0) echo $etab['CP'].'&nbsp;';?><?=strWsToHtml($etab['Ville'])?>
<? if ($etab['Pays']<>'' && strtoupper(substr($etab['Pays'],0,3))<>'FRA') echo '<br/>'.strWsToHtml($etab['Pays']);?>
</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] => 11270ZF
[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 &agrave; v&eacute;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 &agrave; v&eacute;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 &agrave; v&eacute;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 &agrave; v&eacute;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;
}
?>&nbsp;&nbsp;&nbsp;<a title="Rechercher le num&eacute;ro de t&eacute;l&eacute;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) { ?>
<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-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>&Eacute;tab. :</b> <?=$etab['Naf4Etab'].' - '. strWsToHtml($etab['Naf4EtabLib']);?></td>
</tr>
<?php
}
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-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-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-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>
<td width="350" class="StyleInfoData"><a title="Voir la liste des &eacute;tablissements" href="/?page=etablissements&siret=<?=$etab['Siret']?>"><?=number_format($etab['NbEtab']*1,null,null,' ')?></a><?
if ($etab['NbEtab']*1>1) { ?>&nbsp;<a title="Voir la liste des &eacute;tablissements" href="/?page=etablissements&siret=<?=$etab['Siret']?>">(Liste)</a><? } ?>
</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,',',' ')?>&nbsp;<?
if ($etab['CapitalDev']=='EUR') echo '&euro;';
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,' ').'&nbsp;salari&eacute;(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-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-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-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-05 16:19:38 +00:00
$tabTemp = htmldecode($etab);
$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-04 16:46:29 +00:00
2009-03-05 08:31:21 +00:00
$array2xml = new ExportXML();
$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
?>