extranet/www/pages/banque.php
2010-06-24 09:41:42 +00:00

140 lines
2.8 KiB
PHP

<?php
require_once 'scoresws/scoresws.php';
if (!page_checkParams()) die('Paramètres incorrects !');
$rbanque = scoresws_banques($siret, $siren, $idEntreprise);
if ($rbanque === false) {
$soaperror = true;
}
?>
<style type="text/css">
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;
}
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
</style>
<div id="center">
<h1 class="titre">RELATIONS BANCAIRES</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>Liste des relations bancaires</h2>
<?php
if( count($rbanque)==0 && isset($soaperror) )
{
?>
<div class="blockh2">
<p>Impossible de récupérer les informations.</p>
</div>
<?php
}
elseif( count($rbanque)==0 )
{
?>
<div class="blockh2">
<p>Aucune information.</p>
</div>
<?php
}
elseif( count($rbanque)>0 )
{
?>
<ul class="relation clearfix">
<?php
$firephp->log($rbanque, 'rbanque');
foreach($rbanque as $relation)
{
?>
<li>
<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"><?php if( $relation['codeBanque']*1!=0 ){ echo $relation['codeBanque']; } ?></div>
<div class="codeGuichet"><?php if( $relation['codeGuichet']*1!=0 ){ echo $relation['codeGuichet']; }?></div>
</li>
<?php
}
?>
</ul>
<?php
// 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);
}
?>
<p class="confidentiel blockh2">
<?php
require_once 'cgu/cgu.php';
echo afficheCgu();
?>
</p>
</div>
<?php