extranet/www/pages/marques.php

93 lines
2.7 KiB
PHP
Raw Normal View History

2009-07-20 16:17:33 +00:00
<?
$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>
2009-03-13 18:15:05 +00:00
$id=trim(preg_replace('/[^0-9]/', '', $_REQUEST['id']))*1;
2009-03-13 19:09:34 +00:00
if (($siret*1)==0 && $id==0) die('Param<61>tres incorrects !');
$siren=substr($siret,0,9);
$mil=false;
if (!$_SESSION['connected'])
echo ('Vous devez <20>tre connect<63> afin de pouvoir utiliser cette fonctionnalit<69>');
elseif (!preg_match('/MARQUES/i', $_SESSION['tabInfo']['droits']))
echo ('Vous n\'avez pas les droits n<>cessaires pour utiliser cette fonctionnalit<69> (2)');
else {
2009-07-20 16:17:33 +00:00
require_once 'partenaires/classMTva.php';
require_once 'partenaires/classMMap.php';
require_once 'common/dates.php';
2009-04-01 12:45:45 +00:00
$tabInfo = $_SESSION['tabInfo'];
2009-07-20 16:17:33 +00:00
2009-03-13 19:09:34 +00:00
try {
$O = $client->getMarques($siren, $id);
$marques=$O['result'];
} catch (SoapFault $fault) {
2009-07-21 07:17:54 +00:00
require_once 'soaperror.php';
2009-03-13 19:09:34 +00:00
processSoapFault($client,$fault,$tabInfo);
die();
}
2009-07-20 16:17:33 +00:00
$raisonSociale=$tabInfo['entrep']['raisonSociale'];
?>
2009-03-13 19:09:34 +00:00
<table width="580" border="0" align="left" bgcolor="#FFFFFF">
<tr>
<td colspan="3" align="center"><img src="./img/rub_propint.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_marques.png" width="576" height="27" /></td>
</tr>
<?
// print_r($tabMarques);
foreach ($marques as $i=>$marque) {
$aff=$marque['Marques'];
2009-03-13 18:15:05 +00:00
if ($marque['IdLien']*1<>0 && $id==0)
$aff='<a href="./?page=marques&siret='.$siret.'&id='.$marque['IdLien'].'">'.$aff.'</a>';
2009-03-13 19:09:34 +00:00
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoData">D&eacute;p&ocirc;t n&deg;<?=$marque['Depot']?> du <?=WDate::dateT('Y-m-d','d/m/Y',$marque['Date'])?></td>
<td width="350" class="StyleInfoLib"><?=$aff?></td>
</tr>
2009-07-20 16:17:33 +00:00
<?
2009-03-13 19:09:34 +00:00
if ($id<>0) {
?>
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="2" class="StyleInfoLib" align="center"><img src="<?=$marque['UrlLien']?>"/>&nbsp;</td>
2009-07-20 16:17:33 +00:00
</tr>
2009-03-13 19:09:34 +00:00
<?
}
}
2009-07-20 16:17:33 +00:00
if (count($marques)==0){
2009-03-13 19:09:34 +00:00
?>
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="2" class="StyleInfoLib">Aucune marque n'a &eacute;t&eacute; d&eacute;pos&eacute;e par cette entreprise depuis 1982.</td>
2009-07-20 16:17:33 +00:00
</tr>
<?
2009-03-13 19:09:34 +00:00
}
?>
<tr>
</table>
<?
2009-03-13 19:09:34 +00:00
}
?>