extranet/www/pages/identite.php

313 lines
13 KiB
PHP
Raw Normal View History

<?php
//Enregistrement pour liste derni<6E>re recherche
require_once 'recherche/session.php';
$parametres = recherche_element(0);
if( isset($parametres) && $parametres['info']['page']=='recherche' )
{
recherche_saveinfo( array('page' => $page) );
recherche_saveinfo( array('siret' => $siret) );
recherche_saveinfo( array('idEntreprise' => $idEntreprise) );
}
2009-10-23 15:01:48 +00:00
function dRow($lib, $data, $title = '')
{
$html = '<tr>'."\n";
$html.= ' <td width="30">&nbsp;</td>'."\n";
$html.= ' <td width="200" class="StyleInfoLib">'.$lib.'</td>'."\n";
if($title!='') $title = ' title="'.$title.'"';
$html.= ' <td width="350" class="StyleInfoData"'.$title.'>'.$data.'</td>'."\n";
$html.= '</tr>'."\n";
return $html;
}
?>
<div id="center">
<h1 class="titre">IDENTIT&Eacute; DE L'ENTREPRISE</h1>
<table>
2009-10-23 15:01:48 +00:00
<?php
//Siret
$element = formatElement('identite', 'siret', array($etab['Siren'], $etab['Siret']));
echo dRow($element['lib'], $element['data']);
//Siret siege
$element = formatElement('identite', 'siretsiege', array($etab['SiretSiege']));
echo dRow($element['lib'], $element['data']);
//Num<75>ro tva intracommunautaire
$element = formatElement('identite', 'tvanumero', array($etab['TvaNumero'], $etab['TvaAttribue'], $etab['Dept']));
?>
<tr>
<td width="30">&nbsp;</td>
2009-10-23 15:01:48 +00:00
<td width="200" class="StyleInfoLib"><?=$element['lib']?></td>
<td width="350" class="StyleInfoData" valign="middle"><?=$element['data']?></td>
</tr>
<?php
2009-10-23 15:01:48 +00:00
//Isin
$element = formatElement('identite', 'isin', array($etab['Isin'], $etab['Siret']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Capitalisation
$element = formatElement('identite', 'capitalisation', array($etab['Bourse'], $etab['Isin']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//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
2009-10-08 13:20:51 +00:00
list($urlImg, $pathImg) = logo_exist($etab['Siren'], $etab['Isin'], $etab['Web']);
if( ( ($siren*1!=0 ) || ($siren*1>100) ) && file_exists($pathImg) )
{
2009-10-08 13:20:51 +00:00
$tabTmp=@getimagesize($pathImg);
$w=$tabTmp[0];
$h=$tabTmp[1];
2009-10-08 13:20:51 +00:00
if ($w>350) $strSize=@redimage($pathImg,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>
<?php
}
2009-10-23 15:01:48 +00:00
//Num<75>ro RC
$element = formatElement('identite', 'numrc', array($etab['NumRC']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Autre identifiant : Num<75>ro WALDEC ou ancien num<75>ro RC si le nouveau n'est pas disponible
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'autreid', array($etab['AutreId'], $etab['TribunalLib'], $etab['NumRC']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'actif', array($etab['Siren'], $siret, $idEntreprise, $etab['Siege'], $etab['Actif'], $etab['DateClotEt']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Situation Jurique + affichage date de radiation
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'situationjuridique', array($etab['SituationJuridique'], $etab['DateRadiation'], $etab['Siret'], $idEntreprise));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
?>
</table>
2009-10-23 15:01:48 +00:00
2009-12-15 14:38:08 +00:00
<h2>Raison sociale &amp; Coordonn<EFBFBD>es</h2>
<table>
<?php
//Nom
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'raisonsociale', array($etab['Nom'], $etab['Nom2'], $etab['NomLong']));
if($element!==false){ echo dRow($element['lib'], $element['data'], $element['title']); }
2009-10-23 15:01:48 +00:00
//Enseigne / Sigle
$element = formatElement('identite', 'enseignesigle', array($etab['Enseigne'], $etab['Sigle'], $etab['SigleLong']));
if($element!==false){ echo dRow($element['lib'], $element['data'], $element['title']); }
//Forme juridique
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'fj', array($etab['FJ'], $etab['FJ_lib'], $etab['FJ2'], $etab['FJ2_Lib'] ));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Date d'immatriculation
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'dateimmat', array($etab['DateImmat']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Date de cr<63>ation de l'entreprise
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'datecreaen', array($etab['DateCreaEn']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Date de cr<63>ation de l'<27>tablissement
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'datecreaet', array($etab['DateCreaEt']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Adresse
$element = formatElement('identite', 'adresse', array($etab['Adresse'], $etab['Adresse2'], $etab['AdresseNum'], $etab['AdresseRue'], $etab['CP'], $etab['Ville'], $etab['Pays']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Zones prioritaires
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'zones', array($etab['GeoInfos']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//T<>l<EFBFBD>phone
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'tel', array($etab['Tel'], $etab['Enseigne'], $etab['Nom'], $etab['Adresse'], $etab['CP'], $etab['Ville'] ));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Fax
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'fax', array($etab['Fax']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Site web
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'web', array($etab['Web']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Email
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'mail', array($etab['Mail']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
?>
</table>
2009-12-15 14:38:08 +00:00
<h2>Activit<EFBFBD>(s) &amp; Chiffre d'affaire</h2>
<table>
<?php
2009-10-23 15:01:48 +00:00
//Activit<69> de l'entreprise
$element = formatElement('identite', 'activiteen', array($etab['Activite'], $etab['NafEnt'], $etab['NafEntLib']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Activit<69> de l'<27>tablissement
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'activiteet', array($etab['NafEtab'], $etab['NafEtabLib']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//NAF4
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'naf4', array($etab['Naf4Ent'], $etab['Naf4EntLib'], $etab['Naf4Etab'], $etab['Naf4EtabLib']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Nature de l'activit<69>
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'natureactivite', array($etab['NatureActivite'], $etab['Actif']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Origine du fond
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'originefond', array($etab['OrigineCreation']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
2009-10-08 13:20:51 +00:00
//Type d'exploitation
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'typeexploitation', array($etab['TypeExploitation']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
2009-10-08 13:20:51 +00:00
//Nombre d'<27>tablissements actif
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'nbetabactif', array($etab['NbEtab'], $etab['Siret'], $idEntreprise));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Capital
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'capital', array($etab['Capital'], $etab['CapitalDev'], $etab['CapitalLib'], $etab['CapitalType'], $etab['Bilan']));
if($element!==false){ echo dRow($element['lib'], $element['data'], $element['title']); }
//Chiffre d'affaire
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'ca', array($etab['Bilan'], $etab['TrancheCALib']));
if($element!==false){ echo dRow($element['lib'], $element['data'], $element['title']); }
//Principaux dirigeants
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'dirigeants', array($etab['dir1Titre'], $etab['dir1NomPrenom'], $etab['dir1DateNaiss'], $etab['dir1LieuNaiss'], $etab['dir2Titre'], $etab['dir2NomPrenom'], $etab['dir2DateNaiss'], $etab['dir2LieuNaiss']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Effectif
2009-10-23 15:01:48 +00:00
$element = formatElement('identite', 'effectif', array($etab['Effectif'], $etab['Bilan']));
if($element!==false){ echo dRow($element['lib'], $element['data'], $element['title']); }
?>
</table>
2009-10-23 15:01:48 +00:00
2009-12-15 14:38:08 +00:00
<h2>Localisation g<EFBFBD>ographique &amp; Recherche presse</h2>
<table>
<?php
//Information g<>ographique
$ville=' '.trim(preg_replace('/([0-9]|BILLANCOURT|SUR.SEINE| PERRET|ARRONDISSEMENT|_)/i',' ',$etab['Ville'])).' ';
$ville=trim(strtr($ville, array(' EME '=>'', ' ER '=>'')));
if (preg_match('/\bMAPPY\b/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>
<td width="340" height="320">
<IFRAME src="http://pro.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="320" scrolling="no" frameborder="0"></IFRAME>
</td>
<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>
</tr></table>
</td>
</tr>
<?php
} else {
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Information g&eacute;ographique</td>
<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>
</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>
<?
//News
if (preg_match('/\bNEWS\b/i', $_SESSION['tabInfo']['pref']))
{
/* 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>
2009-03-04 16:46:29 +00:00
<?php
}
$tmp=explode(', ', $item['pubdate']);
$tabDate = explode(' ', $tmp[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)
{
2009-03-04 16:46:29 +00:00
?>
</ul></td></tr>
<?php
2009-03-05 08:31:21 +00:00
}
}
?>
</table>
<?php
require_once 'surveillance/surveillance.php';
$permSurveillance = false;
foreach(assocSourceDroit() as $source => $droit)
{
$permSurveillance = hasPerm($droit, $_SESSION['tabInfo']['droits']);
if($permSurveilance==true) break;
}
if($permSurveillance){
?>
2009-12-16 09:52:30 +00:00
<p style="margin-left:30px;"><a class="thickbox" href="./pages/ajax_surveillance.php?q=ajouter&siren=<?=$siren?>" title="Placer sous surveillance">Placer sous surveillance.</a></p>
<?php
}
2009-10-08 13:20:51 +00:00
if (($siret*1)==0 || ($siren*1)<100){ $fileName = 'identite-'.$idEntreprise;
}else{ $fileName = 'identite-'.$siret; }
//Exportation des donn<6E>es sous forme de fichier
function htmldecode($value){
$value = is_array($value) ? array_map('htmldecode', $value) : html_entity_decode($value, ENT_QUOTES, 'UTF-8');
return $value;
}
$tabTemp = htmldecode($etab);
$tabForExport[0] = $tabTemp;
require_once 'export.php';
$array2csv = new ExportCSV();
$array2csv->records = $tabForExport;
$array2csv->writeCSV($fileName);
$array2xml = new ExportXML();
$array2xml->rootName = $page.'s';
$array2xml->defaultTagName = $page;
$array2xml->records = $tabForExport;
$array2xml->writeXML($fileName);
?>
</div>