diff --git a/includes/partenaires/classMRnvp.php b/includes/partenaires/classMRnvp.php index b47b9ce4..2abeb213 100644 --- a/includes/partenaires/classMRnvp.php +++ b/includes/partenaires/classMRnvp.php @@ -507,10 +507,16 @@ G "libCom32 , libCom38", "codeInseeCom='$codeInsee' LIMIT 0,1",false, MYSQL_ASSOC); $nbRet=count($ret); - if ($nbRet==0) return 'Aucune correspondance VILLE'.EOL; - - if ($norme==32) return $ret[0]['libCom32']; - return $ret[0]['libCom38']; + if ($nbRet==0 && $codeInsee>99000) { + $codePaysInsee=substr($codeInsee,2,3); + $ret=$this->iDb->select('jo.tabPays', + "SUBSTRING(libPays,1,32) AS libCom32, SUBSTRING(libPays,1,38) AS libCom38", + "codePaysInsee='$codeInsee' ORDER BY dependance ASC LIMIT 0,1",false, MYSQL_ASSOC); + $nbRet=count($ret); + } + if ($nbRet==0) return 'Aucune correspondance VILLE'; + elseif ($norme==32) return $ret[0]['libCom32']; + else return $ret[0]['libCom38']; } function getCodCommune($libelleCommune, $depOuCp='', $debug=false) { @@ -546,5 +552,41 @@ G return $codeCommune; } + function normaliseAdresse76310($L1,$L2,$L3,$L4,$L5,$L6,$L7='') { + //ini_set('soap.wsdl_cache_enabled', 0); + $client = new SoapClient('http://www.rnvp-en-ligne.com/service.asmx?wsdl'); + $array = array ( + 'pi_session' => '-1', + 'pi_user' => 'SDPROD', + 'pi_password' => '7631014530', + 'pi_codedossier' => '0001', + 'pi_numfichier' => '1', + 'pi_rsoc' => utf8_encode($L1), + //'pio_civ' => '', + //'pio_nom' => '', + //'pio_prenom' => '', + 'pio_cnom' => utf8_encode($L2), // Ligne 2 + 'pio_cadrs' => utf8_encode($L3), // Ligne 3 + 'pio_adresse' => utf8_encode($L4), // Ligne 4 + 'pio_lieudit' => utf8_encode($L5), // Ligne 5 + 'pio_cpville' => utf8_encode($L6), // Ligne 6 + 'pio_pays' => utf8_encode($L7), // Ligne 7 +/* 'po_tnp' => '', + 'po_sex' => '', + 'po_civlong' => '', + 'po_cp' => '', + 'po_ville' => '', + 'po_insee' => '', + 'po_cqtnp' => '', + 'po_cqadrs' => '', + 'po_risquerestru' => '', + 'po_poidsmodif' => '', + 'po_rejet' => '', + 'po_etranger' => ''*/ + ); + $result = $client->Elfyweb_RNVP_Standard($array); + return ($result); + } + } ?> \ No newline at end of file