Correction comptage type de bilan

This commit is contained in:
Michael RICOIS 2009-10-09 14:04:55 +00:00
parent f6274ff0b3
commit 63f6b103c6
3 changed files with 26 additions and 17 deletions

View File

@ -32,8 +32,8 @@ if(count($bilansInfos)>0)
{
foreach($bilansInfos as $key => $item)
{
if($item['typeBilan']!='C') { $numBilanC++; }
if($item['typeBilan']!='N') { $numBilanN++; }
if($item['typeBilan']=='C') { $numBilanC++; }
if($item['typeBilan']=='N') { $numBilanN++; }
}
}
@ -85,7 +85,9 @@ $(document).ready(function()
<td width="200" class="StyleInfoLib">Raison Sociale</td>
<td width="340" class="StyleInfoData"><?=$_SESSION['tabInfo']['entrep']['raisonSociale']?></td>
</tr>
<?php
if (count($bilansInfos)>0){
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Type de bilans</td>
@ -104,10 +106,14 @@ $(document).ready(function()
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
if (count($ratiosEntrep)==0 || !isset($ratiosEntrep)){
if (count($bilansInfos)==0){
?>
<table>
<tr><td width="30">&nbsp;</td><td><b>Aucun bilan disponible pour cette entreprise !</b></td></tr>

View File

@ -76,8 +76,8 @@ if(count($bilansInfos)>0)
{
foreach($bilansInfos as $key => $item)
{
if($item['typeBilan']!='C') { $numBilanC++; }
if($item['typeBilan']!='N') { $numBilanN++; }
if($item['typeBilan']=='C') { $numBilanC++; }
if($item['typeBilan']=='N') { $numBilanN++; }
}
}
if($typeBilan=='')
@ -147,7 +147,7 @@ else
<?php
$firephp->log($_SESSION, 'SESSION');
if (count($ratiosEntrep)==0 || !isset($ratiosEntrep))
if (count($bilansInfos)==0)
{
?>
<table>

View File

@ -16,13 +16,9 @@ isset($_REQUEST['ratio'])? $ratio=$_REQUEST['ratio'] : $ratio='';
isset($_REQUEST['type']) ? $typeBilan=$_REQUEST['type'] : $typeBilan='' ;
$result = scoresws_synthese($siret, $siren, $idEntreprise);
$bilansInfos = array();
$bilansInfos = $result['bilansInfos'];
$ratiosInfos = array();
$ratiosInfos = $result['ratiosInfos'];
$ratiosEntrep = array();
$ratiosEntrep = $result['ratiosEntrep'];
$ratiosEntrepEvol = array();
$ratiosEntrepEvol = $result['ratiosEntrepEvol'];
$numBilanC = 0;
@ -31,17 +27,18 @@ if(count($bilansInfos)>0)
{
foreach($bilansInfos as $key => $item)
{
if($item['typeBilan']!='C') { $numBilanC++; }
if($item['typeBilan']!='N') { $numBilanN++; }
if($item['typeBilan']=='C') { $numBilanC++; }
if($item['typeBilan']=='N') { $numBilanN++; }
}
}
if($typeBilan=='')
{
if($numBilanN>0){ $typeBilan = 'N'; }
if($numBilanN==0 && $numBilanC>0){ $typeBilan = 'C'; }
if($numBilanN>0){ $typeBilan='N'; }
if($numBilanN==0 && $numBilanC>0){ $typeBilan='C'; }
}
$firephp->log($typeBilan, 'typeBilan');
$firephp->log(count($bilansInfos),'nombre');
if(count($bilansInfos)>0)
{
//En fonction du type de bilan sélectionné
@ -104,6 +101,9 @@ $dataEvol = $data['evol'];
<td width="200" class="StyleInfoLib">Raison Sociale</td>
<td width="340" class="StyleInfoData"><?=$_SESSION['tabInfo']['entrep']['raisonSociale'];?></td>
</tr>
<?php
if (count($bilansInfos)>0){
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Type de bilans</td>
@ -121,10 +121,13 @@ $dataEvol = $data['evol'];
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
if (count($ratiosEntrep)==0 || !isset($ratiosEntrep))
if (count($bilansInfos)==0)
{
?>
<table>