extranet/www/pages/marques.php

110 lines
3.3 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'];
$firephp->log($marques,'test');
2009-03-13 19:09:34 +00:00
} 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
2009-08-17 14:37:19 +00:00
$raisonSociale = $_SESSION['tabInfo']['entrep']['raisonSociale'];
?>
<script type="text/javascript">
$(document).ready(function(){
$('a[idobjet]').each(function()
{
$(this).click(function()
{
idObject=$(this).attr('idobjet');
$('#document'+idObject).html('Construction du document en cours...');
$.ajax({
type: "POST",
url: "/",
data: "page=getmarques&idObject="+idObject,
success: function(msg){$('#document'+idObject).html(msg)},
2009-08-17 16:28:13 +00:00
error: function(){$('#document'+idObject).html('Erreur');}
2009-08-17 14:37:19 +00:00
});
});
});
2009-08-17 14:37:19 +00:00
});
</script>
<div id="center">
<h1 class="titre">PROPRI&Eacute;T&Eacute; INTELLECTUELLE</h1>
<table>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro identifiant Siren</td>
<td width="350" colspan="2" 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" colspan="2" class="StyleInfoData"><?=$raisonSociale?></td>
</tr>
<tr><td colspan="4">&nbsp;</td></tr>
</table>
2009-08-17 14:37:19 +00:00
<h2>Marque(s) d<EFBFBD>pos<EFBFBD>e(s)</h2>
<table>
<?php
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-08-17 14:37:19 +00:00
?>
<tr>
<td width="30">&nbsp;</td>
<td width="230" class="StyleInfoData">
D&eacute;p&ocirc;t n&deg;<?=$marque['Depot']?> du <?=WDate::dateT('Y-m-d','d/m/Y',$marque['Date'])?>&nbsp;&nbsp;<a idobjet="<?=$marque['Depot']?>" href="#" title="Voir le d<>tail de l'inscription au BOPI"><img src="./img/exporticones/pdf.png" alt="PDF"></a>
<div id="document<?=$marque['Depot']?>"></div>
</td>
<td width="340" class="StyleInfoLib"><?=$aff?></td>
</tr>
<?php
2009-03-13 19:09:34 +00:00
if ($id<>0) {
?>
2009-08-17 14:37:19 +00:00
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="3" class="StyleInfoLib" align="center"><img src="<?=$marque['UrlLien']?>"/>&nbsp;</td>
</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
?>
2009-08-17 14:37:19 +00:00
<tr>
<td width="30">&nbsp;</td>
<td width="550" colspan="3" class="StyleInfoLib">Aucune marque n'a &eacute;t&eacute; d&eacute;pos&eacute;e par cette entreprise depuis 1982.</td>
</tr>
<?
2009-03-13 19:09:34 +00:00
}
2009-08-17 14:37:19 +00:00
?>
</table>
<?
2009-08-17 14:37:19 +00:00
}
?>