2009-02-27 10:06:54 +00:00
< ?
if ( ! $_SESSION [ 'connected' ]) die ();
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-02-27 10:06:54 +00:00
if ( isset ( $_REQUEST [ 'idan' ]) && $_REQUEST [ 'idan' ] * 1 <> 0 ) $idan = $_REQUEST [ 'idan' ];
else $idan = false ;
$iden = $_REQUEST [ 'iden' ];
2009-02-19 16:28:12 +00:00
2009-02-27 10:06:54 +00:00
if (( $siret * 1 ) == 0 && $idan == 0 ) die ( 'Param<61> tres incorrects !' );
2009-02-19 16:28:12 +00:00
$siren = substr ( $siret , 0 , 9 );
//annonces&action=logon&login=mederic&checkIp=only&siret=552144503&id=6415277&vue=bodacc
$vue = $_REQUEST [ 'vue' ];
/** 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' ]));
$message = '' ;
$action = $_REQUEST [ 'action' ];
if ( $action <> '' && $action <> 'surv' && $action <> 'logon' ) die ( 'Param<61> tres incorrects !' );
if ( $action == 'surv' ) {
if ( preg_match ( '#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$#' , $_REQUEST [ 'email' ])) {
$message = 'Entreprise sous surveillance Annonces Légales' ;
mail ( 'contact@scores-decisions.com' , " Demande de surveillance pour $siren <20> " . $_REQUEST [ 'email' ],
'REQUEST=' . EOL . print_r ( $_REQUEST , true ) . 'EOL' .
'SERVER=' . EOL . print_r ( $_SERVER , true ) . 'EOL' .
'SESSION=' . EOL . print_r ( $_SESSION , true ) . 'EOL' .
'ENV=' . EOL . print_r ( $_ENV , true ) . 'EOL' .
'tabInfo=' . print_r ( $tabInfo , true ));
$fp = fopen ( PATH_LOGS . 'surveillances.csv' , 'a' );
fwrite ( $fp , date ( 'Y/m/d H:i:s' ) . " ; $siren ; " . $_REQUEST [ 'email' ] . ';' . $tabInfo [ 'login' ] . ';' . $tabInfo [ 'email' ] . ';' . $tabInfo [ 'ip' ] . " \n " );
fclose ( $fp );
try {
$O = $client -> setSurveillanceAnnoncesLegales ( $siren , $_REQUEST [ 'email' ], $_REQUEST [ 'ref' ]);
//$annonces=$O['result'];
} catch ( SoapFault $fault ) {
2009-02-26 17:16:11 +00:00
include_once ( realpath ( dirname ( __FILE__ ) . '/../../' ) . '/includes/soaperror.php' );
processSoapFault ( $client , $fault , $tabInfo );
2009-02-19 16:28:12 +00:00
die ();
}
} else {
$message = " ERREUR : Veuillez saisir une adresse email valide pour la mise sous surveillance " ;
}
}
2009-02-20 13:04:46 +00:00
include_once ( INCLUDE_PATH . '/partenaires/classMTva.php' );
include_once ( INCLUDE_PATH . '/partenaires/classMMap.php' );
include_once ( INCLUDE_PATH . '/partenaires/classMCoface.php' );
include_once ( FWK_PATH . '/common/dates.php' );
2009-02-19 16:28:12 +00:00
try {
if ( $vue == 'bodacc' || $_REQUEST [ 'source' ] = 1 ) $filtre = 1 ;
elseif ( $vue == 'balo' ) $filtre = 2 ;
elseif ( $vue == 'asso' ) $filtre = 3 ;
else $filtre = 0 ;
if ( $tabInfo [ 'entrep' ][ 'fj' ] > 9000 && $tabInfo [ 'entrep' ][ 'fj' ] < 9999 && $siren == 0 ) {
$filtre = 3 ;
}
//echo "<!-- Appel getAnnonces($siren, $filtre, $id)-->";
2009-02-27 10:06:54 +00:00
$O = $client -> getAnnonces ( $siren , $filtre , $idan );
2009-02-19 16:28:12 +00:00
$annonces = $O [ 'result' ];
if ( count ( $annonces ) == 0 ) {
$id = 0 ;
2009-02-27 10:06:54 +00:00
$O = $client -> getAnnonces ( $siren , $filtre , $idan );
2009-02-20 13:57:51 +00:00
$annonces = $O [ 'result' ];
2009-02-19 16:28:12 +00:00
}
} catch ( SoapFault $fault ) {
2009-02-26 17:16:11 +00:00
include_once ( realpath ( dirname ( __FILE__ ) . '/../../' ) . '/includes/soaperror.php' );
processSoapFault ( $client , $fault , $tabInfo );
2009-02-19 16:28:12 +00:00
die ();
}
2009-02-20 13:57:51 +00:00
/*
print " <pre> " ;
print_r ( $annonces );
print " </pre> " ;
exit ;
*/
2009-02-19 16:28:12 +00:00
/** R<> cup<75> ration du site WEB et tel/fax entreprise **/
2009-02-20 13:57:51 +00:00
$conid = mysql_pconnect ( MYSQL_HOST , MYSQL_USER , MYSQL_PASS );
2009-02-19 16:28:12 +00:00
if ( ! ( $conid === false )) {
2009-02-20 13:57:51 +00:00
if ( mysql_select_db ( MYSQL_DB , $conid ) === false ) {
2009-02-19 16:28:12 +00:00
die ( 'Base de donn<6E> es indisponible' );
}
}
if ( $siren <> $tabInfo [ 'entrep' ][ 'siren' ]) {
$O2 = $client -> getIdentite ( $siret );
$etab = $O2 [ 'result' ];
$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 ;
$raisonSociale = $etab [ 'Nom' ];
} else
$raisonSociale = $tabInfo [ 'entrep' ][ 'raisonSociale' ];
?>
< table width = " 580 " border = " 0 " align = " left " bgcolor = " #FFFFFF " >
< ? php
if ( $message <> '' ) {
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " colspan = " 3 " class = " StyleInfoData " >< h3 >< ? = $message ; ?> </h3></td>
</ tr >
< ? php
}
/*
echo " <!-- " ;
print_r ( $O );
echo " --> " ;
*/
?>
< tr >
< td colspan = " 4 " >< img src = " ./img/rub_balobodacc.png " width = " 577 " height = " 36 " /></ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< 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>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " colspan = " 2 " class = " StyleInfoLib " > Raison Sociale </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $raisonSociale ?> </td>
</ tr >
< ?
2009-02-27 10:06:54 +00:00
if ( $idan && ( $vue == 'bodacc' || $vue == 'abod' || $vue == 'balo' || $vue == 'asso' )) {
2009-02-20 13:57:51 +00:00
echo '<tr><td colspan="4"> </td></tr>' ;
2009-02-19 16:28:12 +00:00
$ann = $annonces [ 0 ];
/**
** AFFICHAGE D ' UNE ANNONCE BODACC / BALO / ASSO
**/
// Ent<6E> te BALO
if ( $vue == 'balo' ) {
?>
< tr >< td colspan = " 4 " >& nbsp ; </ td ></ tr >
< tr >
< td colspan = " 4 " >< img src = " ./img/srub_balo.png " width = " 576 " height = " 27 " /></ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " colspan = " 3 " class = " StyleInfoData " > BALO n & deg ; < ? = $ann [ 'BodaccNum' ] ?> du <?=WDate::dateT('Y-m-d','d/m/Y',$ann['DateParution'])?>. Entré n°<?=$ann['NumAnnonce']?>. Entrée en base S&D : <?=WDate::dateT('Y-m-d','d/m/Y',$ann['dateInsertionSD'])?>.<br/>
2009-02-27 10:06:54 +00:00
< a href = " /?page=annonces&siret=<?= $siret ?>&id=<?= $_REQUEST['idan'] ?>&vue=balo&mode=pdf " target = " _blank " > Cliquez ici pour voir cette annonce au format PDF & nbsp ;( < ? = adapteOCtets ( @ filesize ( '/var/www/data/jo/balo/' . WDate :: dateT ( 'Y-m-d' , 'Y' , $ann [ 'DateParution' ]) . '/' . $ann [ 'Lien_Annonce_Pdf' ])) ?> )</a>
2009-02-19 16:28:12 +00:00
.</ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " colspan = " 3 " class = " StyleInfoLib " >< b >< ? = $ann [ 'Categorie' ] ?> </b></td>
</ tr >
< tr >
< ?
$ann [ 'texteAnnonce' ] = utf8_decode ( $ann [ 'texteAnnonce' ]);
} elseif ( $vue == 'bodacc' || $vue == 'abod' ) {
?>
< tr >< td colspan = " 4 " >& nbsp ; </ td ></ tr >
< tr >
< td colspan = " 4 " >< img src = " ./img/srub_bodacc.png " width = " 576 " height = " 27 " /></ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
2009-02-20 13:57:51 +00:00
< td width = " 550 " colspan = " 3 " class = " StyleInfoData " >
< ?
2009-02-19 16:28:12 +00:00
$tabSource = explode ( '-' , $ann [ 'BodaccCode' ]);
$source = $tabSource [ 0 ];
$idSource =@ $tabSource [ 1 ];
if ( $source == 'GC' )
echo '<img src="./img/logo_greffe.png"/> Source Tribunal' ;
elseif ( $source == 'PC' )
echo '<img src="./img/logo_inpi.png"/> Source Registre National du Commerce' ;
elseif ( $source == '' || $source == 'JS' )
echo '<img src="./img/logo_jal.png"/> Source Journal Annonces Légales' ;
elseif ( $ann [ 'BodaccNum' ] == 0 )
echo '<img src="./img/logo_jo.png"/> Source BODACC ' . substr ( $ann [ 'BodaccCode' ], - 1 ) . ' du ' . WDate :: dateT ( 'Y-m-d' , 'd/m/Y' , $ann [ 'DateParution' ]);
else
echo '<img src="./img/logo_jo.png"/> Source BODACC n°' . $ann [ 'BodaccNum' ] . ' ' . substr ( $ann [ 'BodaccCode' ], - 1 ) . ' du ' . WDate :: dateT ( 'Y-m-d' , 'd/m/Y' , $ann [ 'DateParution' ]); ?> . Département n°<?=$ann['Departement']?>. <!--<a href="/?page=identite&siret=<?=$ann['TribunalSiret']?>">--><a href="/?page=competences&siret=<?=$siret?>&type=tri"><?=$ann['Tribunal']?></a>.<?
2009-02-20 13:57:51 +00:00
if ( $ann [ 'dateInsertionSD' ] <> '' ) echo 'Entrée en base : ' . WDate :: dateT ( 'Y-m-d' , 'd/m/Y' , $ann [ 'dateInsertionSD' ]);
?>
</ td >
2009-02-19 16:28:12 +00:00
</ tr >
< ?
} /*<?=WDate::dateT('Y-m-d','d/m/Y',$ann['DateParution'])?>*/
elseif ( $vue == 'asso' ) {
?>
< tr >< td colspan = " 4 " >& nbsp ; </ td ></ tr >
< tr >
< td colspan = " 4 " >< img src = " ./img/srub_asso.png " width = " 576 " height = " 27 " /></ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " colspan = " 3 " class = " StyleInfoData " > J . O . ASSOCIATION n & deg ; < ? = $ann [ 'BodaccNum' ] ?> du <?=WDate::dateT('Y-m-d','d/m/Y',$ann['DateParution'])?>. Annonce n°<?=$ann['NumAnnonce']?>. Entrée en base S&D : <?=WDate::dateT('Y-m-d','d/m/Y',$ann['dateInsertionSD'])?>.</td>
</ tr >
< ?
}
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " colspan = " 3 " class = " StyleInfoLib " >< b >< ? foreach ( @ $ann [ 'evenements' ] as $i => $even ) {
echo @ $even [ 'LibEven' ] . '<br/>' ;
} ?> </b>
< ?
/* if ( $_SESSION [ 'tabInfo' ][ 'login' ] == 'ylenaour' ) {
echo ' <a title="Voir la page originale du bodacc" target="_blank" href="/?page=original&source=1&annee=' . WDate :: dateT ( 'Y-m-d' , 'Y' , $ann [ 'DateParution' ]) . '&type=' . $ann [ 'BodaccCode' ] . '&numero=' . $ann [ 'BodaccNum' ] . '">Page originale</a>' ;
} */
?>
</ td >
</ tr >
< tr >
< td colspan = " 4 " >& nbsp ; </ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< ? /**
** Affichage du texte de l ' annonce
**/
$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' ]);
?> <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 <EFBFBD> la liste des annonces </ a ></ td >
</ tr >
< ? }
elseif ( count ( $annonces ) > 0 ) { /** Affichage de la liste des annonces **/
$titreBodacc = $titreBalo = $titreAsso = false ;
foreach ( $annonces as $i => $ann ) {
if ( $ann [ 'BodaccCode' ] == 'BODA' || $ann [ 'BodaccCode' ] == 'BODB' || $ann [ 'BodaccCode' ] == 'BODC' ) {
if ( ! $titreBodacc ) echo '<tr><td colspan="4"> </td></tr><tr><td colspan="4"><img src="./img/srub_bodacc.png" width="576" height="27" /></td></tr>' ;
$vueL = 'bodacc' ;
$titreBodacc = true ;
}
elseif ( $ann [ 'BodaccCode' ] == 'BALO' ) {
if ( ! $titreBalo ) echo '<tr><td colspan="4"> </td></tr><tr><td colspan="4"><img src="./img/srub_balo.png" width="576" height="27" /></td></tr>' ;
$vueL = 'balo' ;
$titreBalo = true ;
}
elseif ( $ann [ 'BodaccCode' ] == 'ASSO' ) {
if ( ! $titreAsso ) echo '<tr><td colspan="4"> </td></tr><tr><td colspan="4"><img src="./img/srub_asso.png" width="576" height="27" /></td></tr>' ;
$vueL = 'asso' ;
$titreAsso = true ;
}
else {
if ( ! $titreBodacc ) echo '<tr><td colspan="4"> </td></tr><tr><td colspan="4"><img src="./img/srub_bodacc.png" width="576" height="27" /></td></tr>' ;
$vueL = 'abod' ;
$titreBodacc = true ;
}
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 100 " class = " StyleInfoLib " > Le < ? = WDate :: dateT ( 'Y-m-d' , 'd/m/Y' , $ann [ 'DateParution' ]) . ' ' ;
if ( $vueL == 'bodacc' || $vueL == 'abod' ) {
$tabSource = explode ( '-' , $ann [ 'BodaccCode' ]);
$source = $tabSource [ 0 ];
$idSource =@ $tabSource [ 1 ];
if ( $source == 'BODA' || $source == 'BODB' || $source == 'BODC' )
echo '<img src="./img/logo_jo.png" title="Source BODACC ' . $ann [ 'BodaccNum' ] . ' ' . substr ( $source , - 1 ) . ' ' . substr ( $ann [ 'DateParution' ], 0 , 4 ) . '"/>' ;
elseif ( $source == 'GC' )
echo '<img src="./img/logo_greffe.png" title="Source Collecte Greffe"/>' ;
elseif ( $source == 'PC' )
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 '"/>' ;
}
}
?> </td>
< td width = " 450 " colspan = " 2 " class = " StyleInfoData " >< a href = " /?page=annonces&siret=<?= $siret ?>&id=<?= $ann['id'] ?>&vue=<?= $vueL ?> " >< ? foreach ( $ann [ 'evenements' ] as $i => $even ) {
echo $even [ 'LibEven' ];
$numEven = $even [ 'CodeEven' ] * 1 ;
if ( $numEven > 3000 && $numEven < 3999 ) echo ' (cl<63> ture au ' . WDate :: dateT ( 'Y-m-d' , 'd/m/Y' , $ann [ 'dateEffet' ]) . ')' ;
//elseif ($ann['BodaccCode']<>'BODA' && $ann['BodaccCode']<>'BODB' && $ann['BodaccCode']<>'BODC' && (str_replace('-','',$ann['DateParution'])*1)>20060101 )
// echo ' <u>(annonce officielle en cours de publication au BODACC)</u>';
echo '<br/>' ;
/* 'dateEffet' => $ann [ 'dateEffet' ],
'dateJugement' => $ann [ 'dateJugement' ],
*/
} ?> </a></td>
</ tr >
< ? }
} else {
/** Aucune annonce bodacc pour cette entreprise
**/
?>
< tr >
< td colspan = " 4 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 4 " >< img src = " ./img/srub_bodacc.png " width = " 576 " height = " 27 " /></ td >
</ tr >
< 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 >
< ? /*
< tr >
< td colspan = " 4 " align = " center " class = " StyleInfoData " > Scores & amp ; D & eacute ; cisions dispose de l 'intégralit<69> de l' historique Bodacc depuis 1953. Cet historique sera mis en ligne dans son int & eacute ; gralit & eacute ; au courant du 2 & egrave ; me semestre 2008. </ td >
</ tr >
*/
}
2009-02-27 10:06:54 +00:00
if ( ! $idan ) { ?>
2009-02-19 16:28:12 +00:00
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 100 " class = " StyleInfoLib " >& nbsp ; </ td >
< td width = " 450 " colspan = " 2 " class = " StyleInfoData " >< br />< br />< form action = " ./?page=annonces&action=surv&siret=<?= $siret ?> " method = " POST " >< input type = " checkbox " /> Mettre sous surveillance les annonces l & eacute ; gales < br />
& nbsp ; & nbsp ; & nbsp ; & nbsp ; & nbsp ; & nbsp ; & nbsp ; & nbsp ; Votre r & eacute ; f & eacute ; rence < input name = " ref " type = " text " value = " " size = " 10 " />< br />
Adresse email du destinataire < input name = " email " type = " text " value = " <? if ( $_SESSION['tabInfo'] ['login']<>'testreunica' && $_SESSION['tabInfo'] ['login']<>'reunicacsf') echo $tabInfo['email'] ?> " size = " 20 " />& nbsp ; & nbsp ; & nbsp ; < input type = " image " src = " ./img/boutton_valider_off.gif " name = " submit " onmouseover = " this.src='./img/boutton_valider_on.gif' " onmouseout = " this.src='./img/boutton_valider_off.gif' " title = " Mettre sous surveillance... " ></ form ></ td >
</ tr >
< ? }
?>
</ table >
<!--
< ? /*
print_r ( $annonces ); */
2009-02-17 13:14:53 +00:00
?> -->