2010-03-03 16:56:17 +00:00
|
|
|
<div id="center">
|
2010-03-03 13:33:16 +00:00
|
|
|
<h1 class="titre">PORTEFEUILLE</h1>
|
|
|
|
<?php
|
|
|
|
require_once 'common/dates.php';
|
2010-04-26 07:55:31 +00:00
|
|
|
require_once 'portefeuille/function.php';
|
2010-03-03 13:33:16 +00:00
|
|
|
|
2010-03-03 16:56:17 +00:00
|
|
|
$vue = isset($_REQUEST['vue']) ? $_REQUEST['vue'] : 'default' ;
|
|
|
|
$tri = isset($_REQUEST['tri']) ? $_REQUEST['tri'] : 'siren' ;
|
|
|
|
$source = isset($_REQUEST['source']) ? $_REQUEST['source'] : '' ;
|
|
|
|
$position = isset($_REQUEST['p']) ? $_REQUEST['p'] : 0 ;
|
2010-03-03 13:33:16 +00:00
|
|
|
|
|
|
|
$nbAffichage = 100;
|
|
|
|
|
2010-07-06 09:24:32 +00:00
|
|
|
switch ( $tri ){
|
2010-03-03 13:33:16 +00:00
|
|
|
default:
|
|
|
|
case 'siren': $triws = 'siren'; break;
|
|
|
|
case 'rs': $triws = 'rs'; break;
|
|
|
|
case 'reference': $triws = 'ref'; break;
|
|
|
|
case 'dateajout': $triws = 'dateAjout'; break;
|
|
|
|
case 'datederenvoi': $triws = 'dateDerEnvoi'; break;
|
2010-04-26 07:55:31 +00:00
|
|
|
case 'score' : $triws = 'indiScore'; break;
|
2010-03-03 13:33:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//Liste des surveillances score de l'utilisateur
|
2010-07-06 09:24:32 +00:00
|
|
|
try {
|
2010-03-03 13:33:16 +00:00
|
|
|
$O = $client->getPortefeuille(0, $position, $nbAffichage, $triws);
|
|
|
|
$listSurveillance = $O['results']['reponses'];
|
|
|
|
|
|
|
|
$nbReponses = $O['results']['nbReponses'];
|
|
|
|
$nbSurveillances = $O['results']['nbReponsesTotal'];
|
2010-03-03 16:56:17 +00:00
|
|
|
|
2010-03-03 13:33:16 +00:00
|
|
|
$totPage = ceil($nbSurveillances/$nbAffichage);
|
|
|
|
$curPage = ceil($position/$nbAffichage);
|
|
|
|
|
|
|
|
} catch (SoapFault $fault) {
|
|
|
|
require_once 'soaperror.php';
|
|
|
|
processSoapFault($client,$fault,$tabInfo);
|
|
|
|
die();
|
|
|
|
}
|
|
|
|
|
|
|
|
$maxIndiscore = empty($_SESSION['tabInfo']['typeScore']) ?
|
|
|
|
'100' : $_SESSION['tabInfo']['typeScore'];
|
|
|
|
|
|
|
|
$typeScore = ($_SESSION['tabInfo']['typeScore'] == '100') ? '' : '20';
|
|
|
|
?>
|
|
|
|
<table id="info">
|
|
|
|
<tr>
|
|
|
|
<td width="200" class="StyleInfoLib">Nombre d'entités affichées</td>
|
|
|
|
<td><?=$nbReponses?></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="StyleInfoLib">Nombre de surveillances</td>
|
|
|
|
<td><?=$nbSurveillances?></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2010-04-26 09:48:28 +00:00
|
|
|
<?php
|
|
|
|
// --------------------------------------------------------------------------- //
|
|
|
|
// Extraction
|
|
|
|
// --------------------------------------------------------------------------- //
|
|
|
|
?>
|
|
|
|
<h2>Exportation de votre portefeuille</h2>
|
|
|
|
<p class="options">
|
|
|
|
<input type="hidden" name="page" value="<?=$page?>"/>
|
2010-07-15 14:47:27 +00:00
|
|
|
<a href="./?page=telechargement" id="telechargementjs">Exporter votre portefeuille au format CSV</a>
|
2010-04-26 09:48:28 +00:00
|
|
|
</p>
|
|
|
|
<div id="telechargementjsMsg"></div>
|
|
|
|
|
2010-03-03 13:33:16 +00:00
|
|
|
|
2010-04-26 07:55:31 +00:00
|
|
|
<h2>Options de tri</h2>
|
|
|
|
<div class="options">
|
|
|
|
<ul id="tri">
|
|
|
|
<li>
|
|
|
|
<a href="<?=lienTri('siren', $vue, $source, $siret, $idEntreprise)?>">
|
|
|
|
Tri par Siren
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="<?=lienTri('rs', $vue, $source, $siret, $idEntreprise)?>">
|
|
|
|
Tri par Raison sociale
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="<?=lienTri('reference', $vue, $source, $siret, $idEntreprise)?>">
|
|
|
|
Tri par Référence
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="<?=lienTri('score', $vue, $source, $siret, $idEntreprise)?>">
|
|
|
|
Tri par indiScore
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2010-03-03 13:33:16 +00:00
|
|
|
|
2010-04-26 07:55:31 +00:00
|
|
|
<h2>Surveillance Score</h2>
|
2010-03-03 13:33:16 +00:00
|
|
|
<?php
|
2010-05-18 14:03:26 +00:00
|
|
|
if ($totPage > 1) {
|
|
|
|
$maxPage = 11;
|
|
|
|
print '<p class="options">Page : </p>';
|
|
|
|
print '<p class="options">';
|
|
|
|
for ($countPage = max(0, $curPage - $maxPage);
|
|
|
|
$countPage < min($totPage, $curPage + $maxPage); ++$countPage) {
|
|
|
|
if ($countPage == $curPage) {
|
|
|
|
print ' '.($countPage + 1).' ';
|
|
|
|
} else {
|
|
|
|
print ' <a href="./?page=portefeuille&p='.
|
|
|
|
($nbReponses * $countPage).'">';
|
|
|
|
if ($countPage == $curPage - $maxPage) {
|
|
|
|
print '<<</a> ';
|
|
|
|
} else if ($countPage == $curPage + $maxPage - 1) {
|
|
|
|
print '>></a> ';
|
|
|
|
} else {
|
|
|
|
print($countPage + 1).'</a> ';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print '</p>';
|
2010-03-03 13:33:16 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<table class="tablesorter" id="surveillance">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Siren</th>
|
|
|
|
<th>Raison Sociale</th>
|
|
|
|
<th>Référence</th>
|
|
|
|
<th class="score">Score</th>
|
|
|
|
<th>Encours demandé</th>
|
|
|
|
<th>Encours conseillé</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php
|
|
|
|
$dicoSource = array(
|
|
|
|
'ajout' => '',
|
|
|
|
'bilans1' => 'publication bilan',
|
|
|
|
'bilans2' => 'publication bilan',
|
|
|
|
'bodacc' => 'publication bodacc',
|
|
|
|
'collecte' => 'publication légale',
|
|
|
|
'dirigeants' => 'modification de l\'administration',
|
|
|
|
'insee' => 'modification identitaire',
|
|
|
|
'liens' => 'mise à jour de la structure du groupe',
|
|
|
|
'default' => 'modification identitaire',
|
|
|
|
);
|
|
|
|
|
|
|
|
$couleurRisque100 = array(
|
|
|
|
'rouge' => array('min'=>0, 'max'=>40),
|
|
|
|
'orange' => array('min'=>41, 'max'=>50),
|
|
|
|
'vert' => array('min'=>51, 'max'=>100),
|
|
|
|
);
|
|
|
|
|
|
|
|
$couleurRisque20 = array(
|
|
|
|
'rouge' => array('min'=>0, 'max'=>6),
|
|
|
|
'orange' => array('min'=>7, 'max'=>10),
|
|
|
|
'vert' => array('min'=>11, 'max'=>20),
|
|
|
|
);
|
|
|
|
|
|
|
|
if(count($listSurveillance)>0)
|
|
|
|
{
|
|
|
|
foreach($listSurveillance as $item)
|
|
|
|
{
|
2010-03-19 14:56:21 +00:00
|
|
|
//Classe de risque
|
2010-03-03 13:33:16 +00:00
|
|
|
$couleurV = ${'couleurRisque'.$maxIndiscore};
|
|
|
|
foreach($couleurV as $couleur => $intervalle)
|
|
|
|
{
|
|
|
|
if($item['indiScore'.$typeScore]>=$intervalle['min'] &&
|
|
|
|
$item['indiScore'.$typeScore]<=$intervalle['max']){
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2010-03-03 16:56:17 +00:00
|
|
|
$indiScore = $item['indiScore'.$typeScore];
|
|
|
|
$indiScorePre = empty($item['indiScore'.$typeScore.'Pre']) ?
|
|
|
|
0 : $item['indiScore'.$typeScore.'Pre'];
|
2010-03-19 14:56:21 +00:00
|
|
|
|
|
|
|
//Variation du risque
|
|
|
|
$variation = abs($item['indiScore']-$item['indiScorePre']);
|
|
|
|
if($variation>=5 && $variation<=9){
|
|
|
|
$deg = '45';
|
|
|
|
}else{
|
|
|
|
$deg = '';
|
|
|
|
}
|
2010-03-03 13:33:16 +00:00
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<a href="./?page=identite&siret=<?=$item['siren']?>">
|
|
|
|
<?=$item['siren']?>
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td width="110">
|
|
|
|
<?=$item['rs']?><br/>
|
|
|
|
<i><?=$item['cp'].' '.$item['ville']?></i>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
if($item['ref']!='')
|
|
|
|
{
|
|
|
|
echo '<p>'.$item['ref'].'</p>';
|
|
|
|
}else{ ?> <p>-</p> <?php } ?>
|
|
|
|
</td>
|
|
|
|
<td class="tooltip" tooltip="<?php
|
2010-03-04 13:28:24 +00:00
|
|
|
if($item['procol']=='P'){
|
|
|
|
echo 'En procédure collective.';
|
|
|
|
echo '<br/>';
|
|
|
|
}
|
|
|
|
if($item['actif']==0){
|
|
|
|
echo 'Établissement inactif.';
|
|
|
|
echo '<br/>';
|
|
|
|
}
|
2010-03-03 13:33:16 +00:00
|
|
|
echo '- Dernier exercice pris en compte : ';
|
|
|
|
echo ( !isset($item['dateBilan']) || $item['dateBilan']=='0000-00-00') ?
|
|
|
|
'Néant' : 'le '.WDate::dateT('Y-m-d', 'd/m/Y',$item['dateBilan']);
|
|
|
|
echo '<br/>';
|
2010-03-04 13:28:24 +00:00
|
|
|
if($item['sourceModif']!='ajout'){
|
|
|
|
if(!empty($item['sourceModif'])){
|
2010-03-03 13:33:16 +00:00
|
|
|
echo '- Dernière modification ';
|
|
|
|
echo ( !isset($item['indiScoreDate']) ||
|
|
|
|
$item['indiScoreDate']=='0000-00-00') ? '' :
|
|
|
|
'le '.WDate::dateT('Y-m-d', 'd/m/Y',$item['indiScoreDate']);
|
2010-03-04 13:28:24 +00:00
|
|
|
if(!empty($item['sourceModif'])){
|
2010-03-03 13:33:16 +00:00
|
|
|
if(in_array($item['sourceModif'], $dicoSource))
|
|
|
|
$sourceModif = $item['sourceModif'];
|
|
|
|
else
|
|
|
|
$sourceModif = 'default';
|
|
|
|
echo ', suite à '.$dicoSource[$sourceModif];
|
|
|
|
}
|
|
|
|
echo '<br/>';
|
|
|
|
}
|
2010-03-04 13:28:24 +00:00
|
|
|
if($item['indiScoreDatePre']!='0000-00-00'){
|
|
|
|
echo '- Précédent score : ';
|
|
|
|
echo $indiScorePre.'/'.$maxIndiscore;
|
|
|
|
}
|
2010-03-03 13:33:16 +00:00
|
|
|
}
|
|
|
|
?>">
|
|
|
|
<div class="align_image">
|
|
|
|
<?php
|
2010-04-02 09:31:12 +00:00
|
|
|
if( $item['indiScoreDate']!='0000-00-00' &&
|
2010-03-04 13:28:24 +00:00
|
|
|
$item['procol']!='P' && $item['actif']!=0)
|
2010-03-03 13:33:16 +00:00
|
|
|
{
|
|
|
|
?>
|
2010-03-04 13:28:24 +00:00
|
|
|
<span><?=$indiScore.'/'.$maxIndiscore?></span>
|
2010-03-03 13:33:16 +00:00
|
|
|
<?php
|
|
|
|
//Procols
|
|
|
|
if($item['procol']=='P'){
|
|
|
|
?>
|
|
|
|
<img src="./img/score_alert.gif"/>
|
|
|
|
<?php
|
|
|
|
//Constant
|
2010-04-02 09:31:12 +00:00
|
|
|
}elseif($indiScore==$indiScorePre || $item['sourceModif']=='ajout'){
|
2010-03-03 13:33:16 +00:00
|
|
|
?>
|
|
|
|
<img src="./img/score_<?=$couleur?>constant.gif"/>
|
|
|
|
<?php
|
|
|
|
//Hausse
|
2010-03-03 16:56:17 +00:00
|
|
|
}elseif($indiScore>$indiScorePre){
|
2010-03-03 13:33:16 +00:00
|
|
|
?>
|
2010-03-19 14:56:21 +00:00
|
|
|
<img src="./img/score_<?=$couleur?>hausse<?=$deg?>.gif"/>
|
2010-03-03 13:33:16 +00:00
|
|
|
<?php
|
|
|
|
//Baisse
|
2010-03-03 16:56:17 +00:00
|
|
|
}elseif($indiScore<$indiScorePre){
|
2010-03-03 13:33:16 +00:00
|
|
|
?>
|
2010-03-19 14:56:21 +00:00
|
|
|
<img src="./img/score_<?=$couleur?>baisse<?=$deg?>.gif"/>
|
2010-03-03 13:33:16 +00:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
if($item['procol']=='P'){
|
|
|
|
?>
|
|
|
|
<img src="./img/score_alert.gif"/>
|
|
|
|
<?php
|
2010-03-04 13:28:24 +00:00
|
|
|
}else{ echo '-'; }
|
2010-03-03 13:33:16 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</td>
|
2010-04-13 07:22:56 +00:00
|
|
|
<td class="encours set">
|
2010-04-19 09:42:42 +00:00
|
|
|
<div class="valign">
|
2010-03-03 13:33:16 +00:00
|
|
|
<?php
|
2010-04-02 09:31:12 +00:00
|
|
|
if( $item['indiScoreDate']!='0000-00-00' &&
|
|
|
|
$item['procol']!='P' && $item['actif']!=0)
|
2010-03-03 13:33:16 +00:00
|
|
|
{
|
2010-04-13 07:22:56 +00:00
|
|
|
?>
|
2010-07-06 09:24:32 +00:00
|
|
|
<a class="dialogsurv editencours" href="./?page=surveillance&q=ajouter/<?=$item['siren'].$item['nic']?>/score&ref=<?=$item['ref']?>&email=<?=$item['email']?>"
|
2010-04-13 07:22:56 +00:00
|
|
|
title="Editer encours">
|
|
|
|
<img src="./img/interface/editer.png"/>
|
|
|
|
</a>
|
|
|
|
<span>
|
|
|
|
<?php
|
2010-04-02 09:31:12 +00:00
|
|
|
if(!empty($item['encoursClient'])){
|
2010-03-03 13:33:16 +00:00
|
|
|
?>
|
2010-03-04 13:28:24 +00:00
|
|
|
<?=number_format(round($item['encoursClient']/1000), 0, ',', ' ')?>
|
|
|
|
K€
|
2010-03-03 13:33:16 +00:00
|
|
|
<?php
|
|
|
|
}else{ ?> - <?php }
|
|
|
|
}else{ ?> - <?php }
|
|
|
|
?>
|
2010-04-13 07:22:56 +00:00
|
|
|
</span>
|
|
|
|
</div>
|
2010-03-03 13:33:16 +00:00
|
|
|
</td>
|
|
|
|
<?php
|
2010-04-02 09:31:12 +00:00
|
|
|
if( $item['indiScoreDate']!='0000-00-00' &&
|
|
|
|
$item['procol']!='P' && $item['actif']!=0)
|
2010-03-03 13:33:16 +00:00
|
|
|
{
|
|
|
|
?>
|
2010-03-04 13:28:24 +00:00
|
|
|
<td class="encours" title="Précédent :
|
|
|
|
<?=number_format(round($item['encoursPre']/1000), 0, ',', ' ')?>
|
|
|
|
K€">
|
|
|
|
<?=number_format(round($item['encours']/1000), 0, ',', ' ')?> K€
|
2010-03-03 13:33:16 +00:00
|
|
|
</td>
|
|
|
|
<?php
|
|
|
|
}else{
|
|
|
|
?><td class="encours">-</td><?php }
|
|
|
|
?>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|