Integration modification trunk

This commit is contained in:
Michael RICOIS 2009-08-18 06:52:32 +00:00
parent a8b92ae72c
commit 672d2e6645
3 changed files with 126 additions and 116 deletions

View File

@ -2,13 +2,15 @@
<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>
<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>
<tr>
<td width="208" align="right" class="StyleRechercheLib"><b>NOM</b></td>
@ -21,6 +23,7 @@
<td width="72">&nbsp;</td>
</tr>
</table>
<!--<div id="subcontent1" style="display:none">--><div id="subcontent1" style="display:block">
<br/>
<table>
@ -36,12 +39,14 @@
</tr>
</table>
</div>
</td>
</tr>
</tr>
</table>
<table width="580">
<tr>
<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..."></td>
</tr>
</tr>
</table>
</form>

View File

@ -15,13 +15,15 @@ $(document).ready(function(){
<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>
<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>
@ -34,6 +36,7 @@ $(document).ready(function(){
<td width="72">&nbsp;</td>
</tr>
</table>
<!-- <div id="subcontent1" style="display:block"> -->
<br/>
<table>
@ -48,6 +51,7 @@ $(document).ready(function(){
<td width="72">&nbsp;</td>
</tr>
</table>
<br/>
<table>
<tr>
@ -56,6 +60,7 @@ $(document).ready(function(){
<td width="72">&nbsp;</td>
</tr>
</table>
<div id="subcontent1" style="display:block">
<table>
<tr>
@ -67,14 +72,16 @@ $(document).ready(function(){
</tr>
</table>
</div>
</td>
</tr>
</tr>
</table>
<table width="580">
<tr>
<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>
</tr>
</table>
</form>

View File

@ -1,4 +1,10 @@
<?php
if (!is_array($formR) || count($formR)==0) $formR=$_POST['formR'];
if ($formR['type']=='ent' || $formR['type']=='dir') $typeRech = $formR['type'];
$siret = trim(strtr($formR['siret'],array(' '=>'', '.'=>'', '-'=>'', '/'=>'')));
$pays = strtoupper(substr($siret,0,2));
$typeId = '';
function isUTF8($string)
{
return (utf8_encode(utf8_decode($string)) == $string);
@ -9,23 +15,15 @@ function isUTF8($string)
<td width="10">&nbsp;</td>
<td valign="top" width="570"><br/>
<?php
/** On effectue la recherche **/
if (!is_array($formR) || count($formR)==0) $formR=$_POST['formR'];
if ($formR['type']=='ent' || $formR['type']=='dir') $typeRech=$formR['type'];
$siret=trim(strtr($formR['siret'],array(' '=>'', '.'=>'', '-'=>'', '/'=>'')));
$pays=strtoupper(substr($siret,0,2));
$typeId='';
if ($siret<>'') {
//Numéro WALDEC
if ($siret<>'')
{
//Numéro WALDEC
if (strtoupper(substr($siret,0,1))=='W') {
$typeId='W';
$autreId=$siret;
$siret='';
}
//TVA Intracommunautaire
//TVA Intracommunautaire
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' ||
@ -44,28 +42,28 @@ if ($siret<>'') {
$firephp->info('Code ISIN');
}
}
//Numéro RC
//Numéro RC
elseif (preg_match('/A|B|C|D/i', $siret)) {
$typeId='R';
$autreId=$siret;
$siret='';
}
//Siren normal on enleve tout ce qui n'est pas un chiffre
//Siren normal on enleve tout ce qui n'est pas un chiffre
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']));
$telFax = trim(preg_replace('/[^0-9]/', '', $formR['telFax']));
$naf = trim(preg_replace('/[^0-9A-Z]/i', '', $formR['naf']));
//if ($telFax<>'') $typeId='T';
//Traitement des données formulaire;
if (isUTF8($formR['raisonSociale'])) $formR['raisonSociale']=utf8_decode($formR['raisonSociale']);
if (isUTF8($formR['raisonSociale'])) $formR['raisonSociale'] = utf8_decode($formR['raisonSociale']);
$raisonSociale = preg_replace('/[^0-9A-Z]/', ' ', strtoupper(strtr($formR['raisonSociale'], 'àáâãäåæçèéêëìíîïðñòóôõöùúûüýÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝŸ', 'aaaaaaaceeeeiiiionooooouuuuyyAAAAAAACEEEEIIIIONOOOOOUUUUYY')));
$numVoie = preg_replace('/[^0-9]/', '', $formR['numVoie']);
if ($numVoie>9999) die('Numéro de voie incorrecte !');
$libVoie=preg_replace('/[^0-9A-Z]/', ' ', strtoupper(strtr(strtolower($formR['voie']), 'àáâãäåæçèéêëìíîïðñòóôõöùúûüýÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝŸ', 'aaaaaaaceeeeiiiionooooouuuuyyAAAAAAACEEEEIIIIONOOOOOUUUUYY')));
$cpVille=preg_replace('/ +/',' ', preg_replace('/[^0-9A-Z]/', ' ', //strtoupper(trimAccent($formR['cpVille']))));
$libVoie = preg_replace('/[^0-9A-Z]/', ' ', strtoupper(strtr(strtolower($formR['voie']), 'àáâãäåæçèéêëìíîïðñòóôõöùúûüýÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝŸ', 'aaaaaaaceeeeiiiionooooouuuuyyAAAAAAACEEEEIIIIONOOOOOUUUUYY')));
$cpVille = preg_replace('/ +/',' ', preg_replace('/[^0-9A-Z]/', ' ', //strtoupper(trimAccent($formR['cpVille']))));
strtoupper(strtr(strtolower($formR['cpVille']), 'àáâãäåæçèéêëìíîïðñòóôõöùúûüýÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝŸ', 'aaaaaaaceeeeiiiionooooouuuuyyAAAAAAACEEEEIIIIONOOOOOUUUUYY'))));
if (preg_match("/^([0-9]{2,5})([\D]*)/i", $cpVille, $matches)) {
@ -96,7 +94,7 @@ if ($typeRech=='dir')
else $dirVille=trim($dirCpVille);
}
$position=$formR['index'];
$position = $formR['index'];
//Type de recherche = entreprise
if ($typeRech=='ent' && $siret<>'') {