2009-10-02 09:24:43 +00:00
|
|
|
<?php
|
|
|
|
if (!$_SESSION['connected']) {
|
2010-02-10 17:27:03 +00:00
|
|
|
echo ('Vous devez être connecté afin de pouvoir utiliser cette fonctionnalité');
|
2009-10-02 09:24:43 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
require_once 'cache/cache.php';
|
|
|
|
|
2010-03-18 14:57:23 +00:00
|
|
|
$siret = trim(preg_replace('/[^0-9]/', '', $_REQUEST['siret']));
|
|
|
|
if (strlen($siret)<>0 && strlen($siret)<>9 && strlen($siret)<>14)
|
2010-02-18 17:27:48 +00:00
|
|
|
die('Paramètres incorrects !');
|
2009-10-02 09:24:43 +00:00
|
|
|
|
2010-03-18 14:57:23 +00:00
|
|
|
$idEntreprise=trim(preg_replace('/[^0-9]/', '', $_REQUEST['idEntreprise']))*1;
|
|
|
|
if (($siret*1)==0 && $idEntreprise==0)
|
2010-02-18 17:27:48 +00:00
|
|
|
die('Paramètres incorrects !');
|
2010-03-18 14:57:23 +00:00
|
|
|
$siren = substr($siret,0,9);
|
2010-03-18 15:35:57 +00:00
|
|
|
$raisonSociale = etabSession($siren, $idEntreprise);
|
2009-10-02 09:24:43 +00:00
|
|
|
|
|
|
|
if (($siret*1)==0 || ($siren*1)<100){ $fileName = $page.'-'.$idEntreprise;
|
|
|
|
}else{ $fileName = $page.'-'.$siret; }
|
|
|
|
cache_filename($fileName);
|
|
|
|
|
2009-12-10 09:54:47 +00:00
|
|
|
if( cache_exist() && !( preg_match('/\bsaisie\b/i', $_SESSION['tabInfo']['droits']) || $_SESSION['tabInfo']['mode_edition']==1 ) )
|
2009-10-02 09:24:43 +00:00
|
|
|
{
|
2010-02-18 17:27:48 +00:00
|
|
|
$rbanque = cache_get('rbanque');
|
2009-10-02 09:24:43 +00:00
|
|
|
}else{
|
|
|
|
try {
|
|
|
|
$O = $client->getBanques($siren);
|
|
|
|
$rbanque = $O['results'];
|
|
|
|
cache_delete();
|
|
|
|
cache_add('rbanque', $rbanque);
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
require_once 'soaperror.php';
|
|
|
|
processSoapFault($client,$fault,$_SESSION['tabInfo']);
|
|
|
|
$soaperror = true;
|
|
|
|
}
|
2010-02-18 17:27:48 +00:00
|
|
|
}
|
2009-10-02 09:24:43 +00:00
|
|
|
?>
|
|
|
|
<style type="text/css">
|
2010-02-18 17:27:48 +00:00
|
|
|
ul.relation {
|
|
|
|
list-style-type: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
ul.relation li {
|
|
|
|
clear: both;
|
|
|
|
}
|
|
|
|
|
|
|
|
.banque {
|
|
|
|
text-decoration: underline;
|
|
|
|
width: 35%;
|
|
|
|
float: left;
|
|
|
|
margin-bottom: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.adresse {
|
|
|
|
width: 30%;
|
|
|
|
float: left;
|
|
|
|
margin-bottom: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.codeBanque {
|
|
|
|
width: 10%;
|
|
|
|
float: left
|
|
|
|
}
|
|
|
|
|
|
|
|
.codeGuichet {
|
|
|
|
width: 10%;
|
|
|
|
float: left;
|
|
|
|
}
|
|
|
|
|
2009-10-02 17:26:29 +00:00
|
|
|
.clearfix:after {
|
2010-02-18 17:27:48 +00:00
|
|
|
content: ".";
|
|
|
|
display: block;
|
|
|
|
height: 0;
|
|
|
|
clear: both;
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
2009-10-02 09:24:43 +00:00
|
|
|
</style>
|
|
|
|
<div id="center">
|
2009-10-02 17:26:29 +00:00
|
|
|
<h1 class="titre">RELATIONS BANCAIRES</h1>
|
2009-10-02 09:24:43 +00:00
|
|
|
|
|
|
|
<table>
|
2010-02-18 17:27:48 +00:00
|
|
|
<tr>
|
|
|
|
<td width="30"> </td>
|
|
|
|
<td width="200" class="StyleInfoLib">Numé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"> </td>
|
|
|
|
<td width="200" class="StyleInfoLib">Raison Sociale</td>
|
2010-03-26 14:27:57 +00:00
|
|
|
<td width="350" class="StyleInfoData"><?=$raisonSociale?></td>
|
2010-02-18 17:27:48 +00:00
|
|
|
</tr>
|
2009-10-02 09:24:43 +00:00
|
|
|
</table>
|
|
|
|
|
2009-10-02 17:26:29 +00:00
|
|
|
<h2>Liste des relations bancaires</h2>
|
2010-02-18 17:27:48 +00:00
|
|
|
<?php
|
2009-10-02 09:24:43 +00:00
|
|
|
if( count($rbanque)==0 && isset($soaperror) )
|
|
|
|
{
|
2010-02-18 17:27:48 +00:00
|
|
|
?>
|
2010-02-10 17:27:03 +00:00
|
|
|
<p>Impossible de récupérer les informations.</p>
|
2010-02-18 17:27:48 +00:00
|
|
|
<?php
|
2009-10-02 09:24:43 +00:00
|
|
|
}
|
|
|
|
elseif( count($rbanque)==0 )
|
|
|
|
{
|
2010-02-18 17:27:48 +00:00
|
|
|
?>
|
|
|
|
<div class="blockh2">
|
2009-10-02 17:26:29 +00:00
|
|
|
<p>Aucune information.</p>
|
2010-02-18 17:27:48 +00:00
|
|
|
</div>
|
|
|
|
<?php
|
2009-10-02 09:24:43 +00:00
|
|
|
}
|
|
|
|
elseif( count($rbanque)>0 )
|
|
|
|
{
|
|
|
|
?>
|
2010-02-18 17:27:48 +00:00
|
|
|
<ul class="relation clearfix">
|
|
|
|
<?php
|
|
|
|
$firephp->log($rbanque, 'rbanque');
|
|
|
|
foreach($rbanque as $relation)
|
|
|
|
{
|
2009-10-02 09:24:43 +00:00
|
|
|
?>
|
|
|
|
<li>
|
2009-10-02 17:26:29 +00:00
|
|
|
<div class="banque"><?=$relation['libBanque']?></div>
|
2010-02-18 17:27:48 +00:00
|
|
|
<div class="adresse"><?php if(isset($relation['adresse1']) && $relation['adresse1']!='') {?>
|
|
|
|
<?=$relation['adresse2']?><br />
|
|
|
|
<?php } ?> <?php if(isset($relation['adresse2']) && $relation['adresse2']!='') {?>
|
|
|
|
<?=$relation['adresse2']?><br />
|
|
|
|
<?php } ?> <?=$relation['cp']?> <?=$relation['ville']?></div>
|
2009-10-06 08:31:48 +00:00
|
|
|
<div class="codeBanque"><?php if( $relation['codeBanque']*1!=0 ){ echo $relation['codeBanque']; } ?></div>
|
|
|
|
<div class="codeGuichet"><?php if( $relation['codeGuichet']*1!=0 ){ echo $relation['codeGuichet']; }?></div>
|
2009-10-02 09:24:43 +00:00
|
|
|
</li>
|
2010-02-18 17:27:48 +00:00
|
|
|
<?php
|
2009-10-02 09:24:43 +00:00
|
|
|
}
|
|
|
|
?>
|
2010-02-18 17:27:48 +00:00
|
|
|
</ul>
|
|
|
|
<?php
|
2010-04-09 14:55:22 +00:00
|
|
|
// Export
|
|
|
|
require_once 'export.php';
|
|
|
|
if (isset($siret) == true) {
|
|
|
|
$fileName = $page.'-'.$siret;
|
|
|
|
} else {
|
|
|
|
$fileName = $page.'-'.$idEntreprise;
|
|
|
|
}
|
|
|
|
|
|
|
|
$parseTab = new tabExport;
|
|
|
|
$parseTab->tab = array($rbanque);
|
|
|
|
$parseTab->type = array();
|
|
|
|
|
|
|
|
$array2csv = new ExportCSV;
|
|
|
|
$array2csv->records = $parseTab->convertTable();
|
|
|
|
$array2csv->writeCSV($fileName);
|
|
|
|
|
|
|
|
$array2xml = new ExportXML;
|
|
|
|
$array2xml->rootName = $page.'s';
|
|
|
|
$array2xml->defaultTagName = $page;
|
|
|
|
$array2xml->records = $rbanque;
|
|
|
|
$array2xml->writeXML($fileName);
|
2010-02-18 17:27:48 +00:00
|
|
|
}
|
|
|
|
?></div>
|
|
|
|
<?php
|
2010-03-18 14:57:23 +00:00
|
|
|
|