extranet/www/pages/bourse.php

366 lines
11 KiB
PHP

<?php
if (!page_checkParams()) die('Paramètres incorrects !');
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';
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() && !hasModeEdition() )
{
$etab = cache_get('etab');
}else{
cache_delete();
try {
$O = $client->getInfosBourse($siren);
$etab = array_key_exists('result',$O) ? $O['result'] : array() ;
cache_add('etab', $etab);
} catch (SoapFault $fault) {
require_once 'soaperror.php';
processSoapFault($client,$fault,$_SESSION['tabInfo']);
die();
}
}
?>
<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 ( !isset($etab['Isin']) || 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( isset($etab['CodeBloomberg']) && 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( isset($etab['CodeDatastream']) && 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( isset($etab['CodeRic']) && 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>
<?
// Export
require_once 'export.php';
if (isset($siret) == true) {
$fileName = $page.'-'.$siret;
} else {
$fileName = $page.'-'.$idEntreprise;
}
$parseTab = new tabExport;
$parseTab->tab = array($etab);
$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 = $etab;
$array2xml->writeXML($fileName);
}
?>
</table>
<p class="confidentiel blockh2">
<?php
require_once 'cgu/cgu.php';
echo afficheCgu();
?>
</p>
</div>