extranet/www/pages/evenements.php

90 lines
3.5 KiB
PHP
Raw Normal View History

<? if (!$_SESSION['connected']) die();
$siret=trim(preg_replace('/[^0-9]/', '', $_REQUEST['siret']));
if (strlen($siret)<>0 && strlen($siret)<>9 && strlen($siret)<>14) die('Param<61>tres incorrects !');
$id=trim(preg_replace('/[^0-9]/', '', $_REQUEST['id']))*1; // Si id=0 alors non communiqu<71>
if (($siret*1)==0 && $id==0) die('Param<61>tres incorrects !');
$siren=substr($siret,0,9);
$mil=false;
include_once(INCLUDE_PATH.'/partenaires/classMTva.php');
include_once(INCLUDE_PATH.'/partenaires/classMMap.php');
//include_once(INCLUDE_PATH.'partenaires/classMCoface.php');
include_once(FWK_PATH.'/common/dates.php');
/** Utilisation du WS **/
$client = new SoapClient(null, array( 'trace' => 1,
'soap_version' => SOAP_1_1,
'location' => WEBSERVICE_URL,
'uri' => WEBSERVICE_URI,
'login' => $_SESSION['tabInfo']['login'],
'password' => $_SESSION['tabInfo']['password']));
try {
$O = $client->getListeEvenements($siren);
$evens=$O['result'];
} catch (SoapFault $fault) {
2009-02-26 17:16:11 +00:00
include_once(realpath(dirname(__FILE__).'/../../').'/includes/soaperror.php');
processSoapFault($client,$fault,$tabInfo);
die();
}
$raisonSociale=$tabInfo['entrep']['raisonSociale'];
?>
<table width="580" border="0" align="left" bgcolor="#FFFFFF">
<tr>
<td colspan="3" align="center"><img src="./img/rub_evenements.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>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3"><img src="./img/srub_even_insee.png" width="576" height="27" /></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td colspan="2" width="550" class="StyleInfoData"><table><?foreach ($evens as $i=>$even) {
if ($even['Siege']==1) $type='si<73>ge';
else $type='<27>tablissement';
/*
if ($etab['Actif']==1) $type.='actif';
else $type.='inactif';
'EvenCode' => $even['codeEven'],
'' => prepareString($even['libEven']),
'EvenLibDet'=> prepareString($even['libEvenDet']),
'' => $even['dateEven'],
'DateSD'
*/
$lien='<a title="Voir la fiche d\'identit<69>" href="/?page=identite&siret='.$siren.$even['Nic'].'">';
$lien2='<a title="Voir la fiche d\'identit<69>" href="/?page=identite&siret='.$even['SiretAss'].'">';
?><tr>
<td class="StyleInfoLib" width="60"><?=WDate::dateT('Ymd','d/m/Y',$even['DateInfo'])?></td>
<!-- <td class="StyleInfoData" width="70" align="center"><?=$type?></td>
<td class="StyleInfoData" width="120">-->
<td class="StyleInfoData" width="480"><b><?=$even['EvenLib']?></b>&nbsp;<i> - NIC <?=$lien.$even['Nic']?></a> le <?=WDate::dateT('Ymd','d/m/Y',$even['EvenDate'])?></i><?
if (trim($even['EvenLibDet'])<>'') echo '<br/>'.str_replace(', ','<br/>', $even['EvenLibDet']);
if ($even['SiretAss']*1<>0) echo '<br/>Siret associ<63> : '.$lien2.substr($even['SiretAss'],0,9).' '.substr($even['SiretAss'],9,5).'</a>';
?></td>
</tr><?
}
if (count($evens)==0)
echo '<tr><td class="StyleInfoData" width="580">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Aucun &eacute;v&egrave;nement n\'est pr&eacute;sente dans notre base</td></tr>';
// echo '<tr><td><pre>'.print_r($etabs).'</pre></td></tr>';
?></table></td>
</tr>
</td>
</tr>
<tr>
</table>