extranet/www/pages/annonces.php

464 lines
14 KiB
PHP
Raw Normal View History

2009-05-28 14:48:23 +00:00
<?php
2010-04-27 08:09:23 +00:00
if (!page_checkParams()) die('Paramètres incorrects !');
require_once 'cache/cache.php';
require_once 'partenaires/classMTva.php';
require_once 'partenaires/classMMap.php';
require_once 'partenaires/classMCoface.php';
require_once 'common/dates.php';
2009-10-08 13:20:51 +00:00
require_once 'scoresws/scoresws.php';
if (isset($_REQUEST['idan']) && $_REQUEST['idan']*1!=0)
2010-02-04 13:52:02 +00:00
$idan = $_REQUEST['idan'];
else
2010-02-04 13:52:02 +00:00
$idan = false;
2010-04-02 10:00:32 +00:00
$vue = (isset($_GET['vue'])) ? $_GET['vue'] : '';
$message='';
2009-05-28 14:48:23 +00:00
//Récupération des infos du webservice
2009-10-08 13:20:51 +00:00
$annonces = scoresws_annonces($siret, $siren, $idEntreprise, $vue, $idan);
2010-06-23 08:58:24 +00:00
FB::log($annonces, 'annonces');
2009-06-03 08:44:13 +00:00
?>
<div id="center">
2009-06-18 15:26:44 +00:00
<h1 class="titre">ANNONCES L&Eacute;GALES</h1>
2009-06-03 08:44:13 +00:00
<table>
<?php if ($message<>'') { ?>
2009-06-03 08:44:13 +00:00
<tr>
<td width="30">&nbsp;</td>
2010-02-04 13:52:02 +00:00
<td width="550" colspan="3" class="StyleInfoData">
<h3><?=$message;?></h3>
</td>
2009-06-03 08:44:13 +00:00
</tr>
<?php }?>
2009-06-03 08:44:13 +00:00
<tr>
<td width="30">&nbsp;</td>
2010-02-04 13:52:02 +00:00
<td width="200" colspan="2" 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>
2009-06-03 08:44:13 +00:00
</tr>
<tr>
<td width="30">&nbsp;</td>
2010-02-04 13:52:02 +00:00
<td width="200" colspan="2" class="StyleInfoLib">
Raison Sociale
</td>
<td width="350" class="StyleInfoData">
<?=$raisonSociale?>
<?php
if(hasModeEdition())
{
?>
<a href="./?page=saisie&siret=<?=$siret?>&idEntreprise=<?=$idEntreprise?>">
(Edition)
</a>
<?php
2010-02-04 13:52:02 +00:00
}
?>
</td>
2009-06-03 08:44:13 +00:00
</tr>
</table>
<?php
if ($idan && ($vue=='bodacc' || $vue=='abod' || $vue=='balo' || $vue=='asso'))
{
if($vue=='asso' && $siren==0)
{
2010-04-01 08:08:50 +00:00
foreach($annonces as $ann){
if($ann['id']==$idan)
break;
}
}else{
$ann = $annonces[0];
}
/** AFFICHAGE D'UNE ANNONCE BODACC / BALO / ASSO **/
2009-06-18 15:26:44 +00:00
// Entête BALO
if ($vue=='balo')
{
?>
<h2>BALO</h2>
<table>
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="3" class="StyleInfoData">
BALO n&deg;<?=$ann['BodaccNum']?>&nbsp;du <?=WDate::dateT('Y-m-d','d/m/Y',$ann['DateParution'])?>. Entr&eacute; n&deg;<?=$ann['NumAnnonce']?>. Entr&eacute;e en base S&amp;D : <?=WDate::dateT('Y-m-d','d/m/Y',$ann['dateInsertionSD'])?>.<br/>
2010-05-03 14:55:00 +00:00
<a href="/?page=annonces&siret=<?=$siret?>&idEntreprise=<?=$idEntreprise?>&idan=<?=$_REQUEST['idan']?>&vue=balo&mode=pdf" target="_blank">Cliquez ici pour voir cette annonce au format PDF&nbsp;(<?=adapteOCtets(@filesize(PATH_DATA.'/jo/balo/'.WDate::dateT('Y-m-d','Y',$ann['DateParution']).'/'. $ann['Lien_Annonce_Pdf']))?>)</a>
.</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="3" class="StyleInfoLib"><b><?=$ann['Categorie']?></b></td>
</tr>
<tr>
</table>
<?php
$ann['texteAnnonce']=utf8_decode($ann['texteAnnonce']);
}
elseif ($vue=='bodacc' || $vue=='abod')
{
2009-05-28 14:48:23 +00:00
?>
<h2>&Eacute;V&Eacute;NEMENTS L&Eacute;GAUX</h2>
<table>
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="3" class="StyleInfoData">
<?php
$tabSource=explode('-', $ann['BodaccCode']);
$source=$tabSource[0];
$idSource=@$tabSource[1];
if ($source[0] == 'B') {
$logo = 'img/logo_jo.png';
if ($ann['BodaccNum']==0){
$libelle = 'Source BODACC '.substr($ann['BodaccCode'],-1).
' du '.WDate::dateT('Y-m-d','d/m/Y',$ann['DateParution']);
} else {
$libelle = 'Source BODACC n&deg;'.$ann['BodaccNum'].'&nbsp;'.
substr($ann['BodaccCode'],-1).
' du '.WDate::dateT('Y-m-d','d/m/Y',$ann['DateParution']).
'. D&eacute;partement n&deg;'.$ann['Departement'].
'. <a href="/?page=competences&siret='.$siret.
'&type=tri">'.$ann['Tribunal'].'</a>';
}
}elseif ($source[0] == 'G' || $source[0] == 'T'){
$logo = './img/logo_greffe.png';
$libelle = 'Source Greffe du Tribunal';
}elseif ($source[0] == 'P'){
$logo = './img/logo_inpi.png';
$libelle = 'Source Registre National du Commerce';
}else{
$logo = './img/logo_jal.png';
$libelle = '';
if( hasModeEdition() && substr($source,0,2)=='JT' ){
$libelle = '<b>Source TESSI</b> - ';
}
$libelle.= 'Source Journal Annonces L&eacute;gales';
}
if ($ann['dateInsertionSD'] <> '') {
$libelle.= ' - Entr&eacute;e en base : ';
$date = new WDate;
$libelle.= $date->dateT('Y-m-d', 'd/m/Y', $ann['dateInsertionSD']);
}
$edition = '';
if ( hasModeEdition() ){
$edition.= ' <a class="annonceEdit" href="/?page=saisieajax&q=annonces/editDialog/'.
$idan.'/'.$siret.'" title="Edition annonce">'.
'<img src="./img/interface/editer.png"/></a>';
$edition.= ' <a class="annonceDelete" href="/?page=saisieajax&q=annonces/deleteDialog/'.
$idan.'/'.$siret.'"'.' title="Suppression annonce">'.
'<img src="./img/interface/supprimer.png"/></a>';
$edition.= ' <a class="annonceCopy" href="/?page=saisieajax&q=annonces/copyDialog/'.
$idan.'/'.$siret.'"'.' title="Dupliquer sur autre Siren ">'.
'<img src="./img/save_copy.png"/></a>';
$edition.= '<script type="text/javascript" src="js/jquery.form.js"></script>';
$edition.= '<script type="text/javascript" src="js/annonces.js"></script>';
}
?>
<?='<img src="'.$logo.'" />'?> <?=$libelle?> <?=$edition?>
</td>
</tr>
</table>
<?php
}
elseif ($vue=='asso')
{
?>
<h2>Associations</h2>
<table>
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="3" class="StyleInfoData">J.O. ASSOCIATION n&deg;<?=$ann['BodaccNum']?>&nbsp;du <?=WDate::dateT('Y-m-d','d/m/Y',$ann['DateParution'])?>. Annonce n&deg;<?=$ann['NumAnnonce']?>. Entr&eacute;e en base S&amp;D : <?=WDate::dateT('Y-m-d','d/m/Y',$ann['dateInsertionSD'])?>.</td>
</tr>
</table>
<?php
}
?>
2009-06-03 08:44:13 +00:00
<table>
<tr>
2009-05-28 14:48:23 +00:00
<td width="30">&nbsp;</td>
2009-06-03 08:44:13 +00:00
<td width="550" colspan="3" class="StyleInfoLib">
<b>
2009-05-28 14:48:23 +00:00
<?php
2009-06-03 08:44:13 +00:00
foreach (@$ann['evenements'] as $i=>$even) { echo @$even['LibEven'].'<br/>'; }
?>
</b>
2009-05-28 14:48:23 +00:00
</td>
</tr>
<tr>
2009-05-28 14:48:23 +00:00
<td colspan="4">&nbsp;</td>
</tr>
<tr>
2009-05-28 14:48:23 +00:00
<td width="30">&nbsp;</td>
2009-08-20 09:52:50 +00:00
<?php
2009-05-28 14:48:23 +00:00
/**Affichage du texte de l'annonce**/
2010-04-02 10:00:32 +00:00
$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', $ann['texteAnnonce']);
2009-08-20 09:52:50 +00:00
?>
<td width="550" colspan="3"><code><?=$texte?></code></td>
</tr>
<tr><td colspan="4">&nbsp;</td></tr>
<tr>
<td colspan="4" align="center" class="StyleInfoData"><a href="Javascript:history.back()">Revenir à la liste des annonces</a></td>
</tr>
</table>
<?php
2010-04-02 08:44:45 +00:00
} else if (count($annonces) > 0) {
// Tri des annonces dans des tableaux différents
$annoncesBodacc = array();
$annoncesBalo = array();
$annoncesAsso = array();
foreach ($annonces as $i => $ann) {
if ($ann['BodaccCode'] == 'BODA' ||
$ann['BodaccCode'] == 'BODB' ||
$ann['BodaccCode'] == 'BODC') {
$annoncesBodacc[] = $ann;
} else if ($ann['BodaccCode'] == 'BALO') {
$annoncesBalo[] = $ann;
} else if ($ann['BodaccCode'] == 'ASSO') {
$annoncesAsso[] = $ann;
} else {
$annoncesBodacc[] = $ann;
}
}
/** Affichage de la liste des annonces **/
// Affiche annonces Bodacc
if (count($annoncesBodacc) > 0) {
?>
<h2>EV&Eacute;NEMENTS L&Eacute;GAUX</h2>
<table>
<?php
foreach($annoncesBodacc as $i => $ann) {
?>
<tr>
<td width="30">&nbsp;</td>
<td width="140" class="StyleInfoLib">
<span id="annoncesDate"><p>Le
2010-04-02 08:44:45 +00:00
<?php
$date = new WDate;
print $date->dateT('Y-m-d', 'd/m/Y', $ann['DateParution']);
?>
</p></span>
<span id="annoncesImg">
2010-04-02 08:44:45 +00:00
<?php
$tabSource = explode('-', $ann['BodaccCode']);
$source = $tabSource[0];
$idSource = @$tabSource[1];
if ($source[0] == 'B') {
echo '<img src="./img/logo_jo.png" title="Source BODACC '.
$ann['BodaccNum'].' '.
substr($source,-1).' '.
substr($ann['DateParution'],0,4).'"/>';
} else if ($source[0] == 'G' ||
$source[0] == 'T') {
echo '<img src="./img/logo_greffe.png"'.
' title="Source Collecte Greffe"/>';
} else if ($source[0] == 'P') {
echo '<img src="./img/logo_inpi.png"'.
' title="Source Collecte RNCS"/>';
} else {
echo '<img src="./img/logo_jal.png"'.
' title="Source Collecte JAL';
if ($idSource>0) echo ' $idSource';
echo '"/>';
}
?>
</span>
2010-04-02 08:44:45 +00:00
</td>
<td width="450" colspan="2" class="StyleInfoData">
2010-05-03 14:55:00 +00:00
<a href="/?page=annonces&siret=<?=$siret?>&idEntreprise=<?=$idEntreprise?>&idan=<?=$ann['id']?>&vue=bodacc">
2010-04-02 08:44:45 +00:00
<?php
foreach ($ann['evenements'] as $i=>$even) {
echo $even['LibEven'];
if (hasModeEdition() && substr($source, 0, 2) == 'JT') {
echo ' <b>(Source TESSI)</b>';
}
$numEven = $even['CodeEven'] * 1;
if ($numEven > 3000 && $numEven < 3999) {
print ' (clôture au ';
$date = new WDate;
print $date->dateT('Y-m-d', 'd/m/Y', $ann['dateEffet']).
')';
}
echo '<br/>';
}
?>
</a>
</td>
</tr>
<?php
}
?>
</table>
<?php
}
// Affiche annonces Balo
if (count($annoncesBalo) > 0) {
?>
<h2>BALO</h2>
<table>
<?php
foreach ($annoncesBalo as $i => $ann) {
?>
<tr>
<td width="30">&nbsp;</td>
<td width="140" class="StyleInfoLib">
<span id="annoncesDate">Le
<?php
$date = new WDate;
print $date->dateT('Y-m-d', 'd/m/Y', $ann['DateParution']);
?>
</span>
<span id="annoncesImg">
<?php
if ($ann['BodaccCode'] == 'BALO'){
echo '<img src="./img/logo_jo.png" title="Source BALO n°'.$ann['BodaccNum'].'"/>';
2009-06-18 15:26:44 +00:00
}
?>
</span>
</td>
<td width="450" colspan="2" class="StyleInfoData">
2010-05-03 14:55:00 +00:00
<a href="/?page=annonces&siret=<?=$siret?>&idEntreprise=<?=$idEntreprise?>&idan=<?=$ann['id']?>&vue=balo">
2009-06-03 08:44:13 +00:00
<?php
foreach ($ann['evenements'] as $i=>$even) {
print $even['LibEven'];
$numEven=$even['CodeEven']*1;
if ($numEven>3000 && $numEven<3999) print ' (clôture au '.WDate::dateT('Y-m-d','d/m/Y',$ann['dateEffet']).')';
print '<br/>';
}
?>
</a></td>
</tr>
<?php
2009-06-03 08:44:13 +00:00
}
?>
</table>
<?php
}
2009-06-18 15:26:44 +00:00
//Affiche annonces Asso
if (count($annoncesAsso)>0)
{
?>
<h2>Associations</h2>
<table>
<?php
foreach($annoncesAsso as $i => $ann)
{
?>
<tr>
<td width="30">&nbsp;</td>
<td width="140" class="StyleInfoLib">
<span id="annoncesDate">Le <?=WDate::dateT('Y-m-d','d/m/Y',$ann['DateParution']);?></span>
<span id="annoncesImg">
2009-06-18 15:26:44 +00:00
<?php
if ($ann['BodaccCode'] == 'ASSO'){
print '<img src="./img/logo_jo.png" title="Source JO ASSOCIATION n°'.$ann['BodaccNum'].'"/>';
2009-06-18 15:26:44 +00:00
}
?>
</span>
</td>
<td width="450" colspan="2" class="StyleInfoData">
<a href="/?page=annonces&siret=<?=$siret?>&idEntreprise=<?=$idEntreprise?>&idan=<?=$ann['id']?>&vue=asso">
2009-06-03 08:44:13 +00:00
<?php
foreach ($ann['evenements'] as $i=>$even) {
print $even['LibEven'];
$numEven=$even['CodeEven']*1;
if ($numEven>3000 && $numEven<3999) print ' (clôture au '.WDate::dateT('Y-m-d','d/m/Y',$ann['dateEffet']).')';
print '<br/>';
}
?>
</a></td>
</tr>
<?php
2009-06-18 15:26:44 +00:00
}
?>
</table>
<?php
}
}
else
{
/** Aucune annonce bodacc pour cette entreprise **/
?>
<h2>Evénements légaux</h2>
<table>
<tr>
<td width="30">&nbsp;</td>
<td width="100" class="StyleInfoLib">&nbsp;</td>
<td width="450" colspan="2" class="StyleInfoData">N&eacute;ant</td>
</tr>
<tr>
<td colspan="4">&nbsp;</td>
</tr>
</table>
<?php
}
2009-06-18 15:26:44 +00:00
2010-06-23 08:58:24 +00:00
if ( count($annonces)>0 )
{
if (($siret*1)==0 || ($siren*1)<100){ $fileName = $page.'-'.$idEntreprise;
}else{ $fileName = $page.'-'.$siret; }
if($vue!=''){$fileName.= '-'.$idan;}
2009-10-08 13:20:51 +00:00
2010-06-23 08:58:24 +00:00
require_once 'export.php';
$parseTab = new tabExport();
$parseTab->tab = $annonces;
$parseTab->notdisplay = array('id');
$parseTab->title = array('BodaccCode' => 'Code Bodacc',
'BodaccNum' => 'Numéro Bodacc',
'NumAnnonce' => 'Numéro annonce',
'DateParution' => 'Date de parution',
'TribunalSiret' => 'Siret du tribunal',
'typeAnnonce' => 'Type annonce',
'texteRectificatif' => 'Texte rectificatif',
'texteAnnonce' => 'Texte annonce',
'dateEffet' => 'Date effet',
'dateJugement' => 'Date jugement',
'dateInsertionSD' => 'Date insertion',
'evenements' => 'Evenements');
$parseTab->type = array();
$tabForExport = $parseTab->convertTable();
2009-06-18 15:26:44 +00:00
2010-06-23 08:58:24 +00:00
$array2csv = new ExportCSV();
$array2csv->records = $tabForExport;
$array2csv->writeCSV($fileName);
2009-05-28 14:48:23 +00:00
2010-06-23 08:58:24 +00:00
$tabForExport = $annonces;
$array2xml = new ExportXML();
$array2xml->rootName = $page.'s';
$array2xml->defaultTagName = $page;
$array2xml->records = $tabForExport;
$array2xml->writeXML($fileName);
}
if (!$idan)
{
2009-05-20 15:49:08 +00:00
?>
2009-06-03 08:44:13 +00:00
<table>
<tr>
<td width="30">&nbsp;</td>
2009-05-22 09:53:48 +00:00
<td colspan="3" width="550" class="StyleInfoData">
<a class="dialogsurv" href=""></a>
2009-06-18 15:26:44 +00:00
<?php
2009-05-20 15:49:08 +00:00
require_once 'surveillance/surveillance.php';
echo getSurveillance('annonces', $siret);
2009-05-20 15:49:08 +00:00
?>
</td>
</tr>
2009-06-03 08:44:13 +00:00
</table>
2009-06-18 15:26:44 +00:00
<?php
}
?>
2010-04-12 14:49:55 +00:00
<p class="confidentiel blockh2">
<?php
require_once 'cgu/cgu.php';
echo afficheCgu();
?>
</p>
2009-06-03 08:44:13 +00:00
</div>