extranet/www/pages/bourse.php
2009-07-20 16:17:33 +00:00

342 lines
11 KiB
PHP

<?if (!$_SESSION['connected']) {
echo ('Vous devez être connecté afin de pouvoir utiliser cette fonctionnalité');
die();
} else {
$tabInfo = $_SESSION['tabInfo'];
$siret=trim(preg_replace('/[^0-9]/', '', $_REQUEST['siret']));
if (strlen($siret)<>0 && strlen($siret)<>9 && strlen($siret)<>14) die('Paramètres incorrects !');
$idEntreprise=trim(preg_replace('/[^0-9]/', '', $_REQUEST['idEntreprise']))*1; // Si id=0 alors non communiqué
if (($siret*1)==0 && $idEntreprise==0) die('Paramètres incorrects !');
$siren=substr($siret,0,9);
if (isset($_REQUEST['id']) && $_REQUEST['id']*1<>0) $idCom=$_REQUEST['id'];
else $idCom=false;
if (($siret*1)==0 || ($siren*1)<100){ $fileName = $page2.'-'.$idEntreprise;
}else{ $fileName = $page2.'-'.$siret; }
require_once 'cache.php';
$cache = new Cache();
//Forcer la création de la page dans le cache lorsque l'utilisateur a le mode saisie
$firephp->log($_SESSION,'SESSION');
if( preg_match('/saisie/i', $_SESSION['tabInfo']['droits']) || $_SESSION['tabInfo']['mode_edition']==1 ){
$cache->disable = TRUE;
}
if ( $cache->startCapture($fileName.'.html') == FALSE){
print $cache->displayCache();
}else{
require_once 'partenaires/classMTva.php';
require_once 'partenaires/classMMap.php';
require_once 'partenaires/classMCoface.php';
require_once 'common/dates.php';
try {
$O = $client->getInfosBourse($siren);
$etab=$O['result'];
} catch (SoapFault $fault) {
require_once 'soaperror.php';
processSoapFault($client,$fault,$tabInfo);
die();
}
$raisonSociale=$tabInfo['entrep']['raisonSociale'];
?>
<table width="580" border="0" align="left" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><img src="./img/rub_bourse.png" width="577" height="36" /></td>
</tr>
<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>
<?
if (trim($etab['Isin'])=='') {
?>
<tr>
<td width="580" class="StyleInfoLib" colspan="3">&nbsp;</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="550" class="StyleInfoLib" colspan="2">Soci&eacute;t&eacute; non c&ocirc;t&eacute;e en bourse &agrave; ce jour.</td>
</tr>
<?
} else {
/**
** On recherche un logo
**/
$urlImg='';
$siteWeb='';
if ($etab['Isin']<>'') {
$locImg=PATH_LOGOS.$etab['Isin'];
if (file_exists($locImg.'.gif')) { $urlImg='/logos/'.$etab['Isin'].'.gif'; $ext='.gif'; }
elseif (file_exists($locImg.'.png')) { $urlImg='/logos/'.$etab['Isin'].'.png'; $ext='.png'; }
elseif (file_exists($locImg.'.jpg')) { $urlImg='/logos/'.$etab['Isin'].'.jpg'; $ext='.jpg'; }
elseif (file_exists($locImg.'.jpeg')) { $urlImg='/logos/'.$etab['Isin'].'.jpeg'; $ext='.jpeg'; }
}
if ($urlImg=='') {
$locImg=PATH_LOGOS.$etab['Siren'];
if (file_exists($locImg.'.gif')) { $urlImg='/logos/'.$etab['Siren'].'.gif'; $ext='.gif'; }
elseif (file_exists($locImg.'.png')) { $urlImg='/logos/'.$etab['Siren'].'.png'; $ext='.png'; }
elseif (file_exists($locImg.'.jpg')) { $urlImg='/logos/'.$etab['Siren'].'.jpg'; $ext='.jpg'; }
elseif (file_exists($locImg.'.jpeg')) { $urlImg='/logos/'.$etab['Siren'].'.jpeg'; $ext='.jpeg'; }
}
if (trim($etab['Web'])<>'') {
if (substr($etab['Web'],0,7)<>'http://')
$siteWeb='http://'.$etab['Web'];
else
$siteWeb=$etab['Web'];
}
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Code ISIN</td>
<td width="350" class="StyleInfoData"><?=$etab['Isin']; if (trim($etab['CodeSicovam'])*1>0) echo '&nbsp;&nbsp;<b>(ancien code Sicovam : </b>'.$etab['CodeSicovam'].'<b>)</b>';?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Code Mn&eacute;mo</td>
<td width="350" class="StyleInfoData"><?=$etab['CodeMnemo']?></td>
</tr>
<?
if(trim($etab['CodeBloomberg'])<>'') {
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Code Bloomberg</td>
<td width="350" class="StyleInfoData"><?=$etab['CodeBloomberg']?></td>
</tr>
<?
}
if(trim($etab['CodeDatastream'])<>'') {
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Code Datastream</td>
<td width="350" class="StyleInfoData"><?=$etab['CodeDatastream']?></td>
</tr>
<?
}
if(trim($etab['CodeRic'])<>'') {
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Code Ric</td>
<td width="350" class="StyleInfoData"><?=$etab['CodeRic']?></td>
</tr>
<?
}
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Place de cotation</td>
<td width="350" class="StyleInfoData"><?=$etab['placeCotation']?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">March&eacute;</td>
<td width="350" class="StyleInfoData"><?=$etab['Marche']?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Nombre de titres</td>
<td width="350" class="StyleInfoData"><?=number_format($etab['nombreTitres'],0,'', ' ')?> titres</td>
</tr>
<? switch (trim(strtoupper($etab['EligibleSRD']))) {
case 'O': $srd='Oui'; break;
default: $srd='Non'; break;
}
switch (trim(strtoupper($etab['EligiblePEA']))) {
case 'O': $pea='Oui'; break;
default: $pea='Non'; break;
}
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">&Eacute;ligible SRD / PEA</td>
<td width="350" class="StyleInfoData"><?=$srd?> / <?=$pea?></td>
</tr>
<?
if ($urlImg<>'') {
$tabTmp=@getimagesize($locImg.$ext);
$w=$tabTmp[0];
$h=$tabTmp[1];
if ($w>350) $strSize=@redimage($locImg.$ext,350,150);
else $strSize='';
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Logo</td>
<td width="350" class="StyleInfoData"><img src="<?=$urlImg?>" <?=$strSize?>/></td>
</tr>
<? }
?>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3"><img src="./img/srub_coordonnees.png" width="576" height="27"></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Raison Sociale</td>
<td width="350" class="StyleInfoData"><?=$etab['RaisonSociale']?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Adresse</td>
<td width="350" class="StyleInfoData"><?=$etab['Adresse']?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Date d'introduction en bourse</td>
<td width="350" class="StyleInfoData"><?=$etab['DateIntroduction']?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Date derni&egrave;re assembl&eacute;e g&eacute;n&eacute;rale</td>
<td width="350" class="StyleInfoData"><?=$etab['DateDerAG']?></td>
</tr>
<?
if (trim($etab['DateRadiation'])<>'' && $etab['DateRadiation']<>'0000-00-00') {
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Date de radiation</td>
<td width="350" class="StyleInfoData"><?=$etab['DateRadiation']?></td>
</tr>
<?
// 'AutreIsin'=>$bourse['autre_isin'],
}
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">T&eacute;l&eacute;phone</td>
<td width="350" class="StyleInfoData"><?
if (strlen(trim($etab['Tel']))>5) echo $etab['Tel'].'&nbsp;&nbsp;&nbsp;&nbsp;';
if (strlen(trim($etab['Tel2']))>5) echo $etab['Tel2'];
?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Fax</td>
<td width="350" class="StyleInfoData"><?
if (strlen(trim($etab['Fax']))>5) echo $etab['Fax'].'&nbsp;&nbsp;&nbsp;&nbsp;';
if (strlen(trim($etab['Fax2']))>5) echo $etab['Fax2'];
?></td>
</tr>
<?
if ($siteWeb<>'') { ?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Site Internet</td>
<td width="350" class="StyleInfoData"><a href="<?=$siteWeb?>" target="_blank"><?=$siteWeb?></a></td>
</tr>
<? }
if (trim($etab['Mail'])<>'') { ?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Courriel</td>
<td width="350" class="StyleInfoData"><a href="mailto:<?=$etab['Mail'];?>" target="_blank"><?=$etab['Mail']?></a></td>
</tr>
<? } ?>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3"><img src="./img/srub_activites.png" width="576" height="27"></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Activit&eacute;</td>
<td width="350" class="StyleInfoData"><?=$etab['Activite']?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Secteur</td>
<td width="350" class="StyleInfoData"><?=$etab['Secteur']?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="2" class="StyleInfoData"><?=str_replace("\n", '<br/>',$etab['ActiviteDet'])?></td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3"><img src="./img/srub_dercours.png" width="576" height="27"></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Derni&egrave;re cotation connue</td>
<td width="350" class="StyleInfoData"><?=WDate::dateT('Y-m-d','d/m/Y',$etab['derCoursDate'])?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Clôture</td>
<td width="350" class="StyleInfoData"><?=number_format($etab['derCoursCloture'],2,',', ' ')?> &euro;</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Ouverture</td>
<td width="350" class="StyleInfoData"><?=number_format($etab['derCoursOuverture'],2,',', ' ')?> &euro;</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Plus haut</td>
<td width="350" class="StyleInfoData"><?=number_format($etab['derCoursPlusHaut'],2,',', ' ')?> &euro;</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Plus Bas</td>
<td width="350" class="StyleInfoData"><?=number_format($etab['derCoursPlusBas'],2,',', ' ')?> &euro;</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Volume &eacute;changé</td>
<td width="350" class="StyleInfoData"><?=number_format($etab['derCoursVolume'],0,'', ' ')?> titres (<?=number_format($etab['derCoursVolume']/$etab['nombreTitres'],2,',', ' ')?> %)</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Capitalisation</td>
<td width="350" class="StyleInfoData"><?=number_format($etab['capitalisation'],2,',', ' ')?> &euro;</td>
</tr>
<tr><td colspan="3">&nbsp;</td></tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Minimum historique</td>
<td width="350" class="StyleInfoData"><?=number_format($etab['coursMin'],2,',', ' ')?> &euro;</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Maximum historique</td>
<td width="350" class="StyleInfoData"><?=number_format($etab['coursMax'],2,',', ' ')?> &euro;</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Cours moyen</td>
<td width="350" class="StyleInfoData"><?=number_format($etab['coursMoy'],2,',', ' ')?> &euro;</td>
</tr>
<?
}
}
?>
</table>
<?php
}//Fin du cache
$cache->stopCapture();
?>