extranet/www/pages/dirigeants.php

105 lines
4.0 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);
if ($_REQUEST['vue']=='histo')
$histo=true;
else
$histo=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->getDirigeants($siren, $histo);
$dirs=$O['result'];
} catch (SoapFault $fault) {
echo '<pre>'.$client->__getLastResponse().'</pre>';
echo 'ERREUR SOAP :'.EOL;
print_r($fault);
die();
}
$raisonSociale=$tabInfo['entrep']['raisonSociale'];
?>
<table width="580" border="0" align="left" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><img src="./img/rub_dirigeant.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>
<? if ($histo) { ?>
<tr>
<td colspan="3"><img src="./img/srub_dirhisto.png" width="576" height="27"></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td colspan="2" width="550" class="StyleInfoData"><table><?foreach ($dirs as $i=>$dir) {
$nom=$dir['Societe'].' '.$dir['Nom'].' '.$dir['Prenom'];
?><tr><td class="StyleInfoData" width="150"><?=$dir['Titre']?></td><td class="StyleInfoData" width="200"><?=$nom?></td><td class="StyleInfoData" width="200"><?
if ($dir['DateFct']<>'') {
//if ($dir['Ancien']) echo 'Fonction abandon&eacute;e le ';
//else echo 'Prise de fonction le ';
echo 'Modification le ';
echo WDate::dateT('Y-m-d', 'd/m/Y',$dir['DateFct']);
}
?></td></tr><?
}
if (count($dirs)==0)
echo '<tr><td class="StyleInfoData" width="550">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Aucune donn&eacute;e n\'est pr&eacute;sente dans notre base</td></tr>';
?></table></td>
</tr>
<? } else { ?>
<tr>
<td colspan="3"><img src="./img/srub_dirliste.png" width="576" height="27"></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td colspan="2" width="550" class="StyleInfoData"><table><?foreach ($dirs as $i=>$dir) {
$nom=str_replace('&amp;#160;',' ', $dir['Societe'].' '.$dir['Nom'].' '.$dir['Prenom']);
?><tr><td class="StyleInfoData" width="150"><?=$dir['Titre']?></td><td class="StyleInfoData" width="150"><?=$nom?></td><td class="StyleInfoData" width="250"><? if (trim($dir['NaissDate'])<>'' && trim($dir['NaissVille'].' '.$dir['NaissDepPays'])<>'') {
echo 'n&eacute;(e) le '.$dir['NaissDate'].' &agrave; '.$dir['NaissVille'];
if (trim($dir['NaissDepPays'])<>'')
echo '&nbsp;('.$dir['NaissDepPays'].')';
} elseif (trim($dir['NaissDate'])<>'') {
echo 'n&eacute;(e) le '.$dir['NaissDate'];
} elseif (trim($dir['NaissVille'].' '.$dir['NaissDepPays'])<>'') {
echo 'n&eacute;(e) &agrave; '.$dir['NaissVille'];
echo '&nbsp;('.$dir['NaissDepPays'].')';
}?></td></tr><?
}
if (count($dirs)==0)
echo '<tr><td class="StyleInfoData" width="550">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Aucune donn&eacute;e n\'est pr&eacute;sente dans notre base</td></tr>';
?></table></td>
</tr>
<? } ?>
</table>
<?
//print_r($dirs);
?>