extranet/www/pages/bourse.php
2009-09-02 12:07:49 +00:00

348 lines
10 KiB
PHP

<?php
if (!$_SESSION['connected']) {
echo ('Vous devez être connecté afin de pouvoir utiliser cette fonctionnalité');
exit;
}
require_once 'cache/cache.php';
require_once 'partenaires/classMTva.php';
require_once 'partenaires/classMMap.php';
require_once 'partenaires/classMCoface.php';
require_once 'common/dates.php';
$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; }
cache_filename($fileName);
if( cache_exist() && !( preg_match('/saisie/i', $_SESSION['tabInfo']['droits']) || $_SESSION['tabInfo']['mode_edition']==1 ) )
{
$etab = cache_get('etab');
}else{
cache_delete();
try {
$O = $client->getInfosBourse($siren);
$etab = $O['result'];
cache_add('etab', $etab);
} catch (SoapFault $fault) {
require_once 'soaperror.php';
processSoapFault($client,$fault,$_SESSION['tabInfo']);
die();
}
}
$raisonSociale = $_SESSION['tabInfo']['entrep']['raisonSociale'];
?>
<div id="center">
<h1 class="titre">INFORMATIONS BOURSI&Egrave;RES</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>
<?php
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>
<?php
}
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>
<?php
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>
<?php
}
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>
<?php
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>
<?php
}
?>
</table>
<h2>Coordonn&eacute;es</h2>
<table>
<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>
<?php
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>
<?php
// '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">
<?php
if (strlen(trim($etab['Fax']))>5) echo $etab['Fax'].'&nbsp;&nbsp;&nbsp;&nbsp;';
if (strlen(trim($etab['Fax2']))>5) echo $etab['Fax2'];
?>
</td>
</tr>
<?php
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>
<?php
}
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>
<?php
}
?>
</table>
<h2>Activit&eacute;(s)</h2>
<table>
<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>
</table>
<h2>Dernier cours</h2>
<table>
<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>
</div>