2009-02-17 13:14:53 +00:00
< ? php
if ( ! $_SESSION [ 'connected' ])
2009-08-21 07:19:35 +00:00
{
2010-02-10 17:27:03 +00:00
echo ( 'Vous devez être connecté afin de pouvoir utiliser cette fonctionnalité' );
2009-08-21 07:19:35 +00:00
}
else
2009-11-18 17:00:59 +00:00
{
2010-01-14 14:55:32 +00:00
$firephp -> log ( $_SESSION , 'SESSION' );
2010-02-10 17:27:03 +00:00
$idCommande = 0 ; // Par défaut, l'identifiant de commande Infogreffe est à 0
2009-06-02 10:42:59 +00:00
$con = mysql_pconnect ( MYSQL_HOST , MYSQL_USER , MYSQL_PASS );
if ( ! ( $con === false )) {
if ( mysql_select_db ( MYSQL_DB , $con ) === false )
echo ( '<!--Could not select database: ' . mysql_error () . '-->' );
}
2009-07-02 08:36:04 +00:00
2009-11-18 17:00:59 +00:00
$siret = $_REQUEST [ 'siret' ];
$siren = substr ( $siret , 0 , 9 );
$idan = $_REQUEST [ 'idan' ];
$idEntreprise = $_REQUEST [ 'idEntreprise' ];
$source = $_REQUEST [ 'source' ];
2009-07-02 08:36:04 +00:00
2009-11-18 17:00:59 +00:00
$action = $_REQUEST [ 'action' ];
2010-02-10 17:27:03 +00:00
if ( $action != '' && $action != 'commande' ) die ( 'Paramètres incorrects !' );
2009-07-02 08:36:04 +00:00
2009-06-02 10:42:59 +00:00
$vecteurCommande = $_REQUEST [ 'vecteur' ];
2009-12-04 17:17:09 +00:00
//
2009-11-18 17:00:59 +00:00
if ( $vecteurCommande != '' )
{
2010-02-10 17:27:03 +00:00
if ( $vecteurCommande != 'C' && $vecteurCommande != 'T' ) die ( 'Paramètres incorrects !' );
//Par défault
2009-11-18 17:00:59 +00:00
} else {
2009-06-02 10:42:59 +00:00
$vecteurCommande = 'T' ;
2009-11-18 17:00:59 +00:00
}
2009-06-02 10:42:59 +00:00
$message = '' ;
2009-07-02 08:36:04 +00:00
2009-12-04 17:17:09 +00:00
2009-06-02 10:42:59 +00:00
require_once 'common/dates.php' ;
require_once 'common/curl.php' ;
require_once 'infogreffe/infogreffe.php' ;
2010-01-13 16:39:13 +00:00
require_once 'user/user.php' ;
2010-01-12 16:17:39 +00:00
//Elements de session
2009-04-01 12:45:45 +00:00
$tabInfo = $_SESSION [ 'tabInfo' ];
2010-01-12 16:17:39 +00:00
$login = strtolower ( $tabInfo [ 'login' ]);
2009-11-18 17:00:59 +00:00
$raisonSociale = $tabInfo [ 'entrep' ][ 'raisonSociale' ];
2009-07-02 08:36:04 +00:00
isset ( $_REQUEST [ 'rs' ]) ? $raisonSociale = $_REQUEST [ 'rs' ] : '' ;
2009-11-18 17:00:59 +00:00
$cj = $tabInfo [ 'entrep' ][ 'fj' ];
$dep = substr ( '' . $tabInfo [ 'entrep' ][ 'codeCommune' ], 0 , 2 );
2010-01-12 16:17:39 +00:00
//Raison sociale inexacte
if ( $siren != $tabInfo [ 'entrep' ][ 'siren' ])
{
2010-01-12 16:22:38 +00:00
require_once 'scoresws/scoresws.php' ;
2010-01-12 16:21:06 +00:00
$etab = scoresws_identitelight ( $siret , $siren , $idEntreprise );
2010-01-12 16:17:39 +00:00
if ( ! empty ( $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 ;
$raisonSociale = $etab [ 'Nom' ];
}
}
2009-11-18 17:00:59 +00:00
?>
2009-12-04 17:17:09 +00:00
< div id = " center " >
2009-11-18 17:00:59 +00:00
< ? php
2010-02-10 17:27:03 +00:00
// Specificités des associations
2009-11-18 17:00:59 +00:00
if ( ( $cj == 9150 || // Association syndicale libre
2010-02-10 17:27:03 +00:00
$cj == 9220 || // Association déclarée
$cj == 9221 || // Association déclarée "entreprises d'insertion par l'économique"
$cj == 9222 || // Association intermédiaire
2009-11-18 17:00:59 +00:00
$cj == 9223 || // Groupement d'employeurs
2010-02-10 17:27:03 +00:00
$cj == 9230 || // Association déclarée reconnue d'utilité publique
$cj == 9240 || // Congrégation
2009-11-18 17:00:59 +00:00
$cj == 9260 || // Association de droit local
$cj == 9300 ) && // Fondation
2009-09-24 16:05:13 +00:00
@ $_REQUEST [ 'force' ] <> true // &force=true force le passage chez infogreffe
)
2009-07-15 13:02:58 +00:00
{
2009-11-18 17:00:59 +00:00
if ( $action == 'commande' )
{
2010-01-14 14:55:32 +00:00
if ( ! empty ( $_REQUEST [ 'email' ]) /*&& mailCommande($_REQUEST['email'], $siren, 'asso')*/ )
2009-11-18 17:00:59 +00:00
{
2010-01-14 14:55:32 +00:00
$erreur = false ;
2009-07-15 13:02:58 +00:00
$fp = fopen ( PATH_LOGS . 'commande_asso.csv' , 'a' );
fwrite ( $fp , date ( 'Y/m/d H:i:s' ) . " ; $siren ; " . $_REQUEST [ 'email' ] . ';' . $tabInfo [ 'login' ] . ';' . $tabInfo [ 'email' ] . ';' . $tabInfo [ 'ip' ] . " \n " );
fclose ( $fp );
2010-01-14 14:55:32 +00:00
$infoAsso = array (
'Siren' => $siren ,
'idEntreprise' => $idEntreprise ,
'RaisonSociale' => $raisonSociale ,
);
$infoDemande = array (
'Ref' => $_REQUEST [ 'reference' ],
'Tel' => $_REQUEST [ 'tel' ],
'Email' => $_REQUEST [ 'email' ],
);
$firephp -> log ( $infoDemande , 'infoDemande' );
$firephp -> log ( $infoAsso , 'infoAsso' );
try {
$O = $client -> commandeAsso ( $siren , $infoAsso , $infoDemande );
2010-01-14 15:06:32 +00:00
$annee = substr ( $O [ 'results' ][ 'dateCommande' ], 0 , 4 );
$mois = substr ( $O [ 'results' ][ 'dateCommande' ], 4 , 2 );
$jour = substr ( $O [ 'results' ][ 'dateCommande' ], 6 , 2 );
$heure = substr ( $O [ 'results' ][ 'dateCommande' ], 8 , 2 );
$minutes = substr ( $O [ 'results' ][ 'dateCommande' ], 10 , 2 );
$ref = $O [ 'results' ][ 'refCmde' ];
if ( isset ( $ref ) && ! empty ( $ref ) )
2010-01-14 14:55:32 +00:00
{
2010-02-10 17:27:03 +00:00
$message = 'Votre demande à été prise en compte le ' . $jour . '/' . $mois . '/' . $annee . ' à ' . $heure . ' h ' . $minutes . ' sous la référence <b>' . $ref . '</b>.' ;
2010-01-14 14:55:32 +00:00
}
$firephp -> log ( $O , 'O' );
} catch ( SoapFault $fault ) {
require_once 'soaperror.php' ;
processSoapFault ( $client , $fault , $_SESSION [ 'tabInfo' ]);
$erreur = true ;
}
if ( $erreur )
{
$message = 'Une erreur s\'est produite lors du passage de votre commande.' ;
}
2009-07-15 13:02:58 +00:00
} else {
2010-02-10 17:27:03 +00:00
$message = " ERREUR : Veuillez saisir une adresse email valide pour la commande de pièces. " ;
2009-02-17 13:14:53 +00:00
}
2009-07-15 13:02:58 +00:00
}
2009-08-27 07:39:27 +00:00
2009-08-21 07:19:35 +00:00
if ( $message != '' )
{
2009-07-15 13:02:58 +00:00
?>
2009-11-18 17:00:59 +00:00
< table >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " colspan = " 2 " class = " StyleInfoData " >< h3 >< ? = $message ; ?> </h3></td>
</ tr >
</ table >
2009-07-15 13:02:58 +00:00
< ? php
}
?>
2009-11-18 17:00:59 +00:00
< h1 > PI & Egrave ; CES OFFICIELLES </ h1 >
< table >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " 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 " class = " StyleInfoLib " > Raison Sociale </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $raisonSociale ?> </td>
</ tr >
</ table >
< h2 > Actes & amp ; Statuts </ h2 >
< table >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " colspan = " 2 " class = " StyleInfoData " > Il n ' est pas possible de visualiser les statuts des associations en ligne .</ td >
</ tr >
2009-07-15 13:02:58 +00:00
< ? php
2009-12-10 09:54:47 +00:00
if ( $action != 'commande' && preg_match ( '/\bACTES\b/i' , $_SESSION [ 'tabInfo' ][ 'droits' ]))
2009-08-27 07:39:27 +00:00
{
2009-07-15 13:02:58 +00:00
?>
2009-11-18 17:00:59 +00:00
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " colspan = " 2 " class = " StyleInfoData " >< br />< br />
< form action = " ./?page=greffes&action=commande&siret=<?= $siret ?>&idEntreprise=<?= $idEntreprise ?>&idan=<?= $idan ?>&source=<?= $source ?> " method = " POST " >
2010-01-14 14:55:32 +00:00
Commander les statuts de l ' association ( d & eacute ; lai approximatif de 15 jours ) < br />
2010-02-10 17:27:03 +00:00
< br /> Votre référence < input type = " text " name = " reference " value = " " />< br />
< br /> Votre téléphone < input type = " text " name = " tel " value = " " maxlength = " 14 " />
2009-11-18 17:00:59 +00:00
< 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 class = " imgButton " 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 = " Commander les statuts de l'association... " >
</ form >
</ td >
</ tr >
2009-07-15 13:02:58 +00:00
< ?
2009-12-10 09:54:47 +00:00
} elseif ( ! preg_match ( '/\bACTES\b/i' , $_SESSION [ 'tabInfo' ][ 'droits' ])){
2009-07-15 13:02:58 +00:00
?>
2009-11-18 17:00:59 +00:00
< tr >
< td width = " 30 " >& nbsp ; </ td >
2010-02-10 17:27:03 +00:00
< td width = " 550 " colspan = " 2 " class = " StyleInfoData " > Vous n ' avez pas les droits nécessaires pour commander des status .</ td >
2009-11-18 17:00:59 +00:00
</ tr >
2009-07-15 13:02:58 +00:00
< ? php
2009-02-17 13:14:53 +00:00
}
2009-07-15 13:02:58 +00:00
?>
2009-11-18 17:00:59 +00:00
</ table >
2009-07-15 13:02:58 +00:00
< ?
2009-11-18 17:00:59 +00:00
}
2010-02-10 17:27:03 +00:00
// Fin Specificités des associations
2009-11-18 17:00:59 +00:00
2009-10-08 13:20:51 +00:00
/* elseif ( $dep == '00' || $dep == '57' || $dep == '67' || $dep == '68' || $dep == '97' || $dep == '98' || $vue == 'rcs' )
2010-02-10 17:27:03 +00:00
{ // Déb ALSACE DOM
2009-07-15 13:02:58 +00:00
include ( 'inpi.php' );
2009-10-08 13:20:51 +00:00
} */
2009-11-18 17:00:59 +00:00
2010-02-10 17:27:03 +00:00
// Déb hors ALSACE DOM
2009-08-21 07:19:35 +00:00
else
2009-11-18 17:00:59 +00:00
{
$firephp -> log ( $action , 'action' );
$firephp -> log ( $vecteurCommande , 'vecteurCommande' );
2009-12-11 12:34:22 +00:00
$firephp -> log ( $_REQUEST , 'REQUEST' );
2009-11-18 17:00:59 +00:00
$vue = $_REQUEST [ 'vue' ];
$option = trim ( '' .@ $_REQUEST [ 'option' ]); /* Si acte ou statuts : type_acte-date-greffe-dossier_millesime-dossier_statut-dossier_chrono-num_depot-num_acte */
$noemail = false ;
if ( $action == 'commande' && ! empty ( $_REQUEST [ 'email' ]))
{
if ( mailCommande ( $_REQUEST [ 'email' ], $siren , 'greffe' ))
{
2009-06-02 10:42:59 +00:00
$message = 'Commande prise en compte' ;
$fp = fopen ( PATH_LOGS . 'commande_greffe.csv' , 'a' );
fwrite ( $fp , date ( 'Y/m/d H:i:s' ) . " ; $siren ; " . $_REQUEST [ 'email' ] . ';' . $tabInfo [ 'login' ] . ';' . $tabInfo [ 'email' ] . ';' . $tabInfo [ 'ip' ] . " \n " );
fclose ( $fp );
2009-11-18 17:00:59 +00:00
$tabCommande = array ( 'emailCommande' => $_REQUEST [ 'email' ] ); //On rentre l'adresse email
2009-07-02 08:36:04 +00:00
mysql_update ( 'commandes' , $tabCommande , " login=' $login ' AND siren=' $siren ' " );
2009-06-02 10:42:59 +00:00
} else {
2010-02-10 17:27:03 +00:00
$message = " ERREUR : Veuillez saisir une adresse email valide pour la commande de pièces " ;
2009-07-02 08:36:04 +00:00
}
2009-02-17 13:14:53 +00:00
}
2009-07-02 08:36:04 +00:00
2010-02-10 17:27:03 +00:00
/** Si on est en commande de courrier, on génère une réf unique **/
2009-08-21 07:19:35 +00:00
if ( $vecteurCommande == 'C' )
{
2009-11-18 17:00:59 +00:00
$rep = mysql_select ( 'commandes' , ' idCommande, login, emailCommande, dateCommande' , " siren= $siren AND refDocument=' $option ' " );
if ( count ( $rep ) == 0 )
{
$dejaCommande = false ;
2009-07-02 08:36:04 +00:00
/** Aucune commande ne concerne ce document **/
2010-01-15 13:28:25 +00:00
$tabCommande = array (
'idUser' => $_SESSION [ 'tabInfo' ][ 'id' ],
//'emailCommande' => $_REQUEST['email'],
'login' => $login ,
'siren' => $siren ,
'refDocument' => $option ,
'libDocument' => $_REQUEST [ 'lib' ],
'dateCommande' => date ( 'YmdHis' )
2009-11-18 17:00:59 +00:00
);
$idCommande = mysql_insert ( 'commandes' , $tabCommande );
//noemail = true : on sait que l'email n'a pas ete saisie
}
else
{
$dejaCommande = true ;
2009-06-02 10:42:59 +00:00
/** Document en cours de commande **/
if ( $rep [ 0 ][ 'login' ] == $login )
2009-11-18 17:00:59 +00:00
{
2010-02-10 17:27:03 +00:00
$message2 = 'Votre commande a déjà été prise en compte le ' . WDate :: dateT ( 'Y-m-d' , 'd/m/Y' , $rep [ 0 ][ 'dateCommande' ]);
2009-11-18 17:00:59 +00:00
if ( empty ( $rep [ 0 ][ 'emailCommande' ]))
{
$firephp -> info ( 'Email manquant' );
$noemail = true ;
}
}
2009-02-17 13:14:53 +00:00
}
2009-08-21 07:19:35 +00:00
} //Fin commande courrier
2009-11-18 17:00:59 +00:00
2009-06-02 10:42:59 +00:00
$output = @ $_REQUEST [ 'output' ];
$vecteur = 'XL' ;
2009-08-21 07:19:35 +00:00
switch ( $vue )
{
2009-11-18 17:00:59 +00:00
case 'kbis' : $type = 'KB' ; break ;
case 'histo' : $type = 'HQ' ; break ; //"T"/>'.XL
case 'statuts' : $type = 'ST' ; $vecteur = $vecteurCommande ; break ;
case 'actes' : $type = 'AC' ; if ( $option != '' ) $vecteur = $vecteurCommande ; break ;
2009-06-02 10:42:59 +00:00
case 'LE' : $type = 'ListeEtab' ; break ;
case 'PN' : $type = 'PrivNant' ; break ;
case 'BI' : $type = 'BilanImg' ; break ;
//case 'bilans': $type='BS'; break;
2010-01-04 09:47:31 +00:00
case 'bilans' : $type = 'BI' ; if ( $option != '' ) $vecteur = $vecteurCommande ; break ;
2009-06-02 10:42:59 +00:00
case 'FA' : $type = 'PrezProcol' ; break ;
case 'FI' : $type = 'Inventaire' ; break ;
2009-11-18 17:00:59 +00:00
case 'jugements' : $type = 'FJ' ; break ;
2009-06-02 10:42:59 +00:00
case 'FO' : $type = 'Ordonnance' ; break ;
case 'FD' : $type = 'DepotDivers' ; break ;
case 'SD' : $type = 'SurvDemande' ; break ;
case 'SR' : $type = 'SurvRevel' ; break ;
case 'SP' : $type = 'SurvPortef' ; break ;
2009-11-18 17:00:59 +00:00
case 'rcs' : break ;
2009-06-02 10:42:59 +00:00
default : if ( $action != 'commande' ) die ( 'Type de pièce officielle inexistante' ); break ;
2009-02-17 13:14:53 +00:00
}
2009-11-18 17:00:59 +00:00
2009-06-02 10:42:59 +00:00
$req = requeteInfogreffe ( $siren , $idCommande , $type , $vecteur , $option );
2010-01-04 09:20:10 +00:00
$firephp -> log ( $req , 'Requete Infogreffe' );
2009-06-02 10:42:59 +00:00
$success = true ;
2009-07-02 08:36:04 +00:00
2010-02-10 17:27:03 +00:00
/** Par défaut les documents avec des liens vers les actes ne sont pas périsables **/
2009-08-21 07:19:35 +00:00
$perisable = false ;
if ( $option == '' )
{
2009-06-02 10:42:59 +00:00
$fichier = " $type - $siren .xml " ;
2010-02-10 17:27:03 +00:00
$perisable = true ; // La liste des documents est périsable !
2009-02-17 13:14:53 +00:00
}
2009-06-02 10:42:59 +00:00
else
2009-08-21 07:19:35 +00:00
{
2009-06-02 10:42:59 +00:00
$fichier = " $type - $siren - $option .xml " ;
2009-08-21 07:19:35 +00:00
}
2009-11-18 17:00:59 +00:00
2010-02-10 17:27:03 +00:00
// Pas déjà commandé et pas commande
2009-08-21 07:19:35 +00:00
if ( $action != 'commande' && ! $dejaCommande )
{
2009-06-02 10:42:59 +00:00
if ( // Le fichier n'existe pas en cache
! file_exists ( PATH_DATA . '/infogreffe/xml/' . $fichier ) ||
2010-02-10 17:27:03 +00:00
// Le fichier existe en cache mais est périsable (liste)
2009-06-02 10:42:59 +00:00
( file_exists ( PATH_DATA . '/infogreffe/xml/' . $fichier ) && $perisable && date ( 'Ymd' , filemtime ( PATH_DATA . '/infogreffe/xml/' . $fichier )) <> date ( 'Ymd' )) ||
2010-02-10 17:27:03 +00:00
// Le fichier existe en cache, n'est pas périsable (acte) mais contient un message d'erreur
2009-06-02 10:42:59 +00:00
( file_exists ( PATH_DATA . '/infogreffe/xml/' . $fichier ) && ! $perisable && date ( 'Ymd' , filemtime ( PATH_DATA . '/infogreffe/xml/' . $fichier )) <> date ( 'Ymd' ) && filesize ( PATH_DATA . '/infogreffe/xml/' . $fichier ) <= 200 )
2009-08-21 07:19:35 +00:00
)
{
2010-01-04 13:23:06 +00:00
//Gestion du nom de fichier
switch ( $type )
2009-06-02 10:42:59 +00:00
{
2010-01-04 13:23:06 +00:00
case 'BI' :
$fichierPdf = PATH_DATA . '/pdf/bilan-' . $siren . '-' . $option . '.pdf' ;
$firephp -> info ( 'Execution requete Infogreffe' );
$xml = getInfogreffeXML ( $req );
$firephp -> log ( $xml , 'XML' );
break ;
case 'AC' :
case 'ST' :
$fichierPdf = PATH_DATA . '/pdf/acte-' . $siren . '-' . $option . '.pdf' ;
2010-02-10 17:27:03 +00:00
$firephp -> log ( file_exists ( $fichierPdf ), 'Test présence fichier ' . $fichierPdf );
2010-01-04 13:23:06 +00:00
if ( ! file_exists ( $fichierPdf ) )
{
$firephp -> info ( 'Execution requete Infogreffe' );
$xml = getInfogreffeXML ( $req );
$firephp -> log ( $xml , 'XML' );
}
break ;
2009-06-02 10:42:59 +00:00
}
/** Enregistrement du fichier XML en provenance des greffes **/
2009-11-18 17:00:59 +00:00
if ( strlen ( $xml ) != 0 ) {
2009-06-02 10:42:59 +00:00
$fp =@ fopen ( PATH_DATA . '/infogreffe/xml/' . $fichier , 'w' );
@ fwrite ( $fp , $xml );
@ fclose ( $fp );
}
2009-08-21 07:19:35 +00:00
}
else
{
2009-11-18 17:00:59 +00:00
// Lecture du fichier xml en cache
$xml = file_get_contents ( PATH_DATA . '/infogreffe/xml/' . $fichier );
2009-06-02 10:42:59 +00:00
}
2009-08-21 07:19:35 +00:00
}
else
{
2009-11-18 17:00:59 +00:00
$xml = '' ;
2009-08-21 07:19:35 +00:00
}
2009-07-02 08:36:04 +00:00
2009-11-18 17:00:59 +00:00
// Erreur infogreffe
2009-07-15 13:02:58 +00:00
if ( strlen ( $xml ) < 200 )
{
2009-11-18 17:00:59 +00:00
$firephp -> info ( 'Erreur Infogreffe' );
$tmp = explode ( '-' , $xml );
$errNum = $tmp [ 0 ] * 1 ;
$errMsg = $xml ;
2009-08-27 07:39:27 +00:00
2009-11-18 17:00:59 +00:00
if ( $message != '' && ! $dejaCommande )
{
2009-07-15 13:02:58 +00:00
?>
2009-11-18 17:00:59 +00:00
< table >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " colspan = " 2 " class = " StyleInfoData " >< h3 >< ? = $message ; ?> </h3></td>
</ tr >
</ table >
2009-07-15 13:02:58 +00:00
< ? php
}
?>
2009-11-18 17:00:59 +00:00
< h1 class = " titre " > PIECES OFFICIELLES </ h1 >
< table >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " 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 " class = " StyleInfoLib " > Raison Sociale </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $raisonSociale ?> </td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td colspan = " 2 " width = " 550 " class = " StyleInfoData " >
< ? php
require_once 'surveillance/surveillance.php' ;
2009-12-15 17:14:21 +00:00
echo getSurveillance ( 'actes' , $siret );
2009-11-18 17:00:59 +00:00
?>
</ td >
</ tr >
</ table >
2009-08-27 07:39:27 +00:00
2009-11-18 17:00:59 +00:00
< h2 > Actes & amp ; Statuts </ h2 >
< table >
2009-07-15 13:02:58 +00:00
< ? php
$tabTmp = explode ( '-' , $option );
$option2 = implode ( '-' , array_splice ( $tabTmp , 0 , - 1 ));
2010-01-15 13:28:25 +00:00
/*
2009-07-15 13:02:58 +00:00
if ( $action != 'commande'
&& ! file_exists ( PATH_DATA . '/pdf/acte-' . $siren . '-' . $option . '.pdf' )
&& ! file_exists ( PATH_DATA . '/pdf/acte-' . $siren . '-' . $option2 . '.pdf' )
&& ( $errNum == 6 || $errNum == 14 || $errNum == 25 || $errNum == 45 || $errNum == 999 ) )
{
include ( 'inpi.php' );
2010-01-15 13:28:25 +00:00
} else
*/
if ( $action != 'commande'
2009-07-15 13:02:58 +00:00
&& ! file_exists ( PATH_DATA . '/pdf/acte-' . $siren . '-' . $option . '.pdf' )
2009-11-18 17:00:59 +00:00
&& ! file_exists ( PATH_DATA . '/pdf/acte-' . $siren . '-' . $option2 . '.pdf' )
)
2009-07-15 13:02:58 +00:00
{
2009-11-18 17:00:59 +00:00
//Message si deja commande ou pas
if ( ! $dejaCommande )
{
2009-07-15 13:02:58 +00:00
?>
2009-11-18 17:00:59 +00:00
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " colspan = " 2 " class = " StyleInfoData " >< font color = " Red " >
< b >
< ? php
if ( $errNum != 17 ) { echo " Erreur N° $errNum - " ; }
?> <?=$tabErrInfoGref[$errNum]?>
<!--< ? = $errMsg ?> -->
</ b ></ font >
</ td >
</ tr >
2009-07-15 13:02:58 +00:00
< ?
2009-11-18 17:00:59 +00:00
}
elseif ( $dejaCommande )
{
2009-07-15 13:02:58 +00:00
?>
2009-11-18 17:00:59 +00:00
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " colspan = " 2 " class = " StyleInfoData " >< font color = " Red " >< b >< ? = $message2 ?> </b></font></td>
</ tr >
< ? php
2009-07-15 13:02:58 +00:00
}
2009-11-18 17:00:59 +00:00
//Affichage formulaire email
if ( ! $dejaCommande && $errNum != 17 && $errNum != 23 && $errNum != 26 && $errNum != 27 )
{
2009-07-15 13:02:58 +00:00
?>
2009-11-18 17:00:59 +00:00
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " colspan = " 2 " class = " StyleInfoData " >
< br />< br />
2010-01-15 13:28:25 +00:00
< form name = " saisiemail " action = " ./?page=greffes&action=commande&siret=<?= $siret ?>&idEntreprise=<?= $idEntreprise ?>&idan=<?= $idan ?>&source=<?= $source ?> " method = " post " >
2009-11-18 17:00:59 +00:00
< input type = " checkbox " /> Recevoir le document directement par mail ( d & eacute ; lai approximatif de 24 heures )
2010-01-29 13:05:57 +00:00
< br />< br /> Adresse email du destinataire < input name = " email " type = " text " value = " <?php if ( $_SESSION['tabInfo'] ['login']<>'testreunica' && $_SESSION['tabInfo'] ['login']<>'reunicacsf') echo $_SESSION['tabInfo'] ['email']?> " size = " 20 " />
2009-11-18 17:00:59 +00:00
& nbsp ; & nbsp ; & nbsp ; < input class = " imgButton " 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 = " Commander le document par e-mail... " />
</ form >
2010-01-15 13:28:25 +00:00
< script type = " text/javascript " >
$ ( document ) . ready ( function (){
$ ( 'form[name=saisiemail]' ) . submit ( function (){
2010-01-28 17:19:25 +00:00
var eMail = $ ( 'input[name=email]' ) . val ();
var isMail = eMail . length ;
var verif = /^ [ a - zA - Z0 - 9_ - ] +@ [ a - zA - Z0 - 9 - ]{ 2 ,}[ . ][ a - zA - Z ]{ 2 , 3 } $ /
if ( ! isMail || verif . exec ( eMail ) == null ){
alert ( 'Veuillez saisir une adresse email.' );
return false ;
2010-01-15 13:28:25 +00:00
}
2010-01-28 17:19:25 +00:00
else { return true ; }
2010-01-15 13:28:25 +00:00
});
});
</ script >
2009-11-18 17:00:59 +00:00
</ td >
</ tr >
2009-07-15 13:02:58 +00:00
< ? php
2009-11-18 17:00:59 +00:00
}
elseif ( $errNum == 17 || ( $noemail && $dejaCommande ) )
{
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 550 " colspan = " 2 " class = " StyleInfoData " >
< br />< br />
2010-01-15 13:28:25 +00:00
< form name = " saisiemail " action = " ./?page=greffes&action=commande&siret=<?= $siret ?>&idEntreprise=<?= $idEntreprise ?>&idan=<?= $idan ?>&source=<?= $source ?> " method = " post " >
2010-02-10 17:27:03 +00:00
Merci de préciser votre mail pour la livraison du document ( d & eacute ; lai approximatif de 24 heures ) < br />< br />
2009-11-18 17:00:59 +00:00
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 ;
2010-02-10 17:27:03 +00:00
< input class = " imgButton " 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 = " Précisez votre e-mail... " ></ form ></ td >
2010-01-15 13:28:25 +00:00
< script type = " text/javascript " >
$ ( document ) . ready ( function (){
$ ( 'form[name=saisiemail]' ) . submit ( function (){
2010-01-28 17:19:25 +00:00
var eMail = $ ( 'input[name=email]' ) . val ();
var isMail = eMail . length ;
var verif = /^ [ a - zA - Z0 - 9_ - ] +@ [ a - zA - Z0 - 9 - ]{ 2 ,}[ . ][ a - zA - Z ]{ 2 , 3 } $ /
if ( ! isMail || verif . exec ( eMail ) == null ){
alert ( 'Veuillez saisir une adresse email.' );
return false ;
2010-01-15 13:28:25 +00:00
}
2010-01-28 17:19:25 +00:00
else { return true ; }
2010-01-15 13:28:25 +00:00
});
});
</ script >
2009-11-18 17:00:59 +00:00
</ tr >
2009-07-15 13:02:58 +00:00
< ?
}
2009-08-27 07:39:27 +00:00
?>
2009-11-18 17:00:59 +00:00
</ table >
2009-07-15 13:02:58 +00:00
< ? php
2009-11-18 17:00:59 +00:00
//}elseif ($action=='commande' && ($errNum==999) ){ include('inpi.php');
} elseif (
$type == 'AC' && $option != ''
&& ( file_exists ( PATH_DATA . '/pdf/acte-' . $siren . '-' . $option . '.pdf' ) || file_exists ( PATH_DATA . '/pdf/acte-' . $siren . '-' . $option2 . '.pdf' ) )
)
2009-07-15 13:02:58 +00:00
{
if ( file_exists ( PATH_DATA . '/pdf/acte-' . $siren . '-' . $option2 . '.pdf' )) $option = $option2 ;
/** Le document n'est pas dispo chez Infogreffe **/
?>
2009-11-18 17:00:59 +00:00
< table >
< tr >
< td width = " 580 " colspan = " 3 " >
< table style = " width:530px;margin-top:5px;margin-bottom:5px;margin-left:10px;margin-right:10px " class = " table-classic " >
< tr class = " titre " >
< td class = " titre " style = " width:70px " > Date </ td >
< td align = " center " class = " titre " style = " width:200px " > Type </ td >
< td align = " center " class = " titre " style = " width:260px " > D & eacute ; cisions </ td >
</ tr >
2009-12-11 11:42:41 +00:00
< ? php
//$date=$dom_object->getValueFromTag('date_acte');
$tabOptions = explode ( '-' , $option );
$acte = array ();
if ( ! isset ( $typeActes [ 'a' . $tabOptions [ 0 ]]))
{
mail ( 'ylenaour@scores-decisions.com' ,
" Type d'acte inconnu pour $siren " ,
" acte- $siren - $option .pdf " );
} else
$acte [ 'type' ] = $typeActes [ 'a' . $tabOptions [ 0 ]];
$acte [ 'depot_num' ] = $tabOptions [ 6 ];
$dateAff = WDate :: dateT ( 'Ymd' , 'd/m/Y' , $tabOptions [ 1 ]);
?>
2009-11-18 17:00:59 +00:00
< tr class = " ligne " >
< td style = " width:13% " class = " titre " >< ? = $dateAff ?> </td>
< td style = " width:39%;text-align:center " class = " std " >
< ? php
2009-12-10 09:54:47 +00:00
if ( preg_match ( '/\bACTES\b/i' , $_SESSION [ 'tabInfo' ][ 'droits' ]))
2009-11-18 17:00:59 +00:00
{
?>
< u >< a title = " Cliquez ici pour visualiser le document correspondant " target = " _blank " href = " /?page=actes&siret=<?= $siret ?>&ref=<?= $option ?> " >< ? = $acte [ 'type' ] ?> </a></u>
< ? php
} else {
?>
2010-02-10 17:27:03 +00:00
< u >< a title = " Vous n'avez pas les droits nécessaires pour visualiser le document correspondant " href = " # " >< ? = $acte [ 'type' ] ?> </a></u>
2009-11-18 17:00:59 +00:00
< ? php
}
?>
</ td >
2010-02-10 17:27:03 +00:00
< td style = " width:48% " class = " last " >< ? = $acte [ 'decisions' ]; if ( trim ( $acte [ 'decisions' ]) <> '' ) echo '<br/>' ; ?> Dépôt numéro <?=$acte['depot_num']?></td>
2009-11-18 17:00:59 +00:00
</ tr >
</ table >
</ td >
</ tr >
</ table >
2009-07-15 13:02:58 +00:00
< ? php
2009-02-17 13:14:53 +00:00
// LOG DE LA PAGE
2009-04-02 15:10:11 +00:00
$O2 = $client -> setLog ( 'greffe_' . $vue , $siret , 0 , $option );
2009-07-15 13:02:58 +00:00
}
// Log de la page
$O2 = $client -> setLog ( 'greffe_' . $vue , $siret , 0 , " Erreur $errNum " );
2009-11-18 17:00:59 +00:00
}
//Fin d'affichage des erreurs infogreffe
2009-08-21 07:19:35 +00:00
else
2009-11-18 17:00:59 +00:00
{
2010-02-10 17:27:03 +00:00
// Liste des "actes" Infogreffes ou détail acte infogreffe
2009-07-15 13:02:58 +00:00
//if ($output=='pdf') $type=$type.'-pdf';
if ( $type == 'AC' && $option == '' )
{
// Liste des actes Infogreffe
$return = xmlArrayActes ( PATH_DATA . '/infogreffe/xml/' . $fichier );
$tabActes = $return [ 'Actes' ];
$vecteurTinit = $return [ 'vecteurTinit' ];
$nbVecteurT = $return [ 'nbVecteurT' ];
$nbActes = $return [ 'nbActes' ];
if ( ! $vecteurTinit ) {
$origine = 'G' ;
2010-01-27 08:00:31 +00:00
//include('inpi.php');
2009-12-04 17:17:09 +00:00
}
2009-06-02 10:42:59 +00:00
2009-07-15 13:02:58 +00:00
if ( $vecteurTinit )
2009-11-18 17:00:59 +00:00
{
2010-02-10 17:27:03 +00:00
// Il y a au moins un acte en téléchargement
2009-07-15 13:02:58 +00:00
?>
2009-11-18 17:00:59 +00:00
< h1 class = " " > PI & Eacute ; CES OFFICIELLES </ h1 >
< table >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " 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 " class = " StyleInfoLib " > Raison Sociale </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $raisonSociale ?> </td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td colspan = " 2 " width = " 550 " class = " StyleInfoData " >
< ? php
require_once 'surveillance/surveillance.php' ;
2009-12-15 17:14:21 +00:00
echo getSurveillance ( 'actes' , $siret );
2009-11-18 17:00:59 +00:00
?>
</ td >
</ tr >
</ table >
< h2 > Actes & amp ; Statuts </ h2 >
< table >
< tr >
< td width = " 580 " colspan = " 3 " >
< table style = " width:530px;margin-top:5px;margin-bottom:5px;margin-left:10px;margin-right:10px " class = " table-classic " >
< tr class = " titre " >
< td class = " titre " style = " width:70px " > Date </ td >
< td align = " center " class = " titre " style = " width:200px " > Type </ td >
< td align = " center " class = " titre " style = " width:260px " > D & eacute ; cisions </ td >
</ tr >
2009-07-15 13:02:58 +00:00
< ? php
2009-12-18 14:32:02 +00:00
$offset = 0 ;
foreach ( $tabActes as $date => $acte )
{
if ( $acte [ 'num_depot' ] < 0 )
{
$acte_statut_a_jour = $tabActes [ $date ];
array_splice ( $tabActes , $offset , 1 );
$tabActes [ '99999999' ] = $acte_statut_a_jour ;
break ;
}
$offset ++ ;
}
2009-07-15 13:02:58 +00:00
krsort ( $tabActes );
2009-12-18 14:32:02 +00:00
foreach ( $tabActes as $date => $acte )
2009-11-18 17:00:59 +00:00
{
2009-12-11 11:42:41 +00:00
if ( $acte [ 'num_depot' ] > 0 )
{
2009-12-18 14:32:02 +00:00
$date = WDate :: dateT ( 'Y-m-d' , 'd/m/Y' , substr ( $date , 0 , 10 ));
$dateRef = WDate :: dateT ( 'd/m/Y' , 'Ymd' , substr ( $date , 0 , 10 ));
$optionUrl = $acte [ 'type_acte' ] . " - $dateRef - " . $acte [ 'num_gest_greffe' ] . '-' . $acte [ 'num_gest_millesime' ] . '-' . $acte [ 'num_gest_statut' ] . '-' . $acte [ 'num_gest_chrono' ] . '-' . $acte [ 'num_depot' ] . '-' . $acte [ 'num_acte' ];
}
else
{
$date = '' ;
$dateRef = date ( 'Y' ) . date ( 'm' ) . date ( 'd' );
$optionUrl = 'ST-' . $dateRef . '-' . $acte [ 'num_gest_greffe' ] . '-' . $acte [ 'num_gest_millesime' ] . '-' . $acte [ 'num_gest_statut' ] . '-' . $acte [ 'num_gest_chrono' ];
}
2009-07-15 13:02:58 +00:00
?>
2009-11-18 17:00:59 +00:00
< tr class = " ligne " >
< td style = " width:13% " class = " titre " >< ? = $date ?> </td>
< td style = " width:39%;text-align:center " class = " std " >< ? = $acte [ 'type' ] ?>
< ? php
2009-07-15 13:02:58 +00:00
//Comment des marqueurs petits points
2009-11-18 17:00:59 +00:00
if ( $acte [ 'vecteurT' ])
{
2010-01-14 10:39:02 +00:00
$lienCmdFactice = true ;
$tag = '<a' ;
if ( file_exists ( PATH_DATA . '/pdf/acte-' . $siren . '-' . $optionUrl . '.pdf' ) &&
filesize ( PATH_DATA . '/pdf/acte-' . $siren . '-' . $optionUrl . '.pdf' ) != 0 )
2009-11-18 17:00:59 +00:00
{
2010-01-14 10:39:02 +00:00
$tag = '. ' . $tag ;
$lienCmdFactice = false ;
2009-07-15 13:02:58 +00:00
}
2009-12-11 12:34:22 +00:00
$href = './?page=greffes&vue=actes&siret=' . $siret . '&option=' . $optionUrl . '&lib=' . urlencode ( $acte [ 'decisions' ]);
2009-07-15 13:02:58 +00:00
$title = 'Cliquez ici pour télécharger le document correspondant' ;
2009-09-01 07:18:54 +00:00
$tagContent = '<img src="./img/icone_pdf.gif"/>' ;
2009-12-10 09:54:47 +00:00
if ( preg_match ( '/\bACTES\b/i' , $_SESSION [ 'tabInfo' ][ 'droits' ])){
2010-01-14 10:39:02 +00:00
echo $tag . ' href="' . $href . '" title="' . $title . '">' . $tagContent . '</a>' ;
2009-07-15 13:02:58 +00:00
} else {
2010-02-10 17:27:03 +00:00
echo $tag . ' href="#" title="Vous n\'avez pas les droits nécessaires pour visualiser le document correspondant.">' . $tagContent . '</a>' ;
2010-01-14 10:39:02 +00:00
}
if ( hasModeEdition () && $lienCmdFactice )
{
2010-02-10 17:27:03 +00:00
echo '<br/><a href="./pages/greffescmdfactice.php?siret=' . $siret . '&option=' . $optionUrl . '&lib=' . urlencode ( $acte [ 'decisions' ]) . '&vecteur=factice" target="_blank">Créer une commande factice.</a>' ;
2009-07-15 13:02:58 +00:00
}
2009-11-18 17:00:59 +00:00
}
elseif ( $acte [ 'vecteurC' ])
{
2010-01-13 16:39:13 +00:00
if ( file_exists ( PATH_DATA . '/pdf/acte-' . $siren . '-' . $optionUrl . '.pdf' )
2010-01-14 10:39:02 +00:00
&& filesize ( PATH_DATA . '/pdf/acte-' . $siren . '-' . $optionUrl . '.pdf' ) != 0 )
2010-01-13 16:39:13 +00:00
{
2009-07-15 13:02:58 +00:00
$tag = '. <a' ;
$href = './?page=greffes&vue=actes&siret=' . $siret . '&option=' . $optionUrl ;
$title = 'Cliquez ici pour télécharger le document correspondant' ;
2009-09-01 07:18:54 +00:00
$tagContent = '<img src="./img/icone_pdf.gif"/>' ;
2009-12-10 09:54:47 +00:00
if ( preg_match ( '/\bACTES\b/i' , $_SESSION [ 'tabInfo' ][ 'droits' ])){
2010-01-14 10:27:17 +00:00
echo $tag . ' href="' . $href . '" title="' . $title . '">' . $tagContent . '</a>' ;
2009-07-15 13:02:58 +00:00
} else {
2010-02-10 17:27:03 +00:00
echo $tag . ' href="#" title="Vous n\'avez pas les droits nécessaires pour visualiser le document correspondant.">' . $tagContent . '</a>' ;
2010-01-14 10:27:17 +00:00
}
2010-01-13 16:39:13 +00:00
}
else
{
2009-07-15 13:02:58 +00:00
$tag = '<a' ;
2010-01-20 11:35:23 +00:00
if ( $acte [ 'num_depot' ] > 0 ){
$href = './?page=greffes&vue=actes&siret=' . $siret . '&option=' . $optionUrl . '&lib=' . urlencode ( $acte [ 'decisions' ]) . '&vecteur=C' ;
} else {
$href = './?page=greffes&vue=statuts&siret=' . $siret . '&option=' . $optionUrl . '&lib=' . urlencode ( $acte [ 'decisions' ]) . '&vecteur=C' ;
}
2009-07-15 13:02:58 +00:00
$title = 'Cliquez ici pour commander le document correspondant' ;
2009-09-01 07:18:54 +00:00
$tagContent = '<img src="./img/icone_courrier.png"/>' ;
2009-12-10 09:54:47 +00:00
if ( preg_match ( '/\bACTES\b/i' , $_SESSION [ 'tabInfo' ][ 'droits' ])){
2010-01-14 10:27:17 +00:00
echo $tag . ' href="' . $href . '" title="' . $title . '">' . $tagContent . '</a>' ;
2009-07-15 13:02:58 +00:00
} else {
2010-02-10 17:27:03 +00:00
echo $tag . ' href="#" title="Vous n\'avez pas les droits nécessaires pour commander le document correspondant.">' . $tagContent . '</a>' ;
2009-07-15 13:02:58 +00:00
}
2010-01-13 16:39:13 +00:00
if ( hasModeEdition ())
{
2010-02-10 17:27:03 +00:00
echo '<br/><a href="./pages/greffescmdfactice.php?siret=' . $siret . '&option=' . $optionUrl . '&lib=' . urlencode ( $acte [ 'decisions' ]) . '&vecteur=factice" target="_blank">Créer une commande factice.</a>' ;
2010-01-13 16:39:13 +00:00
}
2009-07-15 13:02:58 +00:00
}
}
?>
2009-11-18 17:00:59 +00:00
</ td >
2009-12-18 14:32:02 +00:00
< ? php
if ( $acte [ 'num_depot' ] > 0 ){
?>
2010-02-10 17:27:03 +00:00
< td style = " width:48% " class = " last " >< ? = $acte [ 'decisions' ]; if ( trim ( $acte [ 'decisions' ]) <> '' ) echo '<br/>' ; ?> Dépôt numéro <?=$acte['depot_num']?> du <?=WDate::dateT('Y-m-d','d/m/Y', $acte['depot_date'])?></td>
2009-12-18 14:32:02 +00:00
< ? php
} else {
?>
2010-02-10 17:27:03 +00:00
< td style = " width:48% " class = " last " > Le dernier statut à jour </ td >
2009-12-18 14:32:02 +00:00
< ? php
}
?>
2009-11-18 17:00:59 +00:00
</ tr >
< ? php
2009-07-15 13:02:58 +00:00
}
?>
2009-11-18 17:00:59 +00:00
</ table >
</ td >
</ tr >
2009-07-15 13:02:58 +00:00
< ? php
// LOG DE LA PAGE
$O2 = $client -> setLog ( 'greffe_' . $vue , $siret , 0 , $option );
2010-02-10 17:27:03 +00:00
/* if ( $nbVecteurT < $nbActes ) { // Tous les actes ne sont pas dispo en téléchargement, on propose donc l'accès INPI
2009-11-18 17:00:59 +00:00
/* $origine = 'G' ;
include ( 'inpi.php' );
2009-07-15 13:02:58 +00:00
?>
2009-11-18 17:00:59 +00:00
< tr >
2010-02-10 17:27:03 +00:00
< td align = " center " class = " StyleInfoData " colspan = " 3 " >< a href = " ./?<?= $_SERVER['QUERY_STRING'] ?>&vue=rcs " > Tous les actes ne sont pas disponibles en t & eacute ; l & eacute ; chargement immédiat .< br /> Cliquez - ici pour les commander en t & eacute ; l & eacute ; chargement diff & eacute ; r & eacute ; </ a ></ td >
2009-11-18 17:00:59 +00:00
</ tr >
< ?
2009-10-08 13:20:51 +00:00
} */
2009-07-15 13:02:58 +00:00
?>
2009-11-18 17:00:59 +00:00
</ table >
2009-07-15 13:02:58 +00:00
< ? php
}
2009-08-27 07:39:27 +00:00
//Affichage statut et acte infogreffe
2009-11-18 17:00:59 +00:00
}
elseif ( $type == 'ST' || ( $type == 'AC' && $option != '' ))
{
?>
< h1 class = " " > PI & Eacute ; CES OFFICIELLES </ h1 >
< table >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " 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 " class = " StyleInfoLib " > Raison Sociale </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $raisonSociale ?> </td>
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td colspan = " 2 " width = " 550 " class = " StyleInfoData " >
< ? php
require_once 'surveillance/surveillance.php' ;
2009-12-15 17:14:21 +00:00
echo getSurveillance ( 'actes' , $siret );
2009-11-18 17:00:59 +00:00
?>
</ td >
</ tr >
</ table >
< h2 > Actes & amp ; Statuts </ h2 >
< table >
< tr >
< td width = " 580 " colspan = " 3 " >
< table style = " width:530px;margin-top:5px;margin-bottom:5px;margin-left:10px;margin-right:10px " class = " table-classic " >
< tr class = " titre " >
< td class = " titre " style = " width:70px " > Date </ td >
< td align = " center " class = " titre " style = " width:200px " > Type </ td >
< td align = " center " class = " titre " style = " width:260px " > D & eacute ; cisions </ td >
</ tr >
< ? php
$dom_object = new DomDocument2 ();
$dom_object -> load ( PATH_DATA . '/infogreffe/xml/' . $fichier );
2009-07-15 13:02:58 +00:00
2009-11-18 17:00:59 +00:00
$acte [ 'type' ] = $dom_object -> getValueFromTag ( 'type_acte_libelle' );
$date = $dom_object -> getValueFromTag ( 'date_acte' );
2009-07-15 13:02:58 +00:00
2009-11-18 17:00:59 +00:00
$acte [ 'depot_num' ] = $dom_object -> getValueFromTag ( 'num_depot' );
$acte [ 'depot_date' ] = $dom_object -> getValueFromTag ( 'date_depot' );
$dateAff = WDate :: dateT ( 'Y-m-d' , 'd/m/Y' , substr ( $date , 0 , 10 ));
2009-07-15 13:02:58 +00:00
2009-11-18 17:00:59 +00:00
$acte [ 'url_acces' ] = $dom_object -> getValueFromTag ( 'url_acces' );
if ( substr ( $acte [ 'url_acces' ], 0 , 5 ) == 'null/' ) $acte [ 'url_acces' ] = 'http://webservices.infogreffe.fr/' . substr ( $acte [ 'url_acces' ], 5 , strlen ( $acte [ 'url_acces' ]) - 5 );
2009-07-15 13:02:58 +00:00
2009-11-18 17:00:59 +00:00
$nbPages = $dom_object -> getValueFromTag ( 'nbpages_acte' ) * 1 ;
if ( $nbPages > 0 ) $acte [ 'decisions' ] = " $nbPages pages " ;
?>
< tr class = " ligne " >
< td style = " width:13% " class = " titre " >< ? = $dateAff ?> </td>
< td style = " width:39%;text-align:center " class = " std " >
< ? php /** Gestion des droits pour l'affichage des liens **/ ?>
< u >< a title = " Cliquez ici pour visualiser le document correspondant " target = " _blank " href = " /?page=actes&siret=<?= $siret ?>&ref=<?= $option ?> " >< ? = $acte [ 'type' ] ?> </a></u>
</ td >
< td style = " width:48% " class = " last " >
2010-02-10 17:27:03 +00:00
< ? = $acte [ 'decisions' ]; if ( trim ( $acte [ 'decisions' ]) <> '' ) echo '<br/>' ; ?> Dépôt numéro <?=$acte['depot_num']?> du <?=WDate::dateT('Y-m-d','d/m/Y', $acte['depot_date'])?>
2009-11-18 17:00:59 +00:00
</ td >
</ tr >
</ table >
</ td >
</ tr >
</ table >
2009-07-15 13:02:58 +00:00
< ? php
2010-02-10 17:27:03 +00:00
/* Si l'acte n'a pas encore été téléchargé, on le télécharge */
2009-07-15 13:02:58 +00:00
if ( ! file_exists ( PATH_DATA . '/pdf/acte-' . $siren . '-' . $option . '.pdf' )
|| filesize ( PATH_DATA . '/pdf/acte-' . $siren . '-' . $option . '.pdf' ) == 0 )
{
$page = getUrl ( $acte [ 'url_acces' ], '' , '' , '' , false , '' , '' , 0 , 1 );
if ( substr ( $page [ 'body' ], 0 , 4 ) != '%PDF' ) {
$page2 = parse_response ( $page [ 'body' ]);
$body = $page2 [ 'body' ];
2009-07-02 08:36:04 +00:00
} else
2009-07-15 13:02:58 +00:00
$body = $page [ 'body' ];
$fp =@ fopen ( PATH_DATA . '/pdf/' . 'acte-' . $siren . '-' . $option . '.pdf' , 'w' );
2009-06-02 10:42:59 +00:00
@ fwrite ( $fp , $body );
@ fclose ( $fp );
2009-07-02 08:36:04 +00:00
}
2009-07-15 13:02:58 +00:00
// LOG DE LA PAGE
$O2 = $client -> setLog ( 'greffe_' . $vue , $siret , 0 , $option );
//Affichage de la liste des bilans image ou saisit
2009-08-21 07:19:35 +00:00
}
elseif ( $type == 'BS' || $type == 'BI' )
{
2009-07-15 13:02:58 +00:00
?>
2009-11-18 17:00:59 +00:00
< h1 class = " " > PI & Eacute ; CES OFFICIELLES </ h1 >
< table >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td width = " 200 " 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 " class = " StyleInfoLib " > Raison Sociale </ td >
< td width = " 350 " class = " StyleInfoData " >< ? = $raisonSociale ?> </td>
</ tr >
< tr >
</ table >
< h2 > Comptes annuels </ h2 >
< table >
< tr >
< td width = " 580 " colspan = " 3 " >
< table style = " width:530px;margin-top:5px;margin-bottom:5px;margin-left:10px;margin-right:10px " class = " table-classic " >< tr class = " titre " >< td class = " titre " style = " width:70px " > Date de cl & ocirc ; ture </ td >< td align = " center " class = " titre " style = " width:200px " > Type </ td >< td align = " center " class = " titre " style = " width:260px " > D & eacute ; cisions </ td ></ tr >
< ? php
if ( $type == 'BS' ) $query = " //listeBilanSaisi/bilanSaisi/. " ;
elseif ( $type == 'BI' ) $query = " //bilan_complet/. " ;
2010-01-04 09:47:31 +00:00
$firephp -> log ( $fichier , 'fichier' );
2009-11-18 17:00:59 +00:00
$return = xmlArrayBilans ( PATH_DATA . '/infogreffe/xml/' . $fichier , $query );
$tabActes = $return [ 'Actes' ];
2010-01-04 09:47:31 +00:00
2010-01-04 09:20:10 +00:00
foreach ( $tabActes as $typeMillesime => $bilan )
2009-11-18 17:00:59 +00:00
{
if ( $type == 'BS' ) $dateClot = WDate :: dateT ( 'Y-m-d' , 'd/m/Y' , $bilan [ 'date_cloture' ]);
elseif ( $type == 'BI' ) $dateClot = $bilan [ 'date_cloture' ];
$dateRef = WDate :: dateT ( 'd/m/Y' , 'Ymd' , $dateClot );
$optionUrl = $bilan [ 'millesime' ] . '_' . $bilan [ 'type_comptes' ] . '-' . $dateRef . '-' . $bilan [ 'num_gest_greffe' ] . '-' . $bilan [ 'num_gest_millesime' ] . '-' . $bilan [ 'num_gest_statut' ] . '-' . $bilan [ 'num_gest_chrono' ] . '-' . $bilan [ 'num_depot' ];
?>
< tr class = " ligne " >
< td style = " width:13% " class = " titre " >< ? = $dateClot ?> </td>
< td style = " width:39%;text-align:center " class = " std " >
2009-07-15 13:02:58 +00:00
< ? php
2009-11-18 17:00:59 +00:00
if ( $option != '' )
{
2010-02-10 17:27:03 +00:00
/* Si l'acte n'a pas encore été téléchargé, on le télécharge */
2009-11-18 17:00:59 +00:00
if ( ! file_exists ( PATH_DATA . '/pdf/bilan-' . $siren . '-' . $option . '.pdf' )
|| filesize ( PATH_DATA . '/pdf/bilan-' . $siren . '-' . $option . '.pdf' ) == 0 )
{
$page = getUrl ( $bilan [ 'url_acces' ], '' , '' , '' , false , '' , '' , 0 , 1 );
//die($bilan['url_acces'].'<br/><br/>'.print_r($page));
if ( substr ( $page [ 'body' ], 0 , 4 ) <> '%PDF' ) {
$page2 = parse_response ( $page [ 'body' ]);
$body = $page2 [ 'body' ];
} else
$body = $page [ 'body' ];
$fp = @ fopen ( PATH_DATA . '/pdf/' . 'bilan-' . $siren . '-' . $option . '.pdf' , 'w' );
@ fwrite ( $fp , $body );
@ fclose ( $fp );
}
?>
< ? php /** Gestion des droits pour l'affichage des liens **/ ?>
< u >< a title = " Cliquez ici pour visualiser la copie intégrale des comptes " target = " _blank " href = " /?page=actes&siret=<?= $siret ?>&ref=bilan-<?= $option ?> " > Comptes < ? = $bilan [ 'type_comptes' ] ?> millésime <?=$bilan['millesime']; if ($type=='BS') echo '<br/>(liasse '.$bilan['liasse'].')';?></a></u>
< ? php
}
else
{
2010-02-10 17:27:03 +00:00
/** Liste des comptes déposés **/
2009-07-15 13:02:58 +00:00
?>
2009-11-18 17:00:59 +00:00
Comptes < ? = $bilan [ 'type_comptes' ] ?> millésime <?=$bilan['millesime'];
if ( $type == 'BS' ) echo '<br/>(liasse ' . $bilan [ 'liasse' ] . ')' ; ?>
< ? php
2010-01-04 13:38:15 +00:00
if ( $bilan [ 'vecteurT' ] )
2009-11-18 17:00:59 +00:00
{
$tag = '<a' ;
$href = './?page=greffes&vue=bilans&siret=' . $siret . '&option=' . $optionUrl ;
$title = 'Cliquez ici pour télécharger la copie intégrale des comptes' ;
$tagContent = '' ;
if ( file_exists ( PATH_DATA . '/pdf/bilan-' . $siren . '-' . $optionUrl . '.pdf' ) && filesize ( PATH_DATA . '/pdf/bilan-' . $siren . '-' . $optionUrl . '.pdf' ) != 0 )
$tagContent = ' .' ;
$tagContent .= '<img src="./img/icone_pdf.gif"/>' ;
2009-12-10 09:54:47 +00:00
if ( preg_match ( '/\bACTES\b/i' , $_SESSION [ 'tabInfo' ][ 'droits' ])){
2009-11-18 17:00:59 +00:00
print $tag . ' href="' . $href . '" title="' . $title . '">' . $tagContent . '</a>' ;
} else {
2010-02-10 17:27:03 +00:00
print $tag . ' href="#" title="Vous n\'avez pas les droits nécessaires pour visualiser le document correspondant.">' . $tagContent . '</a>' ;
2009-11-18 17:00:59 +00:00
}
}
2010-01-04 13:38:15 +00:00
elseif ( $bilan [ 'vecteurC' ] )
2009-11-18 17:00:59 +00:00
{
if ( file_exists ( PATH_DATA . '/pdf/bilan-' . $siren . '-' . $optionUrl . '.pdf' ) && filesize ( PATH_DATA . '/pdf/bilan-' . $siren . '-' . $optionUrl . '.pdf' ) != 0 ){
$tag = '<a' ;
$href = './?page=greffes&vue=bilans&siret=' . $siret . '&option=' . $optionUrl ;
$title = 'Cliquez ici pour télécharger la copie intégrale des comptes' ;
$tagContent = ' .<img src="./img/icone_pdf.gif"/>' ;
2009-12-10 09:54:47 +00:00
if ( preg_match ( '/\bACTES\b/i' , $_SESSION [ 'tabInfo' ][ 'droits' ])){
2010-01-04 13:38:15 +00:00
echo $tag . ' href="' . $href . '" title="' . $title . '">' . $tagContent . '</a>' ;
2009-11-18 17:00:59 +00:00
} else {
2010-02-10 17:27:03 +00:00
echo $tag . ' href="#" title="Vous n\'avez pas les droits nécessaires pour visualiser le document correspondant.">' . $tagContent . '</a>' ;
2009-07-15 13:02:58 +00:00
}
2009-11-18 17:00:59 +00:00
} else {
$tag = '<a' ;
$href = './?page=greffes&vue=bilans&siret=' . $siret . '&option=' . $optionUrl . '&vecteur=C' ;
$title = 'Cliquez ici pour commander la copie intégrale des comptes' ;
$tagContent = '<img src="./img/icone_courrier.png"/>' ;
2009-12-10 09:54:47 +00:00
if ( preg_match ( '/\bACTES\b/i' , $_SESSION [ 'tabInfo' ][ 'droits' ])){
2010-01-04 13:38:15 +00:00
echo $tag . ' href="' . $href . '" title="' . $title . '">' . $tagContent . '</a>' ;
2009-11-18 17:00:59 +00:00
} else {
2010-02-10 17:27:03 +00:00
echo $tag . ' href="#" title="Vous n\'avez pas les droits nécessaires pour commander le document correspondant.">' . $tagContent . '</a>' ;
2009-07-15 13:02:58 +00:00
}
}
}
2010-01-04 13:38:15 +00:00
elseif ( $_SESSION [ 'tabInfo' ][ 'mode_edition' ] == 1 )
{
$href = './?page=greffes&vue=bilans&siret=' . $siret . '&option=' . $optionUrl ;
2010-02-10 17:27:03 +00:00
echo '<br/><a href="' . $href . '" >Forcer téléchargement.</a>' ;
2010-01-04 13:38:15 +00:00
}
2009-11-18 17:00:59 +00:00
}
?>
</ td >
< td style = " width:48% " class = " last " > D & eacute ; p & ocirc ; t num & eacute ; ro < ? = $bilan [ 'num_depot' ] ?> .</td></tr>
< ? php
} // Fin parcours liste bilan
?>
</ table >
</ td >
</ tr >
</ table >
2009-07-15 13:02:58 +00:00
< ? php
2009-02-17 13:14:53 +00:00
// LOG DE LA PAGE
2009-04-02 15:10:11 +00:00
$O2 = $client -> setLog ( 'greffe_' . $vue , $siret , 0 , $option );
2009-07-02 08:36:04 +00:00
2009-08-21 07:19:35 +00:00
}
elseif ( file_exists ( PATH_DATA . '/infogreffe/xsl/' . $type . '.xsl' ))
{
2009-07-15 13:02:58 +00:00
exec ( '/usr/bin/xsltproc ' . PATH_DATA . '/infogreffe/xsl/' . $type . '.xsl ' . PATH_DATA . '/infogreffe/xml/' . $fichier , $output );
$output = implode ( '' , $output );
$output = str_replace ( '<html xmlns:fo="http://www.w3.org/1999/XSL/Format"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><link rel="stylesheet" type="text/css" href="./css/infogreffe_base.css"><link rel="stylesheet" type="text/css" href="./css/infogreffe.css"><title>Extrait RCS</title><script type="text/javascript" src="./js/infogreffe/tools.js"></script></head><body class="simple" onload="adapterDimensions(\'conteneur\');">' , '' , $output );
$output = str_replace ( '</body></html><script>function PrivoxyWindowOpen(a, b, c){return(window.open(a, b, c));}</script>' , '' , $output );
$output = 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 , $output );
echo $output ;
// LOG DE LA PAGE
$O2 = $client -> setLog ( 'greffe_' . $vue , $siret , 0 , $option );
} else {
echo " <pre> $xml </pre> " ;
// LOG DE LA PAGE
$O2 = $client -> setLog ( 'greffe_' . $vue , $siret , 0 , $option );
}
2010-02-10 17:27:03 +00:00
} //Fin liste des actes infogreffe ou détails
2009-11-18 17:00:59 +00:00
} //Fin hors Alsace DOM
} //Fin test droit et connexion
2009-09-01 07:18:54 +00:00
?>
</ div >