extranet/www/pages/conventions.php

133 lines
4.4 KiB
PHP
Raw Normal View History

<?if (!$_SESSION['connected'])
echo ('Vous devez <20>tre connect<63> afin de pouvoir utiliser cette fonctionnalit<69>');
/*elseif ($_SESSION['tabInfo']['login']<>'ylenaour') {
echo ('Vous n\'avez pas les droits n<>cessaires pour utiliser cette fonctionnalit<69>');
$siret=$_REQUEST['siret'];
}*/
else
{
2009-04-01 12:45:45 +00:00
$tabInfo = $_SESSION['tabInfo'];
$siret=trim(preg_replace('/[^0-9]/', '', $_REQUEST['siret']));
if (strlen($siret)<>0 && strlen($siret)<>9 && strlen($siret)<>14) die('Param<61>tres incorrects !');
2009-03-11 07:51:18 +00:00
$idEntreprise=trim(preg_replace('/[^0-9]/', '', $_REQUEST['idEntreprise']))*1; // Si id=0 alors non communiqu<71>
if (($siret*1)==0 && $idEntreprise==0) die('Param<61>tres incorrects !');
$siren=substr($siret,0,9);
2009-03-11 07:51:18 +00:00
if (isset($_REQUEST['idEntreprise']) && $_REQUEST['idEntreprise']*1<>0) $idCom=$_REQUEST['idEntreprise'];
else $idCom=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']));
require_once 'index_auth.php';
try {
$O = $client->getListeConventions($siren);
$conventions=$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="4"><img src="./img/rub_convcoll.png" width="577" height="36" /></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" colspan="2" 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" colspan="2" class="StyleInfoLib">Raison Sociale</td>
<td width="350" class="StyleInfoData"><?=$raisonSociale?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="4"><img src="./img/srub_convcoll.png" width="576" height="27" /></td>
</tr>
<?
/* if ($idCom) {
foreach ($annonces as $ann) {
if ($ann['id']==$_REQUEST['id']) {/*'id' =>$ann['id'],
'' =>$ann['source'],
'DateParution' =>$ann['DateParution'],
'raisonSociale' =>utf8_encode($ann['raisonSociale']),
'titre' =>utf8_encode($ann['titre']),
'communique' =>utf8_encode($ann['communique']),
'communiqueHtml'=>utf8_encode($ann['communiqueHtml']),
'pj' =>$ann['pj'],
'url' =>$ann['url'],*/
if (count($conventions)>0) {
/** Affichage de la liste des conventions collectives
**/
/*
[] => Industries metallurgiques OETAM (Region parisienne)
[infoCC] => Industries metallurgiques OETAM (Region parisienne)
*/
foreach ($conventions as $i=>$conv) {?>
<tr>
<td width="580" colspan="4">
<table>
<tr>
<td width="20">&nbsp;</td>
<td width="90" class="StyleInfoData"><u><a href="http://www.legifrance.gouv.fr/rechConvColl.do?champActivite=&champIDCC=&champNumeroBrochure=<?=substr($conv['idCC'],0,4)?>&bouton=Rechercher" target="_blank">Brochure <?=substr($conv['idCC'],0,4)?></a></u></td>
<td width="350" class="StyleInfoData"><b><?=$conv['nomCC']?></b><?
//if (trim($conv['nomCC'])<>trim($conv['infoCC'])) echo '<br/><font size="1">'.$conv['infoCC'].'</font>';?>
</td>
<td width="200" class="StyleInfoData"><font size="1"><i>Journal Officiel<?
if (trim($conv['dateCC'])<>'') echo ', '.$conv['dateCC'];
if (trim($conv['nbPageCC'])*1>0) echo ', '.$conv['nbPageCC'].' pages.';
if (trim($conv['isbnCC'])<>'') echo '<br/>ISBN '.$conv['isbnCC'];
?></i></font></td>
</tr>
</table>
<hr width="80%"/>
</td>
</tr>
<? }
} else {
/** Aucune Info R<EFBFBD>glement<EFBFBD>e pour cette entreprise
**/
?>
<tr>
<td width="30">&nbsp;</td>
<td width="100" class="StyleInfoLib">&nbsp;</td>
<td width="450" colspan="2" class="StyleInfoData">N&eacute;ant</td>
</tr>
<tr>
<td colspan="4">&nbsp;</td>
</tr>
<?
}
}
?>
<tr>
<td colspan="4">&nbsp;</td>
</tr>
</table>
<pre>
<?
//print_r($annonces);
?>
</pre>