extranet/www/pages/banque.php

110 lines
2.9 KiB
PHP
Raw Normal View History

2009-10-02 07:45:52 +00:00
<?php
if (!$_SESSION['connected']) {
echo ('Vous devez <20>tre connect<63> afin de pouvoir utiliser cette fonctionnalit<69>');
exit;
}
2009-10-02 08:11:39 +00:00
require_once 'cache/cache.php';
2009-10-02 07:45:52 +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 !');
$idEntreprise=trim(preg_replace('/[^0-9]/', '', $_REQUEST['idEntreprise']))*1; // Si id=0 alors non communiqu<71>
if (($siret*1)==0 && $idEntreprise==0) die('Param<61>tres incorrects !');
$siren=substr($siret,0,9);
2009-10-02 08:11:39 +00:00
if (($siret*1)==0 || ($siren*1)<100){ $fileName = $page.'-'.$idEntreprise;
}else{ $fileName = $page.'-'.$siret; }
cache_filename($fileName);
if( cache_exist() && !( preg_match('/saisie/i', $_SESSION['tabInfo']['droits']) || $_SESSION['tabInfo']['mode_edition']==1 ) )
{
$rbanque = cache_get('rbanque');
}else{
2009-10-02 07:45:52 +00:00
try {
$O = $client->getBanques($siren);
$rbanque = $O['results'];
2009-10-02 08:11:39 +00:00
cache_delete();
cache_add('rbanque', $rbanque);
2009-10-02 07:45:52 +00:00
} catch (SoapFault $fault) {
require_once 'soaperror.php';
processSoapFault($client,$fault,$_SESSION['tabInfo']);
2009-10-02 08:11:39 +00:00
$soaperror = true;
2009-10-02 07:45:52 +00:00
}
2009-10-02 08:11:39 +00:00
}
2009-10-02 07:45:52 +00:00
?>
<style type="text/css">
2009-10-02 17:25:39 +00:00
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; }
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
2009-10-02 07:45:52 +00:00
</style>
<div id="center">
2009-10-02 16:01:10 +00:00
<h1 class="titre">RELATIONS BANCAIRES</h1>
2009-10-02 07:45:52 +00:00
<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"><?=$_SESSION['tabInfo']['entrep']['raisonSociale']?></td>
</tr>
</table>
2009-10-02 16:01:10 +00:00
<h2>Liste des relations bancaires</h2>
2009-10-02 07:45:52 +00:00
<?php
2009-10-02 08:11:39 +00:00
if( count($rbanque)==0 && isset($soaperror) )
2009-10-02 07:45:52 +00:00
{
2009-10-02 08:11:39 +00:00
?>
<p>Impossible de r<EFBFBD>cup<EFBFBD>rer les informations.</p>
<?php
}
elseif( count($rbanque)==0 )
{
?>
2009-10-02 16:01:10 +00:00
<p>Aucune information.</p>
2009-10-02 07:45:52 +00:00
<?php
}
2009-10-02 08:11:39 +00:00
elseif( count($rbanque)>0 )
{
?>
2009-10-02 17:25:39 +00:00
<ul class="relation clearfix">
2009-10-02 08:11:39 +00:00
<?php
$firephp->log($rbanque, 'rbanque');
foreach($rbanque as $relation)
{
?>
<li>
2009-10-02 17:25:39 +00:00
<div class="banque"><?=$relation['libBanque']?></div>
<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>
<div class="codeBanque"><?=$relation['codeBanque']?></div>
<div class="codeGuichet"><?=$relation['codeGuichet']?></div>
2009-10-02 08:11:39 +00:00
</li>
<?php
}
?>
</ul>
<?php
}
2009-10-02 07:45:52 +00:00
?>
</div>
<?php