extranet/www/pages/recherche.php
2009-04-09 17:08:42 +00:00

569 lines
28 KiB
PHP
Raw Blame History

<?php
if (!$_SESSION['connected']) die();
$formR=$_REQUEST['formR'];
/* $strRecherche.='<input type="hidden" name="formR[raisonSociale]" value="'. $formR['raisonSociale'].'"/>';
$strRecherche.='<input type="hidden" name="formR[numVoie]" value="'. $formR['numVoie'].'"/>';
$strRecherche.='<input type="hidden" name="formR[voie]" value="'. $formR['voie'].'"/>';
$strRecherche.='<input type="hidden" name="formR[cpVille]" value="'. $formR['cpVille'].'"/>';
$strRecherche.='<input type="hidden" name="formR[telFax]" value="'. $formR['telFax'].'"/>';
$strRecherche.='<input type="hidden" name="formR[dirNom]" value="'. $formR['dirNom'].'"/>';
$strRecherche.='<input type="hidden" name="formR[dirPrenom]" value="'. $formR['dirPrenom'].'"/>';
$strRecherche.='<input type="hidden" name="formR[dirDateNaissJJ]" value="'. $formR['dirDateNaissJJ'].'"/>';
$strRecherche.='<input type="hidden" name="formR[dirDateNaissMM]" value="'. $formR['dirDateNaissMM'].'"/>';
$strRecherche.='<input type="hidden" name="formR[dirDateNaissAAAA]" value="'. $formR['dirDateNaissAAAA'].'"/>';
$strRecherche.='<input type="hidden" name="formR[dirCpVille*/
if(!isset($vueRecherche)){
$vueRecherche = $_REQUEST['vue'];
}
switch ($vueRecherche) {
case 'ent':
?><br/>
<!--<p align="center"><img src="/img/accueil_moteur.gif" width="280" height="70"></p>-->
<br/><br/><br/><br/>
<form name="form_recherche" id="formR-id"action="./?page=recherche&action=rechercher&vue=list" method="POST" enctype="multipart/form-data">
<input type="hidden" name="formR[type]" value="ent"/>
<table cellpadding="0" cellspacing="0">
<tr>
<td valign="top" width="580" height="200" align="center">
<table>
<tr>
<td align="center"><h2 align="center" class="StyleRechercheTitre">RECHERCHE ENTREPRISE</h2></td>
</tr>
</table>
<table>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>SIREN</b></td>
<td width="300"><input type="text" name="formR[siret]" value="<?=$formR['siret']?>" size="25" maxlength="20" />&nbsp;<img src="img/exclamation.png"/ title="Recherche par SIREN, SIRET, N<> TVA intracommunautaire, N<> RC, N<> WALDEC, ISIN"></td>
<td width="72">&nbsp;</td>
</tr>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>RAISON SOCIALE<br/>ENSEIGNE / SIGLE</b></td>
<td width="300"><input type="text" name="formR[raisonSociale]" value="<?=$formR['raisonSociale']?>" size="25" maxlength="40" /></td>
<td width="72">&nbsp;</td>
</tr>
</table>
<!-- <div id="subcontent1" style="display:block">-->
<br/>
<table>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>N&deg; &amp; VOIE</b></td>
<td width="300"><input type="text" name="formR[numVoie]" value="<?=$formR['numVoie']?>" size="4" maxlength="4" /><input type="text" name="formR[voie]" value="<?=$formR['voie']?>" size="17" maxlength="30" /></td>
<td width="72">&nbsp;</td>
</tr>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>CP OU D&Eacute;P. / VILLE</b></td>
<td width="300"><input type="text" name="formR[cpVille]" value="<?=$formR['cpVille']?>" size="25" maxlength="40" /></td>
<td width="72">&nbsp;</td>
</tr>
</table>
<br/>
<table>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>T&Eacute;L / FAX</b></td>
<td width="300"><input type="text" name="formR[telFax]" value="<?=$formR['telFax']?>" size="15" maxlength="15" /><!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img onClick="return overlay(this, 'subcontent1')" src="./img/puce_plus_rond.gif" alt="Plus d'options de recherche..." />--></td>
<td width="72">&nbsp;</td>
</tr>
</table>
<div id="subcontent1" style="display:block">
<table>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>NAF</b></td>
<td width="300"><input type="text" name="formR[naf]" id="formR-naf" value="<?=$formR['naf']?>" size="5" /></td><!--autocomplete="off"-->
<td width="72">&nbsp;</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<table width="580">
<tr>
<td align="center" valign="top"><input type="image" src="./img/boutton_valider_off.gif" name="submit" id="formR-submit" onmouseover="this.src='./img/boutton_valider_on.gif'" onmouseout="this.src='./img/boutton_valider_off.gif'" title="Lancer la recherche..."></td>
</tr>
</table>
</form>
<?
break;
case 'enq':
if ($_REQUEST['action']<>'envoyer') {
/** @todo Pr<50>remplir le formulaire avec les donn<6E>es pr<70>c<EFBFBD>dentes */
?><br/>
<br/><br/><br/><br/>
<form name="form_recherche" action="./?page=recherche&action=envoyer&vue=enq" method="POST" enctype="multipart/form-data">
<input type="hidden" name="formR[type]" value="enq"/>
<table cellpadding="0" cellspacing="0">
<tr>
<td valign="top" width="580" height="200" align="center">
<table>
<tr>
<td align="center"><h2 align="center" class="StyleRechercheTitre">DEMANDE D'INVESTIGATION</h2></td>
</tr>
</table>
<table>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>Identifiant (SIREN, WALDEC)</b></td>
<td width="300"><input type="text" name="formR[siret]" size="30" maxlength="20" />&nbsp;<img src="img/exclamation.png"/ title="SIREN, SIRET, N&deg; TVA intracommunautaire, N<> RC, N<> WALDEC, ISIN"></td>
<td width="72">&nbsp;</td>
</tr>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>Raison Sociale, Enseigne, Sigle<br/>ou Nom &amp; Pr&eacute;nom <font color="red">*</font></b></td>
<td width="300"><input type="text" name="formR[raisonSociale]" size="30" maxlength="40" /></td>
<td width="72">&nbsp;</td>
</tr>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>Adresse compl&egrave;te</b></td>
<td width="300"><input type="text" name="formR[adresse]" size="30" maxlength="40" /></td>
<td width="72">&nbsp;</td>
</tr>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>Code Postal / Ville <font color="red">*</font></b></td>
<td width="300"><input type="text" name="formR[cpVille]" size="30" maxlength="40" /></td>
<td width="72">&nbsp;</td>
</tr>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>T&eacute;l&eacute;phone / Fax</b></td>
<td width="300"><input type="text" name="formR[telFax]" size="30" maxlength="40" /></td>
<td width="72">&nbsp;</td>
</tr>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>Activit&eacute; (NAF ou libell&eacute;)</b></td>
<td width="300"><input type="text" name="formR[activite]" size="30" maxlength="80" /></td>
<td width="72">&nbsp;</td>
</tr>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>Cat&eacute;gorie juridique</b></td>
<td width="300"><input type="text" name="formR[categorieJur]" size="30" maxlength="80" /></td>
<td width="72">&nbsp;</td>
</tr>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>Remarque ou commentaire<br/>&agrave; destination de l'enqu&eacute;teur <font color="red">*</font></b></td>
<td width="300"><textarea rows="3" name="formR[remarque]" cols="20"></textarea></td>
<td width="72">&nbsp;</td>
</tr>
</table>
<hr width="80%"/>
<br/>
<table>
<tr>
<td width="208" align="right" class="StyleRechercheLib">Votre email pour la r&eacute;ception de l'investigation <font color="red">*</font></td>
<td width="300"><input type="text" name="formR[email]" size="30" maxlength="80" value="<? if ($_SESSION['tabInfo']['login']<>'testreunica') echo $tabInfo['email']?>"/></td>
<td width="72">&nbsp;</td>
</tr>
</table>
<br/>
<table>
<tr>
<td width="508" align="center" class="StyleInfoLib"><i><font color="red">*</font> : Pour qu'une demande d'investigation soit recevable, il est obligatoire d'indiquer la raison sociale et la ville de l'entit<69>&eacute; recherch&eacute;e ainsi qu'un commentaire relatif au motif de la demande d'investigation.</i></td>
</tr>
</table>
<br/>
</td>
</tr>
</table>
<table width="580">
<tr>
<td align="center" valign="top"><input type="image" src="./img/boutton_valider_off.gif" name="submit" onmouseover="this.src='./img/boutton_valider_on.gif'" onmouseout="this.src='./img/boutton_valider_off.gif'" title="Lancer l'investigation..."></td>
</tr>
</table>
</form>
<?
} else {
$formR=$_REQUEST['formR'];
$rs=trim($formR['raisonSociale']);
$ville=trim($formR['cpVille']);
$email=trim($formR['email']);
$remarque=trim($formR['remarque']);
if (preg_match('#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$#',$email) && $rs<>'' && $ville<>'' && $remarque<>'') {
$fp=fopen(PATH_LOGS.'enquetes.csv', 'a');
fwrite($fp, date('Y/m/d H:i:s').' - '.print_r($_REQUEST['formR'],true).print_r($tabInfo,true)."\n");
fclose($fp);
mail('contact@scores-decisions.com','Demande d\'investigation', print_r($_REQUEST['formR'],true).
print_r($tabInfo,true));
?>
<table width="580" height="100%" border="0" align="left" bgcolor="#FFFFFF">
<tr>
<td width="10">&nbsp;</td>
<td valign="top" width="570"><br/><p class="StyleInfoLib">Votre demande a bien &eacute;t&eacute; prise en compte et sera trait&eacute;e par notre &eacute;quipe enqu&ecirc;te dans les meilleurs d&eacute;lais.<br/><br/>
<a href="./?page=recherche&action=rechercher&vue=ent">Cliquez-ici pour revenir &agrave; l'&eacute;cran de recherche.</a></p></td>
</tr>
</table>
<? } else { ?>
<table width="580" height="100%" border="0" align="left" bgcolor="#FFFFFF">
<tr>
<td width="10">&nbsp;</td>
<td valign="top" width="570"><br/><p class="StyleInfoLib">Veuillez saisir une adresse email valide ainsi que les informations n&eacute;cessaires &agrave; la demande d'investigation (Raison sociale, Ville, Motif de l'enqu&ecirc;te, etc...)<br/><br/>
<a href="Javascript:history.back()">Cliquez-ici pour revenir &agrave; l'&eacute;cran pr&eacute;c&eacute;dent.</a></p></td>
</tr>
</table>
<?
}
}
break;
case 'dir':
?>
<br/>
<!--<p align="center"><img src="/img/accueil_moteur.gif" width="280" height="70"></p>-->
<br/><br/><br/><br/>
<form name="form_recherche" action="./?page=recherche&action=rechercher&vue=list" method="POST" enctype="multipart/form-data">
<input type="hidden" name="formR[type]" value="dir"/>
<table cellpadding="0" cellspacing="0">
<tr>
<td valign="top" width="580" height="200" align="center">
<table>
<tr>
<td align="center"><h2 align="center" class="StyleRechercheTitre">RECHERCHE PAR DIRIGEANT</h2></td>
</tr>
</table>
<table>
<!-- <TD width=108><div align="right"><span class="Style6"></B></TD>
<TD colSpan=2>
</TR>
<TR>
<TD width=108><div align="right"><span class="Style6">CP / VILLE DE NAISSANCE</B></TD>
<TD colSpan=2><INPUT maxLength=40 size=25
name=></TD></TR></TBODY></TABLE></DIV></TD>
-->
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>NOM</b></td>
<td width="300"><input type="text" name="formR[dirNom]" value="<?=$formR['dirNom']?>" size="25" maxlength="40" /></td>
<td width="72"><img onClick="return overlay(this, 'subcontent1')" src="./img/puce_plus_rond.gif" alt="Plus d'options de recherche..."></td>
</tr>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>PRENOM</b></td>
<td width="300"><input type="text" name="formR[dirPrenom]" value="<?=$formR['dirPrenom']?>" size="25" maxlength="40" /></td>
<td width="72">&nbsp;</td>
</tr>
</table>
<!--<div id="subcontent1" style="display:none">--><div id="subcontent1" style="display:block">
<br/>
<table>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>DATE NAISSANCE</b></td>
<td width="300" class="StyleRechercheLib"><input maxLength="2" size="3" name="formR[dirDateNaissJJ]" value="<?=$formR['dirDateNaissJJ']?>"/>&nbsp;/&nbsp;<input maxLength="2" size="3" name="formR[dirDateNaissMM]" value="<?=$formR['dirDateNaissMM']?>"/>&nbsp;/&nbsp;<input maxLength="4" size="5" name="formR[dirDateNaissAAAA]" value="<?=$formR['dirDateNaissAAAA']?>"/></td>
<td width="72">&nbsp;</td>
</tr>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>CP OU D&Eacute;P. / VILLE DE NAISSANCE</b></td>
<td width="300"><input type="text" name="formR[dirCpVille]" value="<?=$formR['dirCpVille']?>" size="25" maxlength="40"></td>
<td width="72">&nbsp;</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<table width="580">
<tr>
<td align="center" valign="top"><input type="image" src="./img/boutton_valider_off.gif" name="submit" onmouseover="this.src='./img/boutton_valider_on.gif'" onmouseout="this.src='./img/boutton_valider_off.gif'" title="Lancer la recherche..."></a></td>
</tr>
</table>
</form>
<?
break;
case 'list_pre':
$formR=unserialize(@gzuncompress($_SESSION['list_pre']));
case 'list':
?>
<table width="580" height="100%" border="0" align="left" bgcolor="#FFFFFF">
<tr>
<td width="10">&nbsp;</td>
<td valign="top" width="570"><br/><?//print_r($_REQUEST);die();
/** On effectue la recherche
**/
if (!is_array($formR) || count($formR)==0)
$formR=$_POST['formR'];
if ($formR['type']=='ent' || $formR['type']=='dir') $typeRech=$formR['type'];
//else die('Type de recherche incorrecte');
$siret=trim(strtr($formR['siret'],array(' '=>'', '.'=>'', '-'=>'', '/'=>'')));
$pays=strtoupper(substr($siret,0,2));
$typeId='';
if ($siret<>'') {
if (strtoupper(substr($siret,0,1))=='W') {
$typeId='W';
$autreId=$siret;
$siret='';
}
elseif ($pays=='AT' || $pays=='BE' || $pays=='BG' || $pays=='CY' || $pays=='CZ' || $pays=='DE' || $pays=='DK' ||
$pays=='EE' || $pays=='EL' || $pays=='ES' || $pays=='FI' || $pays=='GB' || $pays=='HU' || $pays=='IE' ||
$pays=='IT' || $pays=='LT' || $pays=='LU' || $pays=='LV' || $pays=='MT' || $pays=='NL' || $pays=='PL' ||
$pays=='PT' || $pays=='RO' || $pays=='SE' || $pays=='SI' || $pays=='SK')
die("La recherche par num<75>ro de TVA n'est pas encore possible sur ce pays !");
elseif ($pays=='FR') {
$len=strlen($siret);
if ($len==13)
$siret=substr($siret,4,9);
elseif ($len==12) {
// C'est probablement un code ISIN
$typeId='I';
$autreId=$siret;
$siret='';
}
}
elseif (preg_match('/A|B|C|D/i', $siret)) {
$typeId='R';
$autreId=$siret;
$siret='';
}
else
$siret=trim(preg_replace('/[^0-9]/', '', $siret));
}
$telFax=trim(preg_replace('/[^0-9]/', '', $formR['telFax']));
$naf=trim(preg_replace('/[^0-9A-Z]/i', '', $formR['naf']));
//if ($telFax<>'') $typeId='T';
//$raisonSociale=;
if (isUTF8($formR['raisonSociale'])) {
$formR['raisonSociale']=utf8_decode($formR['raisonSociale']);
}
$raisonSociale=preg_replace('/[^0-9A-Z]/', ' ', strtoupper(strtr($formR['raisonSociale'], '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݟ', 'aaaaaaaceeeeiiiionooooouuuuyyAAAAAAACEEEEIIIIONOOOOOUUUUYY')));
$numVoie=preg_replace('/[^0-9]/', '', $formR['numVoie']);
if ($numVoie>9999) die('Num<75>ro de voie incorrecte !');
$libVoie=preg_replace('/[^0-9A-Z]/', ' ', strtoupper(strtr(strtolower($formR['voie']), '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݟ', 'aaaaaaaceeeeiiiionooooouuuuyyAAAAAAACEEEEIIIIONOOOOOUUUUYY')));
$cpVille=preg_replace('/ +/',' ', preg_replace('/[^0-9A-Z]/', ' ', //strtoupper(trimAccent($formR['cpVille']))));
strtoupper(strtr(strtolower($formR['cpVille']), '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݟ', 'aaaaaaaceeeeiiiionooooouuuuyyAAAAAAACEEEEIIIIONOOOOOUUUUYY'))));
if (preg_match("/^([0-9]{2,5})([\D]*)/i", $cpVille, $matches)) {
$cp=trim($matches[1]);
$ville=trim($matches[2]);
}
else $ville=trim($cpVille);
if ($typeRech=='dir') {
$dirNom=preg_replace('/[^0-9A-Z]/', ' ', strtoupper(trimAccent($formR['dirNom'])));
$dirPrenom=preg_replace('/[^0-9A-Z]/', ' ', strtoupper(trimAccent($formR['dirPrenom'])));
$dirDateNaissJJ=preg_replace('/[^0-9]/', '', $formR['dirDateNaissJJ'])*1;
if ($dirDateNaissJJ<0 || $dirDateNaissJJ>31) die('Jour de naissance incorrect !');
$dirDateNaissMM=preg_replace('/[^0-9]/', '', $formR['dirDateNaissMM'])*1;
if ($dirDateNaissMM<0 || $dirDateNaissMM>12) die('Mois de naissance incorrect !');
$dirDateNaissAAAA=preg_replace('/[^0-9]/', '', $formR['dirDateNaissAAAA'])*1;
$year=date('Y')-18;
if ($dirDateNaissAAAA<0 || $dirDateNaissAAAA>$year) die('Ann<6E>e de naissance incorrecte !');
$dirDateNaiss=$dirDateNaissJJ.'/'.$dirDateNaissMM.'/'.$dirDateNaissAAAA;
$dirCpVille=preg_replace('/ +/',' ', preg_replace('/[^0-9A-Z]/', ' ', strtoupper($formR['dirCpVille'])));
if (preg_match("/^([0-9]{2,5})([\D]*)/i", $dirCpVille, $matches)) {
$dirCp=trim($matches[1]);
$dirVille=trim($matches[2]);
}
else $dirVille=trim($dirCpVille);
}
$position=$formR['index'];
if ($typeRech=='ent' && $siret<>'') {
echo "<!--_typeRech=ent, siren=$siret-->\n";
try {
$O = $client->searchSiren($siret, $position, $tabInfo['nbReponses'], 200, $cp);
} catch (SoapFault $fault) {
include_once(realpath(dirname(__FILE__).'/../../').'/includes/soaperror.php');
processSoapFault($client,$fault,$tabInfo);
}
} elseif ($typeRech=='ent' && $telFax<>'') {
echo "<!--_typeRech=ent, telFax=$telFax-->\n";
try {
$O = $client->searchTelFax($telFax, $position, $tabInfo['nbReponses'], 200);
} catch (SoapFault $fault) {
include_once(realpath(dirname(__FILE__).'/../../').'/includes/soaperror.php');
processSoapFault($client,$fault,$tabInfo);
}
} elseif ($typeRech=='ent' && ($typeId=='R' || $typeId=='W' || $typeId=='I') ) {
echo "<!--_typeRech=ent, Autre Id $typeId=$autreId-->\n";
try {
$O = $client->searchAutreId($typeId, $autreId, $position, $tabInfo['nbReponses'], 200);
} catch (SoapFault $fault) {
include_once(realpath(dirname(__FILE__).'/../../').'/includes/soaperror.php');
processSoapFault($client,$fault,$tabInfo);
}
} elseif ($typeRech=='ent' && $siret=='') {
echo "<!--_typeRech=ent, $raisonSociale, $numVoie $libVoie, $cp, $ville-->\n";
try {
$O = $client->searchNomAdr($raisonSociale, $numVoie.' '.$libVoie, $cp, $ville, false, false, $position, $tabInfo['nbReponses'],200, false, false, $naf);
} catch (SoapFault $fault) {
include_once(realpath(dirname(__FILE__).'/../../').'/includes/soaperror.php');
processSoapFault($client,$fault,$tabInfo);
}
} elseif ($typeRech=='dir') {
echo "<!--_typeRech=dir, $nom, $prenom, -->\n";
try {
$O = $client->searchDir($dirNom, $dirPrenom, $dirDateNaiss, $dirVille, $position, $tabInfo['nbReponses'], 200, false);
} catch (SoapFault $fault) {
include_once(realpath(dirname(__FILE__).'/../../').'/includes/soaperror.php');
processSoapFault($client,$fault,$tabInfo);
}
//print_r($O);die();
}
/* URL du formulaire de recherche */
$strRecherche ='<form name="form_recherche_ini" action="./?page=recherche&vue='.$formR['type'].'" method="POST" enctype="multipart/form-data">';
$strRecherche.='<input type="hidden" name="formR[siret]" value="'. $formR['siret'].'"/>';
$strRecherche.='<input type="hidden" name="formR[raisonSociale]" value="'. $formR['raisonSociale'].'"/>';
$strRecherche.='<input type="hidden" name="formR[numVoie]" value="'. $formR['numVoie'].'"/>';
$strRecherche.='<input type="hidden" name="formR[voie]" value="'. $formR['voie'].'"/>';
$strRecherche.='<input type="hidden" name="formR[cpVille]" value="'. $formR['cpVille'].'"/>';
$strRecherche.='<input type="hidden" name="formR[telFax]" value="'. $formR['telFax'].'"/>';
$strRecherche.='<input type="hidden" name="formR[naf]" value="'. $formR['naf'].'"/>';
$strRecherche.='<input type="hidden" name="formR[dirNom]" value="'. $formR['dirNom'].'"/>';
$strRecherche.='<input type="hidden" name="formR[dirPrenom]" value="'. $formR['dirPrenom'].'"/>';
$strRecherche.='<input type="hidden" name="formR[dirDateNaissJJ]" value="'. $formR['dirDateNaissJJ'].'"/>';
$strRecherche.='<input type="hidden" name="formR[dirDateNaissMM]" value="'. $formR['dirDateNaissMM'].'"/>';
$strRecherche.='<input type="hidden" name="formR[dirDateNaissAAAA]" value="'. $formR['dirDateNaissAAAA'].'"/>';
$strRecherche.='<input type="hidden" name="formR[dirCpVille]" value="'. $formR['dirCpVille'].'"/>';
$strRecherche.='</form>';
echo $strRecherche;
$strCriteres='<a href="Javascript:form_recherche_ini.submit()">'.trim(@implode(' ', $O['results']['criteres'])).'</a>';
/*'criteres'=>array('rs'=>$raisonSociale, 'adresse'=>$adresse, 'cp'=>$codePostal, 'ville'=>$ville */
if ($O['results']['nbReponses']==0) echo '<p class="StyleInfoLib">Pas de r&eacute;sultat affich&eacute; avec le(s) crit&egrave;re(s) " '. $strCriteres .'" ('.$O['results']['nbReponsesTotal'].' sans les filtres).</p>';
else {
$etabs=$O['results']['reponses'];
echo '<p class="StyleInfoLib">';
if ($O['results']['nbReponses']<$O['results']['nbReponsesTotal']) {
$totPage=ceil($O['results']['nbReponsesTotal']/$tabInfo['nbReponses']);
$curPage=ceil($position/$tabInfo['nbReponses'])+1;
echo $O['results']['nbReponsesTotal'].' r&eacute;ponses avec les crit&egrave;res "'. $strCriteres .'". '.$O['results']['nbReponses'].' r&eacute;sultats affich&eacute;s. Page '.$curPage.'/'.$totPage.'.';
} else {
$totPage=$curPage=1;
echo $O['results']['nbReponsesTotal'].' r&eacute;ponses avec les crit&egrave;res "'. $strCriteres .'".';
}
echo '</p>';
echo '<ol>';
foreach ($etabs as $i=>$etab) {
if ($etab['Siege']==1) $strEtab='&Eacute;tablissement si&egrave;ge ';
else $strEtab='&Eacute;tablissement secondaire ';
if ($etab['Actif']==1) $strEtab.='actif';
else $strEtab.='inactif';
if ($etab['Siege']<>1 || ($etab['Siege']==1 && $etab['Actif']<>1))
$lien='<a title="Voir la fiche d\'identit&eacute; du si<73>ge de cette entreprise" href="/?page=identite&siret='.$etab['Siren'].'">(Acc&egrave;s si&egrave;ge)</a>';
else $lien='';
?>
<li class="StyleInfoData" type="1" value="<?=((($curPage-1)*$tabInfo['nbReponses'])+$i+1);?>"><!--<?="$curPage / $totPage / ".$O['results']['nbReponsesTotal'] ." / ".$tabInfo['nbReponses']." / $position";?>-->
<b><a title="Voir la fiche d'identit&eacute; de cet &eacute;tablissement" href="/?page=identite&siret=<?=$etab['Siret']?>&idEntreprise=<?=$etab['id']?>"><?=$etab['Nom']?></a></b><br/>
<?
if ($etab['Enseigne']<>'' || $etab['Sigle']<>'') {
echo '<i>';
if ($etab['Enseigne']<>'') echo 'Enseigne : '.$etab['Enseigne'].'&nbsp;&nbsp;&nbsp;&nbsp;';
if ($etab['Sigle']<>'') echo 'Sigle : '.$etab['Sigle'];
echo '</i><br/>';
}
?><b>RCS <?=substr($etab['Siren'],0,3).' '.substr($etab['Siren'],3,3).' '.substr($etab['Siren'],6,3).' '.$etab['Nic'];?><br/>
<?=$strEtab;?></b>&nbsp;&nbsp;<?=$lien;?><br/>
<?=$etab['Adresse'];?><br/>
<?if ($etab['Adresse2']<>'') echo $etab['Adresse2'].'<br/>';?>
<b><?=$etab['CP'].' '.$etab['Ville']?></b><br/>
<?
/** Si pr<70>sent, on affiche la forme Juridique
**/
if (trim($etab['FJ'])<>'') { ?>
<i>Forme : <?=strWsToHtml($etab['FJLib']). ' ('.$etab['FJ'];?>)</i><br/>
<? }
/** Si pr<70>sent, on affiche l'activit<69> NAF
**/
if (trim($etab['NafEnt'])<>'') { ?>
<i>Activit&eacute; : <?=strWsToHtml($etab['NafEntLib']). ' ('.$etab['NafEnt'];?>)</i><br/>
<? }
if ($typeRech=='dir') {
echo '<u>Dirigeant recherch&eacute; :</u> ';
if ($etab['DirRs']<>'') {
echo '<b>'. strWsToHtml($etab['DirRs']) . '</b>, repr&eacute;sent&eacute; par ';
}
echo strWsToHtml($etab['DirNom']) .' '. strWsToHtml($etab['DirPrenom']);
if ($etab['DirNomUsage']<>'' && $etab['DirNomUsage']<>$etab['DirNom'])
echo ' ('. strWsToHtml($etab['DirNomUsage']) . ')';
/*
'DirDateEffet'=>$etab['dateEffet'],
'DirFonction'=>$etab['fonction'],
'DirDepart'=>$etab['depart'],*/
echo '<i>, '.strWsToHtml($etab['DirFonction']).'</i><br/>';
}
?>
<br/></li>
<?
}
echo '<table><tr>';
if ($curPage>1) {
$prev_index=$position-$O['results']['nbReponses'];
if ($prev_index<$O['results']['nbReponses'])
$prev_index=0;
//echo '<a href="./?page=recherche&action=rechercher&vue=list&index='.$O['results']['nbReponses'].'">Page suivante</a>';
?><td width="40%" align="right"><form name="form_recherche_prev" action="./?page=recherche&action=rechercher&vue=list" method="POST" enctype="multipart/form-data">
<input type="hidden" name="formR[type]" value="<?=$formR['type']?>"/>
<input type="hidden" name="formR[index]" value="<?=$prev_index?>"/>
<input type="hidden" name="formR[siret]" value="<?=$formR['siret']?>"/>
<input type="hidden" name="formR[raisonSociale]" value="<?=$formR['raisonSociale']?>"/>
<input type="hidden" name="formR[numVoie]" value="<?=$formR['numVoie']?>"/>
<input type="hidden" name="formR[voie]" value="<?=$formR['voie']?>"/>
<input type="hidden" name="formR[cpVille]" value="<?=$formR['cpVille']?>"/>
<input type="hidden" name="formR[telFax]" value="<?=$formR['telFax']?>"/>
<input type="hidden" name="formR[naf]" value="<?=$formR['naf']?>"/>
<input type="hidden" name="formR[dirNom]" value="<?=$formR['dirNom']?>"/>
<input type="hidden" name="formR[dirPrenom]" value="<?=$formR['dirPrenom']?>"/>
<input type="hidden" name="formR[dirDateNaissJJ]" value="<?=$formR['dirDateNaissJJ']?>"/>
<input type="hidden" name="formR[dirDateNaissMM]" value="<?=$formR['dirDateNaissMM']?>"/>
<input type="hidden" name="formR[dirDateNaissAAAA]" value="<?=$formR['dirDateNaissAAAA']?>"/>
<input type="hidden" name="formR[dirCpVille]" value="<?=$formR['dirCpVille']?>"/>
<input type="image" src="./img/boutton_precedent_off.gif" name="submit" onmouseover="this.src='./img/boutton_precedent_on.gif'" onmouseout="this.src='./img/boutton_precedent_off.gif'" title="Page suivante..."></form></td>
<? }else echo '<td width="40%">&nbsp;</td>';
if ($curPage<>$totPage) {echo "<td width=\"20%\">Page $curPage/$totPage</td>";}
if ($curPage<$totPage) {
//echo '<a href="./?page=recherche&action=rechercher&vue=list&index='.$O['results']['nbReponses'].'">Page suivante</a>';
?><td width="40%" align="left"><form name="form_recherche_next" action="./?page=recherche&action=rechercher&vue=list" method="POST" enctype="multipart/form-data">
<input type="hidden" name="formR[type]" value="<?=$formR['type']?>"/>
<input type="hidden" name="formR[index]" value="<?=$position+$O['results']['nbReponses']?>"/>
<input type="hidden" name="formR[siret]" value="<?=$formR['siret']?>"/>
<input type="hidden" name="formR[raisonSociale]" value="<?=$formR['raisonSociale']?>"/>
<input type="hidden" name="formR[numVoie]" value="<?=$formR['numVoie']?>"/>
<input type="hidden" name="formR[voie]" value="<?=$formR['voie']?>"/>
<input type="hidden" name="formR[cpVille]" value="<?=$formR['cpVille']?>"/>
<input type="hidden" name="formR[telFax]" value="<?=$formR['telFax']?>"/>
<input type="hidden" name="formR[naf]" value="<?=$formR['naf']?>"/>
<input type="hidden" name="formR[dirNom]" value="<?=$formR['dirNom']?>"/>
<input type="hidden" name="formR[dirPrenom]" value="<?=$formR['dirPrenom']?>"/>
<input type="hidden" name="formR[dirDateNaissJJ]" value="<?=$formR['dirDateNaissJJ']?>"/>
<input type="hidden" name="formR[dirDateNaissMM]" value="<?=$formR['dirDateNaissMM']?>"/>
<input type="hidden" name="formR[dirDateNaissAAAA]" value="<?=$formR['dirDateNaissAAAA']?>"/>
<input type="hidden" name="formR[dirCpVille]" value="<?=$formR['dirCpVille']?>"/>
<input type="image" src="./img/boutton_suivant_off.gif" name="submit" onmouseover="this.src='./img/boutton_suivant_on.gif'" onmouseout="this.src='./img/boutton_suivant_off.gif'" title="Page suivante..."></form></td>
<? } else echo '<td width="40%">&nbsp;</td>';
echo '</table></ol>';
}
?>
<p class="StyleInfoLib"><br/>Si aucun r<>sultat ne correspond <20> votre recherche. <a href="./?page=recherche&action=rechercher&vue=enq">Cliquez-ici.</a><br/></p>
</td>
</tr>
</table>
<?
//On efface de la session les <20>l<EFBFBD>ments suivants $_SESSION['tabInfo']['entrep']
unset($_SESSION['tabInfo']['entrep']);
break;
default:
break;
}
function isUTF8($string)
{
return (utf8_encode(utf8_decode($string)) == $string);
}
?>