diff --git a/config/README b/config/README index 0ff94278a..18d13b6f9 100644 --- a/config/README +++ b/config/README @@ -9,20 +9,32 @@ dans le vhost SetEnv APPLICATION_ENV "REC" => Recette SetEnv APPLICATION_ENV "DEV" => Developpement -<<<<<<< .working -======= Répertoire de données (data) ============================ data/courrier -date/infogreffe data/log data/logos data/marques data/pdf ->>>>>>> .merge-right.r3206 +Répertoire de stockage (cache) +============================== +avis => stockage des avis de situation (tous les jours) +bdf => stockage des fichiers de la banque de france +consommation => csv consommation client (tous les jours) +creditsafe => (tous les jours) +css => impression pdf +graydon => méthod +imgcache => image générer (tous les jours) +infogreffe => requete et commande xml (toutes les semaines) +kbis => kbis au format pdf, xml, html (tous les jours) +liasse => liasse au format excel +portefeuille => portefeuille au format csv +surveillance => +survliste => + Liens symbolique -=================================== +================ ln -s PATH_DATA/logos PATH_SITE/cache/logos ln -s PATH_SITE/www/img PATH_SITE/cache/img ln -s PATH_DATA PATH_SITE/data diff --git a/framework/common/curl.php b/framework/common/curl.php index a2365cc1e..ee1e5d24a 100644 --- a/framework/common/curl.php +++ b/framework/common/curl.php @@ -1,7 +1,4 @@ Code réponse Serveur ** "header" => Headers du serveur diff --git a/framework/default/_includes/automate.class.php b/framework/default/_includes/automate.class.php deleted file mode 100644 index 3cbc511e5..000000000 --- a/framework/default/_includes/automate.class.php +++ /dev/null @@ -1,1016 +0,0 @@ -''); - var $server_url=false; - var $session_id=false; - var $session_error=false; - var $connected=false; - var $code_abonne=false; - var $http; - var $retour='array'; - var $debug=true; - var $debugPrint=false; - var $tabDebug=array(); - - function Automate($retour='array', $debug=false) { - //$this->Http(); -// $this->http=&new Http(); - $this->setRetour($retour); - $this->setDebug($debug); - } - - function setRetour($retour){ - $this->retour=$retour; - } - - function setDebug($debug){ - $this->debug=$debug; - } - - function trace($str) { - $message=date('Y/m/d H:i:s') .' - '. $str; - if ($this->debug==true) { - array_push($this->tabDebug, $message); - if ($this->debugPrint==true){ - echo $message . '
'; - flush();} - } - } - - function printTrace() { - print_r($this->tabDebug); - } - - function getLastError() { - return $this->tabDebug[count($this->tabDebug)-1]; - } - - function getPage($url) { - $this->trace('URL demandée : "'. $url .'"'); - return file_get_contents ($url); - } - - function getServerUrl() { - if (!$this->server_url) { - // On récupère le site automate 1 ou 2 - $str= $this->getPage('http://automate.bil.fr/'); - - //$str=$this->get('http://automate.bil.fr/'); - //echo $str;exit(); - $tab=explode('Accès Hyperbil ',$str); - $tab=explode('server_url=trim($tab[0]).'/'; - //$this->server_url='http://automate1.bil.fr/'; - } - $this->trace('URL du serveur BIL : '. $this->server_url); - //exit(); - return $this->server_url; - } - - function getSessionId() { - if (!$this->session_id) { - $str= $this->getPage($this->server_url .'cgi-bin/h2r?'); - - $tab=explode(';',$str); - $this->session_id=$tab[1]; - } - $this->trace('ID de session provisoire : '. $this->session_id); - $this->trace($str); - //exit(); - return $this->session_id; - } - - function connect($user, $password) { - if (!$this->connected) { - if (!$this->session_id) $this->getSessionId($this->getServerUrl()); - $this->code_abonne=$user; - $str=$this->getPage ( $this->server_url .'cgi-bin/h2r?magic='. $this->session_id .'&rq=hbilaboncsv&QPABO='. $user .'&QPPAS='. $password); - $tab=explode(';',$str); - if ( $tab[0]!=$user || $tab[1]!=1 ) { - $this->session_id=trim(strip_tags($tab[2])); - if (strpos($this->session_id, 'invalide')>0) - { - $this->session_error=$tab[3].' '.$tab[2]; - $this->trace('Erreur de connexion : '. $this->session_error); - return false; - }else{ - $this->connected=true; - $this->trace('Connexion OK. ID de session définitif : '. $this->session_id); - //exit(); - return $this->session_id; - } - } else { - $this->session_error=$tab[3]; - $this->trace('Erreur de connexion : '. $this->session_error); - return false; - } - } - $this->trace('Connexion déjà existante !'); - return true; - } - - function getListeProduits($siren) { - if ($this->connected) { - $str=$this->getPage ($this->server_url .'cgi-bin/h2r?magic='. $this->session_id .'&rq=hbilbaicsv&QIABO='. $this->code_abonne .'&QISIR='. $siren.'&CT=texte/separateur:point-virgule'); - //$tab=explode(';',$str); - if ($this->retour=='array') - return $this->csv2array($str, $siren); - elseif ($this->retour=='csv') - return $str; - } - } - - function getFicheIdentite($siren, $nic='', $type='', $numentrep='', $refClient='', $retour='') { - if ($retour=='') $retour=$this->retour; - if ($type=='') $typeFiche=''; - else $typeFiche=$type; -/* -hbilsoid Requête IDENTITE FORMAT SO2000 -hbilsoids -hbilsoidci Fiche identité Complete INSEE SO2000 -hbilsoidc Fiche identité Complete SO2000 -*/ - if ($this->connected) { - $str=strip_tags($this->getPage ($this->server_url .'cgi-bin/h2r?magic='. $this->session_id .'&rq=hbilsoid'. $typeFiche .'&QIABO='. $this->code_abonne .'&QISIR='. $siren .'&QINIC='. $nic .'&CT=text/plain')); - //$tab=explode(';',$str); - if ($retour=='array') - return $this->so2array('ID', $str); - elseif ($retour=='csv') - return array2csv($this->so2array('ID', $str)); - else - return $str; - } - } - - function getDatesClotures($siren, $numentrep='', $retour='') { - if ($retour=='') $retour=$this->retour; - - if ($this->connected) { - $str=$this->getPage($this->server_url .'cgi-bin/h2r?magic='. $this->session_id .'&rq=hbilbillcsv&QIABO='. $this->code_abonne .'&QISIR='. $siren .'&CT=texte/separateur:point-virgule' ); - $this->trace('Dates clotures CSV Automate = "'.$str.'"'); - $ret=$this->csv2array($str, $siren); - if ($retour=='array') - return $ret; - elseif ($retour=='csv') - return $ret[0]['RISIR'] .';'. - $ret[0]['RETOUR'] .';'. - $ret[0]['RINUME'] .';'. - $ret[0]['RBDTCN'] .';'. - $ret[0]['RDDURN'] .';'. - $ret[1]['RBDTCN'] .';'. - $ret[1]['RDDURN'] .';'. - $ret[2]['RBDTCN'] .';'. - $ret[2]['RDDURN'] .";\n"; - // return strip_tags(sstr_replace("\n", '', $str))."\n"; - } - } - - function getBilan($siren, $dateCloture='', $numentrep='', $retour='') { - if ($retour=='') $retour=$this->retour; - - if ($this->connected) { - if ($dateCloture=='') $dateCloture=date('d/m/Y'); - - $str=$this->getPage($this->server_url .'cgi-bin/h2r?magic='. $this->session_id .'&rq=hbilsobi&QIABO='. $this->code_abonne .'&QISIR='. $siren .'&QIDLIM='. $dateCloture .'&CT=text/plain' ); - - $this->trace('Bilan Automate = "'.$str.'"'); - - if ($retour=='array') - return $this->so2array('BI', $str); - - elseif ($retour=='csv') - return $str; - // return strip_tags(sstr_replace("\n", '', $str))."\n"; - } - } - - function getSolvaBil($siren, $niveauSolvaBil=3, $encours='', $refClient='', $solvaBilPlus='', $format='csv', $dateCalcul='') { - if ($this->connected) { - if ($refClient=='') $refClient='Automate'; - $url=$this->server_url .'cgi-bin/solv_lst?magic='. $this->session_id .'&nb=1&QIABO='. $this->code_abonne .'&QISIR1='. $siren .'&QIREFC1='. $refClient .'&QIENCO1='. $encours .'&niv='. $niveauSolvaBil . '&format='. $format . '&QISSTY='. $solvaBilPlus; - $str=$this->getPage($url);// .'&QNDOBS='. $dateCalcul); - echo "Demande=$url\r\n"; - echo "Reponse=$str\r\n"; - $this->trace('SolvaBil CSV Automate = "'.$str.'"'); - if ($this->retour=='array') - return $this->csv2array($str, $siren); - elseif ($this->retour=='csv') - //return strip_tags($str); - return strip_tags($str); - } - } - - function getActionnaires($siren, $numentrep='') { - if ($this->connected) { - $str=$this->getPage($this->server_url .'cgi-bin/h2r?magic='. $this->session_id .'&rq=hbilactlcsv&QIABO='. $this->code_abonne .'&QISIR='. $siren .'&QINUME='. $numentrep .'&CT=texte/separateur:point-virgule' ); - $this->trace('Actionnaires CSV Automate = "'.$str.'"'); - if ($this->retour=='array') - return $this->csv2array($str, $siren); - elseif ($this->retour=='csv') - return strip_tags($str); - } - } - - function getRecherche($siren='', $nic='', $raisonSociale='', $prenom='', $numRue='', $nomRue='', $codePostal='', $ville='', $tel='', $ape='') { - if ($this->connected) { - $url=$this->server_url .'cgi-bin/h2r?magic='. $this->session_id .'&rq=hbilentlcsv&QIABO='. $this->code_abonne .'&QISIR='. $siren .'&CT=texte/separateur:point-virgule' . - '&QINIC='. $nic . - '&QINOM='. $raisonSociale . - '&QIPRN='. $prenom . - '&QINRU='. $numRue . - '&QIRUE='. $nomRue . - '&QICP=' . $codePostal . - '&QIVIL='. $ville . - '&QITEL='. $tel . - '&QIAPE='. $ape ; - $str= $this->getPage($url); - $tab=$this->csv2array($str); - - return $tab; - } - } - - - function getAnnoncesLegales($siren, $numentrep='', $sansLeTexte='a') { - if ($this->connected) { - //http://automate.bil.fr/cgi-bin/h2r?CT=text/plain&magic=XXXXX-XX-XXXXX &rq=hbilsoann& QIABO=999999999&QISIR=999999999&QINUME=999999999&QIREFC=XXXXXXXXXXXX - $str=$this->getPage($this->server_url .'cgi-bin/h2r?CT=text/plain&magic='. $this->session_id .'&rq=hbilsoan'.$sansLeTexte.'&QIABO='. $this->code_abonne .'&QISIR='. $siren .'&QINUME='. $numentrep .'&QIREFC=XXXXXXXXXXXx'); - $this->trace('Annonces Legales SO2000 Automate = "'.$str.'"'); - //echo $numentrep .' - '. $str; - if ($this->retour=='array') - return $this->csv2array($str, $siren); - elseif ($this->retour=='csv') - return strip_tags($str); - } - } - - function getDirigeants($siren, $numentrep='') { - if ($this->connected) { - //http://automate.bil.fr/cgi-bin/h2r?CT=text/plain&magic=XXXXX-XX-XXXXX &rq=hbilsoann& QIABO=999999999&QISIR=999999999&QINUME=999999999&QIREFC=XXXXXXXXXXXX - $str=$this->getPage($this->server_url .'cgi-bin/h2r?CT=text/plain&magic='. $this->session_id .'&rq=hbilsodir&QIABO='. $this->code_abonne .'&QISIR='. $siren .'&QINUME='. $numentrep .'&QIREFC=XXXXXXXXXXXx'); - $this->trace('Dirigeants SO2000 Automate = "'.$str.'"'); - //echo $numentrep .' - '. $str; - if ($this->retour=='array') - return $this->csv2array($str, $siren); - elseif ($this->retour=='csv') - return strip_tags($str); - } - } - - - - - - - - - - - - - - - - function so2array($ficheSO2000, $str) { - switch ($ficheSO2000){ - case 'ID': - $tab_ret=array( - 'SONABO'=>trim(substr($str, 0, 9)), // N°ABONNE (I) ******************** - 'SONUME'=>trim(substr($str, 9, 9)), // N°ENTREPRISE (I) * FICHE COMPLETE * - 'SONUS' =>trim(substr($str, 18, 9)), // N°UFS (I) * +EXTENSION INSEE * SONUS_V - 'SOANN' =>trim(substr($str, 27, 9)), // N° ANNONCE (I) ******************** - 'SORCS' =>trim(substr($str, 36, 14)), // N°SIRET (I) - 'SOPRD' =>trim(substr($str, 50, 2)), // CODE PRODUIT (I) SOPRD_N - 'SOSEQ' =>trim(substr($str, 52, 5)), // SEQUENCE DANS GROUPE(I) SOSEQ_N - 'SODTEN'=>trim(substr($str, 57, 8)), // DATE ENVOI (I) AAAAMMJJ SODTEN_D - 'SOTENR'=>trim(substr($str, 65, 1)), // CODE ENREGISTREMENT (I) - 'SOTYP' =>trim(substr($str, 66, 3)), // TYPE STRUCTURE (I) "ID " SOTYP_V - 'SOCONF'=>trim(substr($str, 69, 1)), // Code confirmé (I) - 'SOREFC'=>trim(substr($str, 70, 30)), // REFERENCE CLIENT (I) SOREFC_X - 'SOORIG'=>trim(substr($str, 100, 1)), // Code Origine BIL (S) - 'SOSDTX'=>trim(substr($str, 101, 1)), // INDIC. QUALITE (S) - 'SOMAJ' =>trim(substr($str, 102, 9)), // TEMOIN DE MAJ (S) SOMAJ_N - 'SONOM' =>trim(substr($str, 111, 60)), // RAISON SOCIALE p/1 (I) (INSEE=40) SONOM_X - 'SONOM2'=>trim(substr($str, 171, 30)), // RAISON SOCIALE p/2 (I) (INSEE=BLANC) SONOM_N - 'SOSIG' =>trim(substr($str, 201, 30)), // SIGLE (S) (INSEE=20) SOSIG_N - 'SOENS' =>trim(substr($str, 231, 60)), // ENSEIGNE (S) (INSEE=40) SOENS_X - 'SONRU' =>trim(substr($str, 291, 4)), // N°DS LA RUE (S) - 'SOBTQ' =>trim(substr($str, 295, 1)), // B=BIS T=TER Q=QUAT. (S) - 'SORUE' =>trim(substr($str, 296, 33)), // NOM DE LA RUE (S) - 'SOCOM' =>trim(substr($str, 329, 32)), // LIBELLE COMMUNE (I) - 'SOCP' =>trim(substr($str, 361, 5)), // CODE POSTAL (I) SOCP_N - 'SOCPLA'=>trim(substr($str, 366, 30)), // COMPLEMENT ADRESSE (S) SOCPLA_N - 'SODTCT'=>trim(substr($str, 396, 8)), // DATE CREATION ENTREP (S) AAAAMMJJ DTCREE_D - 'SOSTAE'=>trim(substr($str, 404, 1)), // STATUT ETABLISSEMENT (S) Table INS - 'SOCJEN'=>trim(substr($str, 405, 4)), // CATEG JURIDIQUE (S) Table INC SOCJEN_X - 'SOTSEX'=>trim(substr($str, 409, 1)), // SEXE SI PP (S) Table IMF - 'SONBET'=>trim(substr($str, 410, 4)), // NOMBRE ETAB. (S) NBRETE_C - 'SOAPET'=>trim(substr($str, 414, 4)), // NAF ENTREPRISE (S) Table APE - 'SOAPFT'=>trim(substr($str, 418, 4)), // CODE "FAMILLE" ENTR. (C) Table APY SOAPFT_N - 'SOAPEE'=>trim(substr($str, 422, 4)), // NAF ETABLISSEMT (S) Table APE - 'SOAPFE'=>trim(substr($str, 426, 4)), // CODE "FAMILLE" ETAB. (C) Table APY SOAPFE_N - 'SORLJ' =>trim(substr($str, 430, 1)), // Proc.Collective (C) "O"=RLJ SORLJ_N - 'SOCAPM'=>trim(substr($str, 431, 2)), // MONNAIE (C) Table BDV SOCAPM_N - 'SOCAPI'=>trim(substr($str, 433, 13)), // MONTANT CAPITAL (C) CAPITE_X - 'SOEFF' =>trim(substr($str, 446, 7)), // EFFECTIF (+Ext) blanc=non précisé SOEFF_N - 'SORCE' =>trim(substr($str, 453, 9)), // N°RC (C) RCE_X - 'SOETEL'=>trim(substr($str, 462, 10)), // TELEPHONE SOURCE BIL (S) - 'SOEFAX'=>trim(substr($str, 472, 10)), // FAX SOURCE BIL (S) - 'SOEWEB'=>trim(substr($str, 482, 40)), // SITE WEB SOURCE BIL (S) non encore renseigné SOEWEB_N - 'SOEDRQ'=>trim(substr($str, 522, 3)), // QUALITE DIRIGEANT (C) source BIL - 'SOEDRN'=>trim(substr($str, 525, 60)), // NOM-prénom DIRIGEANT (C) source BIL SOEDRN_X - 'SDEDRD'=>trim(substr($str, 585, 8)), // DATE NAISSANCE DIRIG (C) AAAAMMJJ SOEDRD_D - 'SOEDRL'=>trim(substr($str, 593, 35)), // LIEU NAISSANCE DIRIG (C) source BIL SOEDRL_N - 'SORSNO'=>trim(substr($str, 628, 2)), // NOTE SUR 20 (+sc) BLANC=PAS DE NOTE - 'SORSEC'=>trim(substr($str, 630, 7)), // ENCOURS EN KILO (+sc) BLANC=PAS D ENCOURS - 'SORSCP'=>trim(substr($str, 637, 1)), // CODE PAIEMENT (+sc) Table S53 - 'SORSSF'=>trim(substr($str, 638, 1)), // CODE SITU FINANCERE (+sc) Table S53 - 'SORSCA'=>trim(substr($str, 639, 1)), // CODE AVIS (+sc) Table S53 - 'SORSMO'=>trim(substr($str, 640, 3)), // MONNAIE LIVRAISON ENCOURS (+sc) Table BDV - 'SOSICO'=>trim(substr($str, 643, 6)), // CODE SICOVAM (C) STE COTEE EN BOURSE SOSICO_N - 'SOTYPM'=>trim(substr($str, 649, 2)), // TYPE DE MARCHE (C) STE COTEE EN BOURSE SOTYPM_N - 'SOISIN'=>trim(substr($str, 651, 12)), // CODE ISIN (C) STE COTEE EN BOURSE SOISIN_N - 'SOIDR1'=>trim(substr($str, 663, 41)), // réserve, non encore renseigné - 'SONICC'=>trim(substr($str, 704, 5)), // NIC SOURCE/CIBLE (C)(+Ext) TRANSFERT ADRESSE SONICC_N - 'SODCAP'=>trim(substr($str, 709, 8)), // DATE MAJ CAPITAL (C) AAAAMMJJ SODCAP_D - 'SOCAPO'=>trim(substr($str, 717, 3)), // CAPITAL MONNAIE ORI (C) Table BDV - 'SOCAPL'=>trim(substr($str, 720, 3)), // CAPITAL MONNAIE LIV (C) Table BDV - 'SODTCE'=>trim(substr($str, 723, 8)), // DATE CREAT ETAB (+Ext) AAAAMMJJ SODTCE_D - 'SOORIC'=>trim(substr($str, 731, 1)), // ORI.CREATION ENTREP (+Ext) Table INJ SOORIC_N - 'SOCLAT'=>trim(substr($str, 732, 2)), // TR.EFFECTIF ENTREP(C)(+Ext*)Table INL -'CLAE'=>trim(substr($str, 734,2)), //TR.EFFECTIF ETAB(+Ext)TableINL -'SOA40T'=>trim(substr($str, 736,2)), //NAP 40 ENTREP(+Ext)TableA40 -'SOA40E'=>trim(substr($str, 738,2)), //NAP 40 ETAB(+Ext)TableA40 -'SOEACA'=>trim(substr($str, 740,5)), //ACT.ARTISANALE ETAB(+Ext)TableARA -'SOEMDT'=>trim(substr($str, 745,1)), //MODALITE ACT. ENTREP(+Ext)TableIMO -'SOEMDE'=>trim(substr($str, 746,1)), //MODALITE ACT. ETAB(+Ext)TableIMO -'SOERGS'=>trim(substr($str, 747,2)), //CODE REGION ENTREP(C)(+Ext*)TableINGSOERGS_N -'SOERGE'=>trim(substr($str, 749,2)), //CODE REGION ETAB(C)(+Ext*)TableING -'SOEDPS'=>trim(substr($str, 751,2)), //DEPARTEMENT SIEGE(S) (+Ext*)DPSIE_C -'SOELCS'=>trim(substr($str, 753,3)), //CODE LOCALITE SIEGE(S) (+Ext*) -'SOEDPE'=>trim(substr($str, 756,2)), //DEPARTEMENT ETAB(S) (+Ext*) -'SOELCE'=>trim(substr($str, 758,3)), //CODE LOCALITE ETAB(S) (+Ext*)SOLIN_C -'SOARDO'=>trim(substr($str, 761,1)), //DEP.OUTRE MER(+Ext) NRTableIDOSOARDO_N -'SOARD'=>trim(substr($str, 762,1)), //ARRONDISSEMENT(+Ext) -'SOCANO'=>trim(substr($str, 763,1)), //DEP.OUTRE MER(+Ext) NRTableIDOSOCANO_N -'SOCAN'=>trim(substr($str, 764,2)), //CANTON(+Ext) -'SOILOT'=>trim(substr($str, 766,8)), //CODE ILOT(+Ext) NRSOILOT_N -'SOTZEM'=>trim(substr($str, 774,2)), //ZONE EMPLOI ETAB(+Ext)TableINZ -'SOTTCO'=>trim(substr($str, 776,2)), //TRANCHE COMMUNE ETAB(+Ext)TableICD -'SOTDPU'=>trim(substr($str, 778,2)), //DEP UNITE.URB ETAB(+Ext)SOTDPU_N -'SOTTLU'=>trim(substr($str, 780,1)), //TAILLE UN.URB ETAB(+Ext)TableICUSOTTLU_N -'SOTUNU'=>trim(substr($str, 781,2)), //UNITE URBAINE ETAB(+Ext)SOTUNU_X -'SOTRIV'=>trim(substr($str, 783,5)), //CODE RIVOLI ETAB(+Ext)SOTRIV_X -'SOTRGP'=>trim(substr($str, 788,2)), //PPALE REGION ENTREP(+Ext)TableING -'SOTMON'=>trim(substr($str, 790,1)), //MONOREGIONALITE(+Ext)TableIMR -'SOTMOA'=>trim(substr($str, 791,1)), //MONOACTIVITE(+Ext)TableIMPSOTMOA_N -'SOECA'=>trim(substr($str, 792,1)), //CODE TRANCHE CA(C)(+Ext*)TableINTSOECA_X -'SOECAX'=>trim(substr($str, 793,1)), //TRANCHE PART EXPORT(C)(+Ext*)TableINPSOECAX_X -'SOTRPE'=>trim(substr($str, 794,1)), //REPERTOIRE ENT ETAT(+Ext)TableIEE -'SOORDI'=>trim(substr($str, 795,1)), //ENTREPRISE ORDINAIRE(+Ext)TableIEOSOORDI_N -'SOENAT'=>trim(substr($str, 796,2)), //CODE NATURE ETAB(+Ext)TableINN -'SOSINE'=>trim(substr($str, 798,2)), //Type Exploitation(C)(+Ext*)TableINE - - - - ); - break; - - case 'BI': - $fcontents=explode("\n",$str); - - $i=1; - while (substr($fcontents[$i], 65, 1)=='7') - { - $tabBilan['SIRET'] =substr($fcontents[$i], 36, 14); - $tabBilan['DATE_FRAICHE_BILAN'] =substr($fcontents[$i], 57, 8); // SSAAMMJJ - $tabBilan['DATE_CLOTURE'] =substr($fcontents[$i], 101, 8); // SSAAMMJJ - $tabBilan['DATE_CLOTURE_PRE'] =substr($fcontents[$i], 109, 8); // SSAAMMJJ - $tabBilan['DUREE_MOIS'] =substr($fcontents[$i], 117, 2); - $tabBilan['DUREE_MOIS_PRE'] =substr($fcontents[$i], 119, 2); - $tabBilan['MONNAIE'] =substr($fcontents[$i], 121, 2); - $tabBilan['CONSOLIDE'] =substr($fcontents[$i], 123, 1); // C = Bilan consolidé - $tabBilan['MONNAIE_ORI'] =substr($fcontents[$i], 793, 3); - $tabBilan['MONNAIE_LIV_UNITE'] =substr($fcontents[$i], 796, 1); - $tabBilan['MONNAIE_LIV'] =substr($fcontents[$i], 797, 3); - for ($j=0; $j<30; $j++) - { - $code =rtrim(substr($fcontents[$i], 124+$j*20, 4)); - if ($code!='') - { - $colonneLiasse=(int)substr($code,2,1); - //echo "$code => $colonneLiasse
"; - $signe =substr($fcontents[$i], 128+$j*20, 1); - $valeur =(double)substr($fcontents[$i], 129+$j*20, 15); - if ($signe=='-') - $valeur*=-1; -/* if ( $colonneLiasse>0 ) - { - if (!isset($tabBilan[substr($code,0,2)])) - $tabBilan[substr($code,0,2)]=$valeur; - } - else - */ - $tabBilan[$code]=$valeur; - } - } - $i++; - } - - - $tab_ret=$tabBilan;/*array( - 'SONABO'=>trim(substr($str, 0, 9)), // N°ABONNE (I) ******************** - 'SONUME'=>trim(substr($str, 9, 9)), // N°ENTREPRISE (I) * FICHE COMPLETE * - 'SONUS' =>trim(substr($str, 18, 9)), // N°UFS (I) * +EXTENSION INSEE * SONUS_V - 'SOANN' =>trim(substr($str, 27, 9)), // N° ANNONCE (I) ******************** - 'SORCS' =>trim(substr($str, 36, 14)), // N°SIRET (I) - 'SOPRD' =>trim(substr($str, 50, 2)), // CODE PRODUIT (I) SOPRD_N - 'SOSEQ' =>trim(substr($str, 52, 5)), // SEQUENCE DANS GROUPE(I) SOSEQ_N - 'SODTEN'=>trim(substr($str, 57, 8)), // DATE ENVOI (I) AAAAMMJJ SODTEN_D - 'SOTENR'=>trim(substr($str, 65, 1)), // CODE ENREGISTREMENT (I) - 'SOTYP' =>trim(substr($str, 66, 3)), // TYPE STRUCTURE (I) "ID " SOTYP_V - 'SOCONF'=>trim(substr($str, 69, 1)), // Code confirmé (I) - 'SOREFC'=>trim(substr($str, 70, 30)), // REFERENCE CLIENT (I) SOREFC_X - 'SOORIG'=>trim(substr($str, 100, 1)), // Code Origine BIL (S) - 'SOBICN'=>trim(substr($str, 101, 8)), // Date de cloture de l'exercice Exercice Année N au format SSAAMMJJ 20051231 - 'SOBIC1'=>trim(substr($str, 109, 8)), // Date de cloture de l'exercice précédent Exercice Année N-1 au format SSAAMMJJ 20041231 - 'SOBIDN'=>trim(substr($str, 117, 2)), // Durée en mois de l'exercice Durée de l'exercice au format MM 12 - 'SOBID1'=>trim(substr($str, 119, 2)), // Durée en mois de l'exercice précédent Durée de l'exercice N-1 au format MM 12 - 'SOBIMO'=>trim(substr($str, 121, 2)), // Monnaie du bilan Cf. Table BDV EUR - 'SOBICO'=>trim(substr($str, 123, 1)), // Type du bilan S = Bilan réel Normal / C = Bilan Consolidé S -//725 69 793 SOBIFF O AN Zone réservé Réservé usage GROUPE BIL - 'SOBIMU'=>trim(substr($str, 793, 3)), // Code devise ISO de déclaration du bilan Cf. Table BDV EUR - 'SOBIUL'=>trim(substr($str, 796, 1)), // Unité de la devise du bilan livré K=KILO - 'SOBIML'=>trim(substr($str, 123, 3)), // Code devise ISO du bilan livré Cf. Table BDV EUR - -/* - -125 4 128 SOBL01 N AN Code du poste bilan dans la liasse Cerfa Poste 01 * AX -129 1 129 SOBS01 N AN Signe du poste bilan, "-" si négatif Poste 01 * -130 15 144 SOBM01 N Num Montant du poste bilan en unité monétaire Poste 01 * 000000000012345 -145 4 148 SOBL02 N AN Code du poste bilan dans la liasse Cerfa Poste 02 BX -149 1 149 SOBS02 N AN Signe du poste bilan, "-" si négatif Poste 02 - -150 15 164 SOBM02 N Num Montant du poste bilan en unité monétaire Poste 02 000000000000045 -165 4 168 SOBL03 N AN Code du poste bilan dans la liasse Cerfa Poste 03 DE -169 1 169 SOBS03 N AN Signe du poste bilan, "-" si négatif Poste 03 000000000012345 -170 15 184 SOBM03 N Num Montant du poste bilan en unité monétaire Poste 03 -185 4 188 SOBL04 N AN Code du poste bilan dans la liasse Cerfa Poste 04 -189 1 189 SOBS04 N AN Signe du poste bilan, "-" si négatif Poste 04 -190 15 204 SOBM04 N Num Montant du poste bilan en unité monétaire Poste 04 -205 4 208 SOBL05 N AN Code du poste bilan dans la liasse Cerfa Poste 05 -209 1 209 SOBS05 N AN Signe du poste bilan, "-" si négatif Poste 05 -210 15 224 SOBM05 N Num Montant du poste bilan en unité monétaire Poste 05 -225 4 228 SOBL06 N AN Code du poste bilan dans la liasse Cerfa Poste 06 -229 1 229 SOBS06 N AN Signe du poste bilan, "-" si négatif Poste 06 -230 15 244 SOBM06 N Num Montant du poste bilan en unité monétaire Poste 06 -245 4 248 SOBL07 N AN Code du poste bilan dans la liasse Cerfa Poste 07 -249 1 249 SOBS07 N AN Signe du poste bilan, "-" si négatif Poste 07 -250 15 264 SOBM07 N Num Montant du poste bilan en unité monétaire Poste 07 -265 4 268 SOBL08 N AN Code du poste bilan dans la liasse Cerfa Poste 08 -269 1 269 SOBS08 N AN Signe du poste bilan, "-" si négatif Poste 08 -270 15 284 SOBM08 N Num Montant du poste bilan en unité monétaire Poste 08 -285 4 288 SOBL09 N AN Code du poste bilan dans la liasse Cerfa Poste 09 -289 1 289 SOBS09 N AN Signe du poste bilan, "-" si négatif Poste 09 -290 15 304 SOBM09 N Num Montant du poste bilan en unité monétaire Poste 09 -305 4 308 SOBL10 N AN Code du poste bilan dans la liasse Cerfa Poste 10 -309 1 309 SOBS10 N AN Signe du poste bilan, "-" si négatif Poste 10 -310 15 324 SOBM10 N Num Montant du poste bilan en unité monétaire Poste 10 -325 4 328 SOBL11 N AN Code du poste bilan dans la liasse Cerfa Poste 11 -329 1 329 SOBS11 N AN Signe du poste bilan, "-" si négatif Poste 11 -330 15 344 SOBM11 N Num Montant du poste bilan en unité monétaire Poste 11 -345 4 348 SOBL12 N AN Code du poste bilan dans la liasse Cerfa Poste 12 -349 1 349 SOBS12 N AN Signe du poste bilan, "-" si négatif Poste 12 -350 15 364 SOBM12 N Num Montant du poste bilan en unité monétaire Poste 12 -365 4 368 SOBL13 N AN Code du poste bilan dans la liasse Cerfa Poste 13 -369 1 369 SOBS13 N AN Signe du poste bilan, "-" si négatif Poste 13 -370 15 384 SOBM13 N Num Montant du poste bilan en unité monétaire Poste 13 -385 4 388 SOBL14 N AN Code du poste bilan dans la liasse Cerfa Poste 14 -389 1 389 SOBS14 N AN Signe du poste bilan, "-" si négatif Poste 14 -390 15 404 SOBM14 N Num Montant du poste bilan en unité monétaire Poste 14 -405 4 408 SOBL15 N AN Code du poste bilan dans la liasse Cerfa Poste 15 -409 1 409 SOBS15 N AN Signe du poste bilan, "-" si négatif Poste 15 -410 15 424 SOBM15 N Num Montant du poste bilan en unité monétaire Poste 15 -425 4 428 SOBL16 N AN Code du poste bilan dans la liasse Cerfa Poste 16 -429 1 429 SOBS16 N AN Signe du poste bilan, "-" si négatif Poste 16 -430 15 444 SOBM16 N Num Montant du poste bilan en unité monétaire Poste 16 -445 4 448 SOBL17 N AN Code du poste bilan dans la liasse Cerfa Poste 17 -449 1 449 SOBS17 N AN Signe du poste bilan, "-" si négatif Poste 17 -450 15 464 SOBM17 N Num Montant du poste bilan en unité monétaire Poste 17 -465 4 468 SOBL18 N AN Code du poste bilan dans la liasse Cerfa Poste 18 -469 1 469 SOBS18 N AN Signe du poste bilan, "-" si négatif Poste 18 -470 15 484 SOBM18 N Num Montant du poste bilan en unité monétaire Poste 18 -485 4 488 SOBL19 N AN Code du poste bilan dans la liasse Cerfa Poste 19 -489 1 489 SOBS19 N AN Signe du poste bilan, "-" si négatif Poste 19 -490 15 504 SOBM19 N Num Montant du poste bilan en unité monétaire Poste 19 -505 4 508 SOBL20 N AN Code du poste bilan dans la liasse Cerfa Poste 20 -509 1 509 SOBS20 N AN Signe du poste bilan, "-" si négatif Poste 20 -510 15 524 SOBM20 N Num Montant du poste bilan en unité monétaire Poste 20 -525 4 528 SOBL21 N AN Code du poste bilan dans la liasse Cerfa Poste 21 -529 1 529 SOBS21 N AN Signe du poste bilan, "-" si négatif Poste 21 -530 15 544 SOBM21 N Num Montant du poste bilan en unité monétaire Poste 21 -545 4 548 SOBL22 N AN Code du poste bilan dans la liasse Cerfa Poste 22 -549 1 549 SOBS22 N AN Signe du poste bilan, "-" si négatif Poste 22 -550 15 564 SOBM22 N Num Montant du poste bilan en unité monétaire Poste 22 -565 4 568 SOBL23 N AN Code du poste bilan dans la liasse Cerfa Poste 23 -569 1 569 SOBS23 N AN Signe du poste bilan, "-" si négatif Poste 23 -570 15 584 SOBM23 N Num Montant du poste bilan en unité monétaire Poste 23 -585 4 588 SOBL24 N AN Code du poste bilan dans la liasse Cerfa Poste 24 -589 1 589 SOBS24 N AN Signe du poste bilan, "-" si négatif Poste 24 -590 15 604 SOBM24 N Num Montant du poste bilan en unité monétaire Poste 24 -605 4 608 SOBL25 N AN Code du poste bilan dans la liasse Cerfa Poste 25 -609 1 609 SOBS25 N AN Signe du poste bilan, "-" si négatif Poste 25 -610 15 624 SOBM25 N Num Montant du poste bilan en unité monétaire Poste 25 -625 4 628 SOBL26 N AN Code du poste bilan dans la liasse Cerfa Poste 26 -629 1 629 SOBS26 N AN Signe du poste bilan, "-" si négatif Poste 26 -630 15 644 SOBM26 N Num Montant du poste bilan en unité monétaire Poste 26 -645 4 648 SOBL27 N AN Code du poste bilan dans la liasse Cerfa Poste 27 -649 1 649 SOBS27 N AN Signe du poste bilan, "-" si négatif Poste 27 -650 15 664 SOBM27 N Num Montant du poste bilan en unité monétaire Poste 27 -665 4 668 SOBL28 N AN Code du poste bilan dans la liasse Cerfa Poste 28 -669 1 669 SOBS28 N AN Signe du poste bilan, "-" si négatif Poste 28 -670 15 684 SOBM28 N Num Montant du poste bilan en unité monétaire Poste 28 -685 4 688 SOBL29 N AN Code du poste bilan dans la liasse Cerfa Poste 29 -689 1 689 SOBS29 N AN Signe du poste bilan, "-" si négatif Poste 29 -690 15 704 SOBM29 N Num Montant du poste bilan en unité monétaire Poste 29 -705 4 708 SOBL30 N AN Code du poste bilan dans la liasse Cerfa Poste 30 -709 1 709 SOBS30 N AN Signe du poste bilan, "-" si négatif Poste 30 -710 15 724 SOBM30 N Num Montant du poste bilan en unité monétaire Poste 30 - - - - */ - - // ); - break; - - } - return $tab_ret; - } - - function csv2array($strCSV, $siren='') { - $tab=explode("\n", $strCSV); - foreach ($tab as $ligne=>$data) { - $data2=explode(';', $data); - $ficheCSV=trim($data2[1]); - if (trim($data2[0])=='01') $ficheCSV='SOLV1'; - if (trim($data2[0])=='02') $ficheCSV='SOLV2'; - if (trim($data2[0])=='03') $ficheCSV='SOLV3'; - if((trim($data2[2])=='OUI' || trim($data2[2])=='NON') && - (trim($data2[3])=='OUI' || trim($data2[3])=='NON') && - (trim($data2[4])=='OUI' || trim($data2[4])=='NON')) $ficheCSV='DISPO'; - - switch ($ficheCSV) - { - case 'BILL': - $tab_ret=array( - 'RETOUR' =>'', - 'PRODUIT' =>'BILANS', - 'RISIR' =>$data2[3],// N° SIREN - 'RINUME' =>$data2[4], // N° ENTREPRISE - 'RBDTCN' =>$data2[5],// N° SIREN - 'RDDURN' =>trim($data2[6]),// N° SIREN - ); - $tab2[$ligne]=$tab_ret; - break; - case 'DISPO': - $tab_ret=array( - 'RETOUR'=>'', - 'PRODUIT'=>'PRODUITS', - 'RINUME'=>$data2[0],// N° ENTREPRISE - 'RISIR' =>$data2[1],// N° SIREN - 'RIANNL'=>$data2[2],// PRESENCE D'INFORMATION(S) LEGALE(S) - 'RIELML'=>$data2[3],// PRESENCE D'ELEMENTS FINANCIERS - 'RIBILL'=>$data2[4],// PRESENCE DE BILAN(S), ANNEXES OU RATIOS - 'RIINTL'=>$data2[5],// PRESENCE DE REPRESENTANTS LEGAUX - 'RIACTL'=>$data2[6],// PRESENCE D'ACTIONNAIRES - 'RIPARL'=>$data2[7],// PRESENCE DE FILIALES / PARTICIPATIONS - 'RIINFL'=>$data2[8],// PRESENCE D'INFORMATIONS COMMUNIQUES PAR L'ENTREPRISE - 'RICMP' =>$data2[9],// PRESENCE COMPETENCES TERRITORIALES - 'RISURV'=>$data2[10],// MISE EN SURVEILLANCE POSSIBLE - 'RILEV' =>$data2[11],// COMMANDE DE PIECES OFFICIELLES - 'RIRSC' =>$data2[12],// COMMANDE DE RENSEIGNEMENTS COMMERCIAUX - 'RISOLV'=>$data2[13],// SOLVABIL - ); - $tab2[$ligne]=$tab_ret; - break; - case 'ACTL': - $tab_ret=array('actionnaire'=>array( - 'RETOUR' =>'', - 'PRODUIT' =>'ACTIONNAIRES', - 'XLABO' =>str_replace('','',$data2[0]),// N° SIREN - 'RISIR' =>$data2[2],// N° SIREN - 'RINUME' =>$data2[3], // N° ENTREPRISE - 'RLPSIR' =>$data2[4],// N° SIREN - 'RLPNOM' =>$data2[5],// N° SIREN - 'RLPOUR' =>$data2[6],// N° SIREN - )); - $tab2[$ligne]=$tab_ret; - - break; - case 'SOLV3': - $tab_ret=array( - 'RETOUR' =>'', - 'PRODUIT' =>'SOLVABIL3', - 'RNISIR' =>$data2[3],// N° SIREN - 'RINUME' =>'', // N° ENTREPRISE - 'RNNIV' =>$data2[0], - 'RNDATN' =>$data2[1], - 'RNREFC' =>$data2[2], - 'RISIR' =>$data2[3], - 'RINIC' =>$data2[4], - 'RINRS' =>$data2[5], - 'RNNOTE' =>$data2[6], - 'XNENCO' =>$data2[7], - 'XNMONN' =>$data2[8], - 'RNENCO' =>$data2[9], - 'RNRUNM' =>$data2[10], - 'RNAVIL' =>$data2[11], - 'RNPAIL' =>$data2[12], - 'RNPAII' =>$data2[13], - 'RNSITL' =>$data2[14], - 'RISIGL' =>$data2[15], - 'RIENS' =>$data2[16], - 'RIRCE' =>$data2[17], - 'RINRU' =>$data2[18], - 'RIBIS' =>$data2[19], - 'RIRUE' =>$data2[20], - 'RICP' =>$data2[21], - 'RIVIL' =>$data2[22], - 'RITELT' =>$data2[23], - 'RIFAXT' =>$data2[24], - 'RICATL' =>$data2[25], - 'RICAT' =>$data2[26], - 'RICAPI' =>$data2[27], - 'RILIDV' =>$data2[28], - 'RIDTCR' =>$data2[29], - 'RIAPE' =>$data2[30], - 'RIAPEL' =>$data2[31], - 'RISINL' =>$data2[32], - 'RINBET' =>$data2[33], - 'RIDRN1' =>$data2[34], - 'RIDRR1' =>$data2[35], - 'RIDRF1' =>$data2[36], - 'RIDDN1' =>$data2[37], - 'RIDRV1' =>$data2[38], - 'RIDRN2' =>$data2[39], - 'RIDRR2' =>$data2[40], - 'RIDRF2' =>$data2[41], - 'RIDDN2' =>$data2[42], - 'RIDRV2' =>$data2[43], - 'RICAL' =>$data2[44], - 'RICAUM' =>$data2[45], - 'RICSEL' =>$data2[46], - 'RICOTL' =>$data2[47], - 'RITMAR' =>$data2[48], - 'RISICO' =>$data2[49], - 'RIACNO' =>$data2[50], - 'RIACSI' =>$data2[51], - 'RIACPO' =>$data2[52], - 'RIRLJ' =>$data2[53], - 'RIDATE' =>$data2[54], - 'RIEVTL' =>$data2[55], - 'RIROLL' =>$data2[56], - 'RISTYPL' =>$data2[57], - 'RISNOM' =>$data2[58], - 'RISNRU' =>$data2[59], - 'RISBIS' =>$data2[60], - 'RISRUE' =>$data2[61], - 'RISCP' =>$data2[62], - 'RISVIL' =>$data2[63], - 'RISTEL' =>$data2[64], - 'RFRUNM' =>$data2[65], - 'RFCLO3' =>$data2[66], - 'RFDUR3' =>$data2[67], - 'RFCA3' =>$data2[68], - 'RFCAX3' =>$data2[69], - 'RFRP3' =>$data2[70], - 'RFFF3' =>$data2[71], - 'RFRS3' =>$data2[72], - 'RFRX3' =>$data2[73], - 'RFRN3' =>$data2[74], - 'RFCF3' =>$data2[75], - 'RFFP3' =>$data2[76], - 'RFDC3' =>$data2[77], - 'RFDM3' =>$data2[78], - 'RFTB3' =>$data2[79], - 'RFFR3' =>$data2[80], - 'RFBF3' =>$data2[81], - 'RFTI3' =>$data2[82], - 'RFEF3' =>$data2[83], - 'RFCLO2' =>$data2[84], - 'RFDUR2' =>$data2[85], - 'RFCA2' =>$data2[86], - 'RFCAP2' =>$data2[87], - 'RFCAX2' =>$data2[88], - 'RFCAXP2' =>$data2[89], - 'RFRP2' =>$data2[90], - 'RFRPP2' =>$data2[91], - 'RFFF2' =>$data2[92], - 'RFFFP2' =>$data2[93], - 'RFRS2' =>$data2[94], - 'RFRSP2' =>$data2[95], - 'RFRX2' =>$data2[96], - 'RFRXP2' =>$data2[97], - 'RFRN2' =>$data2[98], - 'RFRNP2' =>$data2[99], - 'RFCF2' =>$data2[100], - 'RFCFP2' =>$data2[101], - 'RFFP2' =>$data2[102], - 'RFFPP2' =>$data2[103], - 'RFDC2' =>$data2[104], - 'RFDCP2' =>$data2[105], - 'RFDM2' =>$data2[106], - 'RFDMP2' =>$data2[107], - 'RFTB2' =>$data2[108], - 'RFTBP2' =>$data2[109], - 'RFFR2' =>$data2[110], - 'RFFRP2' =>$data2[111], - 'RFBF2' =>$data2[112], - 'RFBFP2' =>$data2[113], - 'RFTI2' =>$data2[114], - 'RFTIP2' =>$data2[115], - 'RFEF2' =>$data2[116], - 'RFEFP2' =>$data2[117], - 'RFCLO1' =>$data2[118], - 'RFDUR1' =>$data2[119], - 'RFCA1' =>$data2[120], - 'RFCAP1' =>$data2[121], - 'RFCAX1' =>$data2[122], - 'RFCAXP1' =>$data2[123], - 'RFRP1' =>$data2[124], - 'RFRPP1' =>$data2[125], - 'RFFF1' =>$data2[126], - 'RFFFP1' =>$data2[127], - 'RFRS1' =>$data2[128], - 'RFRSP1' =>$data2[129], - 'RFRX1' =>$data2[130], - 'RFRXP1' =>$data2[131], - 'RFRN1' =>$data2[132], - 'RFRNP1' =>$data2[133], - 'RFCF1' =>$data2[134], - 'RFCFP1' =>$data2[135], - 'RFFP1' =>$data2[136], - 'RFFPP1' =>$data2[137], - 'RFDC1' =>$data2[138], - 'RFDCP1' =>$data2[139], - 'RFDM1' =>$data2[140], - 'RFDMP1' =>$data2[141], - 'RFTB1' =>$data2[142], - 'RFTBP1' =>$data2[143], - 'RFFR1' =>$data2[144], - 'RFFRP1' =>$data2[145], - 'RFBF1' =>$data2[146], - 'RFBFP1' =>$data2[147], - 'RFTI1' =>$data2[148], - 'RFTIP1' =>$data2[149], - 'RFEF1' =>$data2[150], - 'RFEFP1' =>$data2[151], - 'RBRUNM' =>$data2[152], - 'XBDTCN' =>$data2[153], - 'RBDURN' =>$data2[154], - 'RBR11' =>$data2[155], - 'RBR11P' =>$data2[156], - 'RBR12' =>$data2[157], - 'RBR12P' =>$data2[158], - 'RBR13' =>$data2[159], - 'RBR13P' =>$data2[160], - 'RBR14' =>$data2[161], - 'RBR14P' =>$data2[162], - 'RBR15' =>$data2[163], - 'RBR15P' =>$data2[164], - 'RBR16' =>$data2[165], - 'RBR16P' =>$data2[166], - 'RBR17' =>$data2[167], - 'RBR17P' =>$data2[168], - 'RBR18' =>$data2[169], - 'RBR18P' =>$data2[170], - 'RBR1A' =>$data2[171], - 'RBR1AP' =>$data2[172], - 'RBR1T' =>$data2[173], - 'RBR1TP' =>$data2[174], - 'RBR21' =>$data2[175], - 'RBR21P' =>$data2[176], - 'RBR22' =>$data2[177], - 'RBR22P' =>$data2[178], - 'RBR23' =>$data2[179], - 'RBR23P' =>$data2[180], - 'RBR24' =>$data2[181], - 'RBR24P' =>$data2[182], - 'RBR25' =>$data2[183], - 'RBR25P' =>$data2[184], - 'RBR26' =>$data2[185], - 'RBR26P' =>$data2[186], - 'RBR27' =>$data2[187], - 'RBR27P' =>$data2[188], - 'RBR28' =>$data2[189], - 'RBR28P' =>$data2[190], - 'RBR29' =>$data2[191], - 'RBR29P' =>$data2[192], - 'RBR2A' =>$data2[193], - 'RBR2AP' =>$data2[194], - 'RBR2T' =>$data2[195], - 'RBR2TP' =>$data2[196], - 'RBRUNM' =>$data2[197], - 'XBDTCN' =>$data2[198], - 'RBDURN' =>$data2[199], - 'RBS01' =>$data2[200], - 'RBS01P' =>$data2[201], - 'RBS02' =>$data2[202], - 'RBS02P' =>$data2[203], - 'RBS03' =>$data2[204], - 'RBS03P' =>$data2[205], - 'RBS04' =>$data2[206], - 'RBS04P' =>$data2[207], - 'RBS05' =>$data2[208], - 'RBS05P' =>$data2[209], - 'RBS06' =>$data2[210], - 'RBS06P' =>$data2[211], - 'RBS07' =>$data2[212], - 'RBS07P' =>$data2[213], - 'RBS08' =>$data2[214], - 'RBS08P' =>$data2[215], - 'RBS09' =>$data2[216], - 'RBS09P' =>$data2[217], - 'RBS10' =>$data2[218], - 'RBS10P' =>$data2[219], - 'RBS11' =>$data2[220], - 'RBS11P' =>$data2[221], - 'RBS12' =>$data2[222], - 'RBS12P' =>$data2[223], - 'RBS13' =>$data2[224], - 'RBS13P' =>$data2[225], - 'RBS14' =>$data2[226], - 'RBS14P' =>$data2[227], - 'RBS15' =>$data2[228], - 'RBS15P' =>$data2[229], - 'RBS16' =>$data2[230], - 'RBS16P' =>$data2[231], - 'RBS17' =>$data2[232], - 'RBS17P' =>$data2[233], - 'RBS18' =>$data2[234], - 'RBS18P' =>$data2[235], - 'RBS19' =>$data2[236], - 'RBS19P' =>$data2[237], - 'RBS20' =>$data2[238], - 'RBS20P' =>$data2[239], - 'RBS21' =>$data2[240], - 'RBS21P' =>$data2[241], - 'RBS22' =>$data2[242], - 'RBS22P' =>$data2[243], - 'RBS23' =>$data2[244], - 'RBS23P' =>$data2[245], - 'RBS24' =>$data2[246], - 'RBS24P' =>$data2[247], - 'RVDTCN' =>$data2[248], - 'RVDUR' =>$data2[249], - 'RVRAM' =>$data2[250], - 'RVRAMS' =>$data2[251], - 'RVUNI' =>$data2[252], - 'RVPOS' =>$data2[253], - 'RVRAM' =>$data2[254], - 'RVRAMS' =>$data2[255], - 'RVUNI' =>$data2[256], - 'RVPOS' =>$data2[257], - 'RVRAM' =>$data2[258], - 'RVRAMS' =>$data2[259], - 'RVUNI' =>$data2[260], - 'RVPOS' =>$data2[261], - 'RVRAM' =>$data2[262], - 'RVRAMS' =>$data2[263], - 'RVUNI' =>$data2[264], - 'RVPOS' =>$data2[265], - 'RVRAM' =>$data2[266], - 'RVRAMS' =>$data2[267], - 'RVUNI' =>$data2[268], - 'RVPOS' =>$data2[269], - 'RVRAM' =>$data2[270], - 'RVRAMS' =>$data2[271], - 'RVUNI' =>$data2[272], - 'RVPOS' =>$data2[273], - 'RVRAM' =>$data2[274], - 'RVRAMS' =>$data2[275], - 'RVUNI' =>$data2[276], - 'RVPOS' =>$data2[277], - 'RVRAM' =>$data2[278], - 'RVRAMS' =>$data2[279], - 'RVUNI' =>$data2[280], - 'RVPOS' =>$data2[281], - 'RVRAM' =>$data2[282], - 'RVRAMS' =>$data2[283], - 'RVUNI' =>$data2[284], - 'RVPOS' =>$data2[285], - 'RVRAM' =>$data2[286], - 'RVRAMS' =>$data2[287], - 'RVUNI' =>$data2[288], - 'RVPOS' =>$data2[289], - 'RVRAM' =>$data2[290], - 'RVRAMS' =>$data2[291], - 'RVUNI' =>$data2[292], - 'RVPOS' =>$data2[293], - 'RVRAM' =>$data2[294], - 'RVRAMS' =>$data2[295], - 'RVUNI' =>$data2[296], - 'RVPOS' =>$data2[297], - 'RVRAM' =>$data2[298], - 'RVRAMS' =>$data2[299], - 'RVUNI' =>$data2[300], - 'RVPOS' =>$data2[301], - 'RVRAM' =>$data2[302], - 'RVRAMS' =>$data2[303], - 'RVUNI' =>$data2[304], - 'RVPOS' =>$data2[305], - 'RVRAM' =>$data2[306], - 'RVRAMS' =>$data2[307], - 'RVUNI' =>$data2[308], - 'RVPOS' =>$data2[309], - 'RVRAM' =>$data2[310], - 'RVRAMS' =>$data2[311], - 'RVUNI' =>$data2[312], - 'RVPOS' =>$data2[313], - 'RVRAM' =>$data2[314], - 'RVRAMS' =>$data2[315], - 'RVUNI' =>$data2[316], - 'RVPOS' =>$data2[317], - 'RNNBS' =>$data2[318], - ); - for ($i=0; $i<(int)($data2[318]); $i++){ - $j=$i+319; - $tabRNTX[$i]=$data2[$j]; - $this->trace ( "Ligne de commentaire n°$i ($j) = ". $data2[$j] ); - } - $tab_RNTX=array('RNTX'=>$tabRNTX); - $tab_ret=array_merge($tab_ret, $tab_RNTX); - - $posNbActionnaires=$j+1; - $nbActionnaires=$data2[$posNbActionnaires]; - $this->trace ( "Nombre d'actionnaire(s) = $nbActionnaires (position $posNbActionnaires)"); - - for ($i=1, $k=0; $i<=(int)($nbActionnaires)*3; $i=$i+3, $k++){ - $j=$i+$posNbActionnaires; - $tabACT[$k]=array('NOM'=>$data2[$j], - 'SIREN'=>$data2[$j+1], - 'POURCENTAGE'=>$data2[$j+2], - ); - - $this->trace ( "Ligne d'actionnaire n°$k ($j) = ". $data2[$j] .' '. $data2[$j+1] .' '. $data2[$j+2]); - } - $tab_ACT=array('ACTIONNAIRES'=>$tabACT); - $tab_ret=array_merge($tab_ret, $tab_ACT); - - $posNbPart=$j+3; - $nbPart=$data2[$posNbPart]; - $this->trace ( "Nombre de participation(s) = $nbPart (position $posNbPart)"); - - for ($i=1, $k=0; $i<=(int)($nbPart)*3; $i=$i+3, $k++){ - $j=$i+$posNbPart; - $tabPART[$k]=array('NOM'=>$data2[$j], - 'SIREN'=>$data2[$j+1], - 'POURCENTAGE'=>$data2[$j+2], - ); - - $this->trace ( "Ligne de participation n°$k ($j) = ". $data2[$j] .' '. $data2[$j+1] .' '. $data2[$j+2]); - } - $tab_PART=array('PARTICIPATIONS'=>$tabPART); - $tab_ret=array_merge($tab_ret, $tab_PART); - $tab2[$ligne]=$tab_ret; - - break; - - case '': - - break; - default: - $tab2[$ligne]=array( - 'RETOUR' =>trim($ficheCSV.' '.$data2[2]), - 'RISIR' =>trim($siren)); - break; - } - } -// print_r($tab2);exit(); - return $tab2; - } - - - } - - function array2csv($array, $level=0, $str_csv='') { - - if (!is_array($array)) - return 0; - reset($array); - while ( list($key, $value) = each($array) ) { - if (is_array($value)) - array2csv($value, $level+1, $str_csv); - else - $str_csv.=$value.';'; - } - if ($level==0) return $str_csv."\r\n"; - } - - ?> - - - \ No newline at end of file diff --git a/framework/default/_includes/constantes.php b/framework/default/_includes/constantes.php deleted file mode 100644 index 011b44852..000000000 --- a/framework/default/_includes/constantes.php +++ /dev/null @@ -1,14 +0,0 @@ -'bis', - 'T'=>'ter', - 'Q'=>'quater', - 'C'=>'quinquies', - ' '=>'', - ''=>''); - switch($_SESSION['user']) { - case 'MHZ': $myEmail='mheitz@scores-decisions.com'; break; - case 'JMY': $myEmail='jmartory@scores-decisions.com'; break; - case 'YLN': $myEmail='buzuk@scores-decisions.com'; break; - } - - ?> \ No newline at end of file diff --git a/framework/default/_includes/curl.php b/framework/default/_includes/curl.php deleted file mode 100644 index 968a2c61b..000000000 --- a/framework/default/_includes/curl.php +++ /dev/null @@ -1,177 +0,0 @@ - Code réponse Serveur - ** "header" => Headers du serveur - ** "body" => Page HTML - **/ -function parse_response($this_response, $err_num, $err_msg) { - - // Split response into header and body sections - list($response_headers, $response_body) = explode("\r\n\r\n", $this_response, 2); - $response_header_lines = explode("\r\n", $response_headers); - - // First line of headers is the HTTP response code - $http_response_line = array_shift($response_header_lines); - if(preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; } - if ($response_code==100) { - list($response_headers, $response_body) = explode("\r\n\r\n", $response_body, 2); - $response_header_lines = explode("\r\n", $response_headers); - $http_response_line = array_shift($response_header_lines); - if(preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; } - } - - // put the rest of the headers in an array - $response_header_array = array(); - $nbRMID=0; - foreach($response_header_lines as $header_line) - { - list($header,$value) = explode(': ', $header_line, 2); - - if ($header=='Set-cookie' && substr($value,0,5)=='RMID=' && $nbRMID<5)//{ - $nbRMID++; -// echo ("Je gicle le RMID n°$nbRMID\r\n");} - else - $response_header_array[$header] .= $value."\n"; - } -/* if ($response_code==100) { - print_r($response_headers); -// print_r($response_header_lines); - }*/ - return array('code' => $response_code, 'header' => $response_header_array, 'body' => $response_body, 'err_num'=>$err_num, 'err_msg'=>$err_msg); -} - -/** Récupère une page HTML en fonction des paramètres : - ** $url Url distante de la page à récupérer - ** $strCookies Chaine de caractère contenant les cookies - ** $postData Tableau des données à passer en POST uniquement - ** $referer Referer à indiquer lors de l'appel de la page - ** $debug Activer le débogage (True/False) - ** - ** ... et retourne son contenu dans un tableau : - ** "code" => Code réponse Serveur - ** "header" => Headers du serveur - ** "body" => Page HTML - **/ -function getUrl($url, $strCookies='', $postData='', $referer='', $debug=false, $host='', $proxy='', $timeout=0) { - - - $ch = curl_init(); - - if ($host=='') - $this_header = array('Host: '. HOST_INSEE); - else - $this_header = array('Host: '. $host); - - - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_HEADER, 1); - if ($proxy<>'') curl_setopt($ch, CURLOPT_PROXY, $proxy); - - if (((int)$timeout)<>0) curl_setopt($ch, CURLOPT_TIMEOUT, (int)$timeout); - - //curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'username:password'); // Pas nécessaire en authentification NT - - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); - //curl_setopt($ch, CURLOPT_MAXREDIRS, 1); - - $user_agent = 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)'; - curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); - curl_setopt($ch, CURLOPT_REFERER, $referer); - - // Add each cookie that has been returned in the response - // If cookies need to be added/deleted or value changed, then add code here - if ($strCookies!='') { - //die('"'.$strCookies.'"'); - //echo $strCookies."\r\n"; - $cookies = explode("\n", $strCookies); - // Create the basic header - foreach($cookies as $this_cookie) { - if (trim($this_cookie)<>'') - array_push($this_header, 'Cookie: '.$this_cookie); - } - } - - if ($postData!='') { - if (is_array($postData)) - $post_data=$postData; - - $o=""; - foreach ($post_data as $k=>$v) - { -// $o.= "$k=".utf8_encode($v)."&"; - $o.= "$k=".$v."&"; - } - $post_data=substr($o,0,-1); - - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); - //if in_array('',$this_header - // array_push($this_header, "Content-type: application/x-www-form-urlencoded"); - // array_push($this_header, "Content-Length: ".strlen($post_data)); - } - - curl_setopt($ch, CURLOPT_HTTPHEADER, $this_header); - //print_r($this_header); - - $page=curl_exec($ch); - $response = parse_response($page, curl_errno($ch), curl_error($ch)); - if ($debug){ - $url2=str_replace('http://', '', $url); - $url2=str_replace('/', '_', $url2); - $url2=str_replace('?', '(param)', $url2); - $url2=str_replace('&', '(et)', $url2); - - - $fp=fopen('insee/'. date('Ymd-His') .'-'. microtime_float(true) .'-'. $url2 . '.html', 'a'); - fwrite($fp, $url."\r\n"); - fwrite($fp, $page); - fclose($fp); - //echo strip_tags(html_entity_decode($response['body']), ''); - } - //print_r(curl_getinfo($ch)); - curl_close($ch); - return $response; -} - -/** Recherche un texte dans une page HTML - ** - **/ -function getTextInHtml($pageHtml, $strToFind, $strDeb, $strEnd, $include_strDeb=false, $include_strEnd=false, $ltrim=true, $rtrim=true, &$fin, $nbOcc=1) { - $tabRet=array(); - $deb=$nbOccTrouve=0; - while( is_int(($deb=strpos($pageHtml,$strToFind,$fin))) ) { - $deb++; - $deb2 = strpos($pageHtml,$strDeb, $deb); - $fin = strpos($pageHtml,$strEnd, $deb2); - if (!$include_strDeb) - $deb2+=strlen($strDeb); - $s_temp = substr($pageHtml, $deb2, ($fin-$deb2)); - - if ($ltrim) $s_temp=ltrim($s_temp); - if ($rtrim) $s_temp=rtrim($s_temp); - - if ($nbOcc==1) return $s_temp; - //echo $s_temp."\r\n"; - //$a_temp = explode('" class="basic">', $s_temp); - $tabUrl[$nbOccTrouve]=$s_temp; - $nbOccTrouve++; - - if ($nbOcc==$nbOccTrouve) { - // echo "j'ai trouvé le nb demandé, je sort\r\n"; - break; - }; - } - - return $tabUrl; - /* -
  • Le type de voie a été modifié
    -
  • L'orthographe du mot directeur a été modifiée
    -
  • Le code postal a été forcé à partir du département et de la localité
    -*/ -} - -?> diff --git a/framework/default/_includes/inc_classeform.php b/framework/default/_includes/inc_classeform.php deleted file mode 100644 index 0bd18b0ef..000000000 --- a/framework/default/_includes/inc_classeform.php +++ /dev/null @@ -1,820 +0,0 @@ - "caractères minimum", - "max" => "caractères maximum", - "texte" => "texte non valide", - "alphanum" => "texte alphanumérique non valide", - "num" => "valeur numérique non valide", - "num-strict" => "valeur numérique non valide", - "tel" => "numéro de téléphone non valide", - "email" => "e-mail non valide", - "url" => "url non valide", - "date" => "date non valide", - "datej" => "jour non valide", - "datem" => "mois non valide", - "datem" => "année non valide", - "option" => "aucune option n'a été sélectionnée", - "vide" => "champ obligatoire"); - -class ClasseForm { - var $titre; - var $montrer_titre; - var $champs; - var $taille_std; - var $pivot_siecle; - var $mode_retour; - var $confirme; - var $mode; - var $champ_cour; - var $log; - var $name; - var $closeButton; - - function ClasseForm($titre=null, $confirme=false, $autocomplete="on", $nom='formulaire', $closeButton=false) { - $this->titre = $titre; - $this->montrer_titre = true; - $this->champs = array(); - $this->taille_std = null; - $this->pivot_siecle = 20; - $this->mode_retour = "noms & valeurs"; - $this->confirme = $confirme; - if ($autocomplete==false || $autocomplete=="off" || $autocomplete==null) - $this->autocomplete = 'off'; - else - $this->autocomplete = 'on'; - $this->name=$nom; - $this->mode = null; - $this->champ_cour = 0; - $this->log = null; - $this->closeButton=$closeButton; - } - - - function afficher() { - $resultat = null; - echo $this->javascriptSubmit(); - if (!isset($_POST) || !$_POST || ($_POST["classeform_acces"] == "annuler")) $this->mode = null; - else { - $this->affecterValeursChamps($_POST); - $succes = $this->controler(); - if ($succes) $this->mode = $_POST["classeform_acces"]; - else $this->mode = "erreur"; - } - - switch ($this->mode) { - case "confirme" : - echo $this->afficherTexte(); - echo $this->afficherForm(true); - break; - case "modif" : - echo $this->afficherForm(); - break; - case "envoi" : - $resultat = $this->retournerTableauValeurs($this->mode_retour); - //print_r($resultat); - if ($this->log) $this->enregistrerLog($this->retournerTableauValeurs("valeurs", $resultat)); - break; - default : - echo $this->afficherForm(); - } - return $resultat; - } - - function ajoutChamp($label, $nom, $type, $format=null, $oblig=true, $min=null, $max=null, $defVal='') { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, $type, $format, $oblig, $min, $max, $defVal); - } - - function ajoutChampText($label, $nom, $format=null, $oblig=true, $min=null, $max=null, $defVal='', $ajaxQuery='') { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, "text", $format, $oblig, $min, $max, $defVal, $ajaxQuery); - $this->champs[$this->champ_cour]->valCtlLimites($this->taille_std, 256); - } - - function ajoutChampHidden($nom) { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp('', $nom, "hidden"); - } - - function ajoutChampPassword($label, $nom, $min=null, $max=null) { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, "password", "", true, $min, $max); - $this->champs[$this->champ_cour]->valCtlLimites($this->taille_std, 100); - } - - function ajoutChampTextarea($label, $nom, $format=null, $oblig=true, $min=null, $max=null) { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, "textarea", $format, $oblig, $min, $max); - $this->champs[$this->champ_cour]->valCtlLimites($this->taille_std, 3); - } - - function ajoutChampFile($label, $nom, $oblig=true, $min=null, $max=null) { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, "file", "fichier", $oblig, $min, $max); - $this->champs[$this->champ_cour]->valCtlLimites($this->taille_std, 256); - } - - function ajoutChampSelect($label, $nom, $oblig=true, $taille=null, $multiple=null) { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, "select", "", $oblig, null, null); - if ($taille) $this->champs[$this->champ_cour]->valCtlLimites($taille, null); - if ($multiple) $this->champs[$this->champ_cour]->valMultiple(); - } - - function ajoutChampRadio($label, $nom, $oblig=true, $fin_ligne=null) { - $this->champ_cour = sizeof($this->champs); - $args = func_get_args(); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, "radio", "", $oblig); - if ($fin_ligne) $this->champs[$this->champ_cour]->valFinLigne($fin_ligne); - if (sizeof($args) > 4) $this->champs[$this->champ_cour]->valOptions(array_slice($args, 4)); - } - - function ajoutChampCheckbox($label, $nom, $oblig=true, $fin_ligne=null) { - $this->champ_cour = sizeof($this->champs); - $args = func_get_args(); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, "checkbox", "", $oblig); - if ($fin_ligne) $this->champs[$this->champ_cour]->valFinLigne($fin_ligne); - if (sizeof($args) > 4) $this->champs[$this->champ_cour]->valOptions(array_slice($args, 4)); - } - - function ajoutTexte($texte) { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp($texte, "", "", "", false); - } - - function cacherTitre() { - $this->montrer_titre = false; - } - - function valTailleStd($taille) { - $this->taille_std = $taille; - } - - function valPivotSiecle($pivot) { - $this->pivot_siecle = $pivot; - } - - function valModeRetour($mode) { - $this->mode_retour = $mode; - } - - function valLog($log) { - $this->log = $log; - } - - function valChampFormat($format, $min=null, $max=null) { - $this->champs[$this->champ_cour]->valFormat($format, $min, $max); - } - - function valChampLimites($min, $max=null) { - $this->champs[$this->champ_cour]->valLimites($min, $max); - } - - function valChampCtlLimites($min, $max=null) { - $this->champs[$this->champ_cour]->valCtlLimites($min, $max); - } - - function valChampMultiple() { - $this->champs[$this->champ_cour]->valMultiple(); - } - - function valChampOptions() { - if ((func_num_args() == 1) && is_array(func_get_arg(0))) $args = func_get_arg(0); - else $args = func_get_args(); - $this->champs[$this->champ_cour]->valOptions($args); - } - - function valChampDescro($descro) { - $this->champs[$this->champ_cour]->valDescro($descro); - } - - function valChampFinLigne($fin_ligne) { - $this->champs[$this->champ_cour]->valFinLigne($fin_ligne); - } - - function valChampOption1Vide($option_vide) { - $this->champs[$this->champ_cour]->valOption1Vide($option_vide); - } - - - function afficherForm($cache=false) { - $html = "
    \n"; - $html .= "
    \n"; - $html .= "\n"; - if ($this->titre && $this->montrer_titre && !$cache) - $html .= "\n"; - else if (($this->mode == "erreur")) - $html .= "\n"; - for ($i=0;$ichamps);$i++) { - if ($cache) $html .= $this->champs[$i]->afficherFormCache(); - else $html .= $this->champs[$i]->afficherForm(); - } - if ($valeurs) $html .= $this->afficherBoutonsForm(); - else $html .= $this->afficherBoutonsForm(); - if ($this->existeChampFacultatif()) - $html .= ""; - $html .= "
    $this->titre" . (($this->mode == "erreur") ? " (erreurs)" : "") . "(erreurs)
     
    \n"; - return $html; - } - - function afficherBoutonsForm() { - if (($this->mode == null) || ($this->mode == "erreur")) { - if ($this->confirme) - $html = ""; - else $html = ""; - } - else $html = ""; - $html .= ""; - if ($this->confirme) { - if ($this->mode == "confirme") { - $html .= " "; - } - else { - $html .= " "; - } - } - $html .= " \n"; - if ($this->closeButton) - $html .= " \n"; - $html .= ""; - return $html; - } - - function afficherTexte() { - $html = "\n"; - if ($this->titre) $html .= "\n"; - for ($i=0;$ichamps);$i++) - $html .= $this->champs[$i]->afficherTexte(); - $html .= "
    $this->titre
    \n"; - return $html; - } - - function javascriptSubmit() { - $html = "\n"; - return $html; - } - - function controler() { - $succes = true; - for ($i=0;$ichamps);$i++) { - $this->champs[$i]->valeur_db=$this->champs[$i]->valeur; - if ( $this->champs[$i]->aControler() && ($this->champs[$i]->controler($this->pivot_siecle) == false) ) { - $succes = false; - } - } - return $succes; - } - - function affecterValeursChamps($valeurs) { - $valeurs = convertirPost($valeurs); - for ($i=0;$ichamps);$i++) - $this->champs[$i]->affecterValeur($valeurs); - } - - function retournerTableauValeurs($mode_retour) { - $retour = array(); - for ($i=0;$ichamps);$i++) - {// echo "------------------------------------\r\n$i : \r\n"; - //print_r($this->champs); - //print_r($this->champs[$i]); - //echo "\r\n\r\n"; - $this->champs[$i]->retournerTableauValeurs(&$retour, $mode_retour);} - - return $retour; - } - - function envoyerMail() { - $mail = new ClasseMail($this->titre); - $mail->contenu = $this->champs; - return $mail->envoyer($this->cible); - } - - function existeChampFacultatif() { - $ok = false; - for ($i=0;$ichamps);$i++) { - if ($this->champs[$i]->type && !$this->champs[$i]->valObligatoire()) { - $ok = true; - break; - } - } - return $ok; - } - - function enregistrerLog($valeurs, $resultat) { - if ($f = fopen($this->log, "a")) { - $texte = ($resultat ? "" : "ECHEC ") . "[ " . date("d/mY H:i:s") . " ] - "; - $texte .= $this->titre ? "$this->titre - " : ""; - $texte .= $valeurs; - fputs($f, $texte); - fclose($f); - } - } - -} - - - -class ClasseFormChamp { - var $label; - var $nom; - var $type; - var $format; - var $oblig; - var $taille_max; - var $taille_min; - var $valeur; - var $options; - var $descro; - var $multiple; - var $fonction; - var $ctl_taille1; - var $ctl_taille2; - var $fin_ligne; - var $erreur; - var $valeur_defaut; - var $valeur_db; - var $ajaxQuey; - - function ClasseFormChamp($label, $nom, $type=null, $format=null, $oblig=true, $min=null, $max=null, $valDef='', $ajaxQuery='') { - $this->label = $label; - $this->nom = $nom; - $this->type = $type; - $this->format = $format; - $this->taille_min = $min; - $this->taille_max = $max; - $this->oblig = $oblig; - if (($type == "select") || ($type == "checkbox") || ($type == "radio")) { - $this->valeur = array(); - $this->options = array(); - } - else { - $this->valeur = null; - $this->options = null; - } - $this->descro = null; - if ($type == "checkbox") $this->multiple = true; - else $this->multiple = false; - $this->fonction = null; - $this->ctl_taille1 = null; - $this->ctl_taille2 = null; - $this->fin_ligne = null; - $this->erreur = null; - $this->valeur_defaut = $valDef; - $this->ajaxQuey = $ajaxQuery; -// $this->valeur_db=$this->valeur; - - } - - - function valObligatoire() { - if ($this->oblig) return true; - else return false; - } - - function valFormat($format, $long_min=null, $long_max=null) { - if ($this->type == "text") { - $this->format = $format; - if ($long_min) $this->taille_min = $long_min; - if ($long_max) $this->taille_max = $long_max; - } - } - - function valLimites($min, $max) { - if (($this->type == "text") || ($this->type == "password") || ($this->type == "textarea") || ($this->type == "file")) { - $this->taille_min = $min; - $this->taille_max = $max; - } - } - - function valCtlLimites($taille1, $taille2) { - if (($this->type == "text") || ($this->type == "password") || ($this->type == "textarea") || ($this->type == "select") || ($this->type == "file")) { - $this->ctl_taille1 = $taille1; - if ($taille2 && ($this->type != "select")) $this->ctl_taille2 = $taille2; - } - } - - function valFonction($fonction) { - $this->fonction = $fonction; - } - - function valDescro($descro) { - if (($this->type == "text") || ($this->type == "password") || ($this->type == "textarea") || ($this->type == "file")) { - $this->descro = $descro; - } - } - - function valMultiple() { - if ($this->type == "select") $this->multiple = true; - } - - function valFinLigne($fin_ligne) { - if (($this->type == "radio") || ($this->type == "checkbox")) $this->fin_ligne = $fin_ligne; - } - - function valOptions($options) { - if ($this->champAOptions()) { - if (is_array($options)) { - foreach ($options as $option) { - if (preg_match("/^s[e|é]lection\s?=\s?(.+)$/", $option, $regs)) - $this->options[] = new ClasseFormOption($regs[1], true); - else $this->options[] = new ClasseFormOption($option); - } - } - else { - if (preg_match("/^s[e|é]lection\s?=\s?(.+)$/", $options, $regs)) - $this->options[] = new ClasseFormOption($regs[1], true); - else $this->options[] = new ClasseFormOption($options); - } - } - } - - function ValOption1Vide($option_vide) { - if ($this->type == "select") $this->fin_ligne = $option_vide; - } - - - function afficherForm() { - if (!$this->type) $html = "$this->label"; - else { - if (!is_null($this->erreur)) - $html = " > $this->label ($this->erreur)"; - else if ($this->oblig) $html = "$this->label"; - else $html .= "$this->label"; - $html .= ""; - switch ($this->type) { - case "text" : $html .= $this->afficherFormTexte(); - break; - case "password" : $html .= $this->afficherFormPassword(); - break; - case "textarea" : $html .= $this->afficherFormTextarea(); - break; - case "select" : $html .= $this->afficherFormSelect(); - break; - case "radio" : $html .= $this->afficherFormRadio(); - break; - case "checkbox" : $html .= $this->afficherFormCheckbox(); - break; - case "file" : $html .= $this->afficherFormFile(); - break; - case "hidden" : $html .= $this->afficherFormCache(); - break; - } - $html .= "\n"; - } - return $html; - } - - function afficherFormCache() { - $html = "valeur)) { - $chaine = implode(_SEPA_VALEUR_MULTIPLE, $this->valeur); - $html .= " value=\"" . $chaine . "\" />\n"; - } - else $html .= " value=\"" . $this->valeur . "\" />\n"; - return $html; - } - - function afficherTexte() { - $html = "$this->label"; - if (is_array($this->valeur)) { - $chaine = implode(_SEPA_AFFICHE_MULTIPLE, $this->valeur); - $html .= $chaine; - } - else $html .= $this->valeur; - $html .= "\n"; - return $html; - } - - function champAOptions() { - if (($this->type == "select") || ($this->type == "checkbox") || ($this->type == "radio")) return true; - else return false; - } - - function controler($pivot=null) { - global $erreur_message; - //$this->valeur_db=$this->valeur; - if ($this->type) { - if (($this->type == "text") || ($this->type == "password") || ($this->type == "textarea") || ($this->type == "file")) { - $this->controlerChampTexte($pivot); - if (is_null($this->erreur)) return true; - else return false; - } - else if (($this->type == "select") || ($this->type == "radio")) { - if (!$this->valeur || (sizeof($this->valeur) == 0)) { - $this->erreur = $erreur_message["option"]; - return false; - } - else return true; - } - else return true; - } - else return true; - } - - function aControler() { - if ($this->type && $this->oblig) return true; - else return false; - //return true; - } - - function retournerTableauValeurs(&$tableau, $mode_retour) { - if (is_array($this->valeur)) {$valeur = implode(_SEPA_VALEUR_MULTIPLE, $this->valeur); - print_r($this->valeur); - die('Cas non géré dans inc_classeform.php'); - } - else $valeur = $this->valeur_db; - - switch ($mode_retour) { - case "noms & valeurs" : - $tableau[$this->nom] = $valeur; - break; - case "labels & valeurs" : - $tableau[$this->label] = $valeur; - break; - case "valeurs" : - $tableau[] = $valeur; - } - //echo '$this->nom='.$this->nom.', $valeur='.$valeur."\r\n"; - } - - function affecterValeur($valeurs) { - $valeur = $valeurs[$this->nom]; - if ($this->champAOptions()) { - if (strpos($valeur, _SEPA_VALEUR_MULTIPLE) !== false) - $this->valeur = explode(_SEPA_VALEUR_MULTIPLE, $valeur); - else $this->valeur = $valeur; - for ($i=0;$ioptions);$i++) - $this->options[$i]->selectionnerSiValeur($this->valeur); - } - else $this->valeur = $valeur; - } - - - function controlerChampTexte($pivot) { - global $erreur_message; - if (trim($this->valeur) == "") $this->erreur = $erreur_message["vide"]; - else { - $this->erreur = champTexteConforme($this->valeur, $this->taille_min, $this->taille_max); - if (is_null($this->erreur) && $this->format) { - switch ($this->format) { - case "alphanum" : - if (!controlerAlphanum($this->valeur)) $this->erreur = $erreur_message["alphanum"]; - break; - case "num" : - if (!controlerNum($this->valeur)) $this->erreur = $erreur_message["num"]; - break; - case "num-strict" : - if (!controlerNum($this->valeur, true)) $this->erreur = $erreur_message["num"]; - break; - case "tel" : - if (!controlerTel($this->valeur)) $this->erreur = $erreur_message["tel"]; - break; - case "email" : - if (!controlerEmail($this->valeur)) $this->erreur = $erreur_message["email"]; - break; - case "date" : - if (!controlerDate($this->valeur, $pivot)) $this->erreur = $erreur_message["date"]; - - $tmp=explode('/', $this->valeur); - if ($tmp[0]*1<10) $date_j='0'.$tmp[0]*1; else $date_j=''.$tmp[0]*1; - if ($date_j*1 < 1 || $date_j>31) $this->erreur = $erreur_message["datej"]; - if ($tmp[1]*1<10) $date_m='0'.$tmp[1]*1; else $date_m=''.$tmp[1]*1; - if ($date_m*1 < 1 || $date_m>12) $this->erreur = $erreur_message["datem"]; - $date_a=''.$tmp[2]*1; - if ($date_a*1 < 1890 || $date_a>date('Y')) $this->erreur = $erreur_message["datea"]; - $this->valeur_db=$date_a.'-'.$date_m.'-'.$date_j; - break; - case "url" : - if (!controlerUrl($this->valeur)) $this->erreur = $erreur_message["url"]; - break; - } - } - } - } - - function afficherFormTexte() { - $html .= "ctl_taille2) $html .= " maxlength='$this->ctl_taille2'"; - if ($this->valeur) $html .= ' value="' . $this->valeur . '" />'; - else if ($this->valeur_defaut) $html .= ' value="' . $this->valeur_defaut . '" />'; - else if ($this->descro) { $html .= ' value="' . htmlentities(stripslashes($this->descro), ENT_QUOTES) . '"'; - $html .= " onFocus='this.value=\"\"' />"; - } - elseif ($this->ajaxQuey) $html .= " id='$this->nom' onkeyup=\"loadData('$this->nom');\" /> - "; - else $html .= ' value="" />'; - return $html; - } - - function afficherFormPassword() { - $html .= "ctl_taille2) $html .= " maxlength='$this->ctl_taille2'"; - if ($this->valeur) $html .= ' value="' . $this->valeur . '" />'; - else if ($this->descro) { - $html .= ' value="' . htmlentities(stripslashes($this->descro), ENT_QUOTES) . '"'; - $html .= " onFocus='this.value=\"\"' />"; - } - else $html .= " value='' />"; - return $html; - } - - function afficherFormTextarea() { - $html .= ""; - return $html; - } - - function afficherFormSelect() { - $html = "\n"; - return $html; - } - - function afficherFormRadio() { - for ($i=0;$ioptions);$i++) { - $html .= $this->options[$i]->afficherFormCase("radio", $this->nom, $this->oblig); - $html .= $this->fin_ligne ? "
    " : " "; - } - return $html; - } - - function afficherFormCheckbox() { - for ($i=0;$ioptions);$i++) { - $html .= $this->options[$i]->afficherFormCase("checkbox", "$this->nom[]", $this->oblig); - $html .= $this->fin_ligne ? "
    " : " "; - } - return $html; - } - - function afficherFormFile() { - $html .= "taille_max) $html .= " maxlength='$this->ctl_taille2'"; - if ($this->descro) $html .= " value='$this->descro' onChange='this.value=\"\"' />"; - else $html .= " value='' />"; - return $html; - } - -} - - - -class ClasseFormOption { - var $valeur; - var $selection; - - function ClasseFormOption($val, $selec=false) { - $this->valeur = htmlspecialchars(stripslashes($val), ENT_QUOTES); - $this->selection = $selec; - } - - - function afficherFormSelect() { - echo ""; - if (strpos($this->valeur,':')>0) { - $tab=explode(':', $this->valeur); - $html = '\n"; - } - else { - $html = '\n"; - } - return $html; - } - - function afficherFormCase($type, $nom, $oblig) { - $html = "valeur\""; - $html .= ($this->selection) ? " checked />" : " />"; - if ($oblig) $html .= "" . $this->valeur . ""; - else $html .= "" . $this->valeur . ""; - return $html; - } - - function selectionnerSiValeur($valeurs) { - if (is_array($valeurs)) { - if (in_array($this->valeur, $valeurs)) $this->selection = true; - else $this->selection = false; - } - else if ($this->valeur == $valeurs) $this->selection = true; - else $this->selection = false; - } - -} - - -function controlerEmail($valeur) { - if (preg_match("/^[\w|-]+(\.[\w|-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$/", $valeur)) return true; - else return false; -} - -function controlerDate($valeur, $pivot) { - if (preg_match("/^(\d{1,2})[\/|\-|\.](\d{1,2})[\/|\-|\.](\d\d)(\d\d)?$/", $valeur, $regs)) { - $jour = ($regs[1] < 10) ? "0".$regs[1] : $regs[1]; - $mois = ($regs[2] < 10) ? "0".$regs[2] : $regs[2]; - if ($regs[4]) $an = $regs[3] . $regs[4]; - else { - if ($pivot) { - if ($regs[3] <= $pivot) $an = $regs[3] + 2000; - else $an = $regs[3] + 1900; - } - else $an = $regs[3] + 2000; - } - if (checkdate($mois, $jour, $an)) return true; - else return false; - } - else return false; -} - -function controlerUrl($valeur) { - if (ereg("^((http|ftp):\/\/)?([0-9a-z_]+[\.\-])+[0-9a-z]+(\/[0-9a-z_]+)*(\/[0-9a-z_]+\.[0-9a-z]+)?$", $valeur)) return true; - else return false; -} - -function controlerAlphanum($valeur) { - //if (preg_match("/^[\w|\d|\s|'|\"|\\|,|\.|\-|&|#|;]+$/", $valeur)) return true; - //else return false; - return true; -} - -function controlerNum($valeur, $strict=false) { - if ($strict) { - if (ereg("^[0-9]+$", $valeur)) return true; - else return false; - } - else if (preg_match("/^[\d|\s|\-|\+|E|e|,|\.]+$/", $valeur)) return true; - else return false; -} - -function controlerTel($valeur) { - if (preg_match("/^[\d|\s|\-|\.|\(|\)]+$/", $valeur)) return true; - else return false; -} - -function champTexteConforme($valeur, $min, $max) { - global $erreur_message; - if ($min && (strlen($valeur) < $min)) return $min . " " . $erreur_message["min"]; - else if ($max && (strlen($valeur) > $max)) return $max . " " . $erreur_message["max"]; - else if (preg_match('/(.)\1{4,}/', $valeur)) return $erreur_message["texte"]; - else return null; -} - - -function convertirPost($post) { - $result = array(); - foreach ($post as $cle => $valeur) { - if (is_array($valeur)) { - for ($i=0;$i diff --git a/framework/default/_includes/inc_classeform_backup.php b/framework/default/_includes/inc_classeform_backup.php deleted file mode 100644 index 9d36219c9..000000000 --- a/framework/default/_includes/inc_classeform_backup.php +++ /dev/null @@ -1,764 +0,0 @@ - "caractères minimum", - "max" => "caractères maximum", - "texte" => "texte non valide", - "alphanum" => "texte alphanumérique non valide", - "num" => "valeur numérique non valide", - "num-strict" => "valeur numérique non valide", - "tel" => "numéro de téléphone non valide", - "email" => "e-mail non valide", - "url" => "url non valide", - "date" => "date non valide", - "option" => "aucune option n'a été sélectionnée", - "vide" => "champ obligatoire"); - -class ClasseForm { - var $titre; - var $montrer_titre; - var $champs; - var $taille_std; - var $pivot_siecle; - var $mode_retour; - var $confirme; - var $mode; - var $champ_cour; - var $log; - - function ClasseForm($titre=null, $confirme=false) { - $this->titre = $titre; - $this->montrer_titre = true; - $this->champs = array(); - $this->taille_std = null; - $this->pivot_siecle = 20; - $this->mode_retour = "noms & valeurs"; - $this->confirme = $confirme; - $this->mode = null; - $this->champ_cour = 0; - $this->log = null; - } - - - function afficher() { - $resultat = null; - echo $this->javascriptSubmit(); - if (!isset($_POST) || !$_POST || ($_POST["classeform_acces"] == "annuler")) $this->mode = null; - else { - $this->affecterValeursChamps($_POST); - $succes = $this->controler(); - if ($succes) $this->mode = $_POST["classeform_acces"]; - else $this->mode = "erreur"; - } - - switch ($this->mode) { - case "confirme" : - echo $this->afficherTexte(); - echo $this->afficherForm(true); - break; - case "modif" : - echo $this->afficherForm(); - break; - case "envoi" : - $resultat = $this->retournerTableauValeurs($this->mode_retour); - if ($this->log) $this->enregistrerLog($this->retournerTableauValeurs("valeurs", $resultat)); - break; - default : - echo $this->afficherForm(); - } - return $resultat; - } - - function ajoutChamp($label, $nom, $type, $format=null, $oblig=true, $min=null, $max=null, $defVal='') { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, $type, $format, $oblig, $min, $max, $defVal); - } - - function ajoutChampText($label, $nom, $format=null, $oblig=true, $min=null, $max=null, $defVal='') { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, "text", $format, $oblig, $min, $max, $defVal); - $this->champs[$this->champ_cour]->valCtlLimites($this->taille_std, 256); - } - - function ajoutChampPassword($label, $nom, $min=null, $max=null) { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, "password", "", true, $min, $max); - $this->champs[$this->champ_cour]->valCtlLimites($this->taille_std, 100); - } - - function ajoutChampTextarea($label, $nom, $format=null, $oblig=true, $min=null, $max=null) { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, "textarea", $format, $oblig, $min, $max); - $this->champs[$this->champ_cour]->valCtlLimites($this->taille_std, 3); - } - - function ajoutChampFile($label, $nom, $oblig=true, $min=null, $max=null) { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, "file", "fichier", $oblig, $min, $max); - $this->champs[$this->champ_cour]->valCtlLimites($this->taille_std, 256); - } - - function ajoutChampSelect($label, $nom, $oblig=true, $taille=null, $multiple=null) { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, "select", "", $oblig, null, null); - if ($taille) $this->champs[$this->champ_cour]->valCtlLimites($taille, null); - if ($multiple) $this->champs[$this->champ_cour]->valMultiple(); - } - - function ajoutChampRadio($label, $nom, $oblig=true, $fin_ligne=null) { - $this->champ_cour = sizeof($this->champs); - $args = func_get_args(); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, "radio", "", $oblig); - if ($fin_ligne) $this->champs[$this->champ_cour]->valFinLigne($fin_ligne); - if (sizeof($args) > 4) $this->champs[$this->champ_cour]->valOptions(array_slice($args, 4)); - } - - function ajoutChampCheckbox($label, $nom, $oblig=true, $fin_ligne=null) { - $this->champ_cour = sizeof($this->champs); - $args = func_get_args(); - $this->champs[$this->champ_cour] = new ClasseFormChamp($label, $nom, "checkbox", "", $oblig); - if ($fin_ligne) $this->champs[$this->champ_cour]->valFinLigne($fin_ligne); - if (sizeof($args) > 4) $this->champs[$this->champ_cour]->valOptions(array_slice($args, 4)); - } - - function ajoutTexte($texte) { - $this->champ_cour = sizeof($this->champs); - $this->champs[$this->champ_cour] = new ClasseFormChamp($texte, "", "", "", false); - } - - function cacherTitre() { - $this->montrer_titre = false; - } - - function valTailleStd($taille) { - $this->taille_std = $taille; - } - - function valPivotSiecle($pivot) { - $this->pivot_siecle = $pivot; - } - - function valModeRetour($mode) { - $this->mode_retour = $mode; - } - - function valLog($log) { - $this->log = $log; - } - - function valChampFormat($format, $min=null, $max=null) { - $this->champs[$this->champ_cour]->valFormat($format, $min, $max); - } - - function valChampLimites($min, $max=null) { - $this->champs[$this->champ_cour]->valLimites($min, $max); - } - - function valChampCtlLimites($min, $max=null) { - $this->champs[$this->champ_cour]->valCtlLimites($min, $max); - } - - function valChampMultiple() { - $this->champs[$this->champ_cour]->valMultiple(); - } - - function valChampOptions() { - if ((func_num_args() == 1) && is_array(func_get_arg(0))) $args = func_get_arg(0); - else $args = func_get_args(); - $this->champs[$this->champ_cour]->valOptions($args); - } - - function valChampDescro($descro) { - $this->champs[$this->champ_cour]->valDescro($descro); - } - - function valChampFinLigne($fin_ligne) { - $this->champs[$this->champ_cour]->valFinLigne($fin_ligne); - } - - function valChampOption1Vide($option_vide) { - $this->champs[$this->champ_cour]->valOption1Vide($option_vide); - } - - - function afficherForm($cache=false) { - $html = "
    \n"; - $html .= "\n"; - if ($this->titre && $this->montrer_titre && !$cache) - $html .= "\n"; - else if (($this->mode == "erreur")) - $html .= "\n"; - for ($i=0;$ichamps);$i++) { - if ($cache) $html .= $this->champs[$i]->afficherFormCache(); - else $html .= $this->champs[$i]->afficherForm(); - } - if ($valeurs) $html .= $this->afficherBoutonsForm(); - else $html .= $this->afficherBoutonsForm(); - if ($this->existeChampFacultatif()) - $html .= ""; - $html .= "
    $this->titre" . (($this->mode == "erreur") ? " (erreurs)" : "") . "(erreurs)
     
    \n"; - return $html; - } - - function afficherBoutonsForm() { - if (($this->mode == null) || ($this->mode == "erreur")) { - if ($this->confirme) - $html = ""; - else $html = ""; - } - else $html = ""; - $html .= ""; - if ($this->confirme) { - if ($this->mode == "confirme") { - $html .= " "; - } - else { - $html .= " "; - } - } - $html .= " \n"; - return $html; - } - - function afficherTexte() { - $html = "\n"; - if ($this->titre) $html .= "\n"; - for ($i=0;$ichamps);$i++) - $html .= $this->champs[$i]->afficherTexte(); - $html .= "
    $this->titre
    \n"; - return $html; - } - - function javascriptSubmit() { - $html = "\n"; - return $html; - } - - function controler() { - $succes = true; - for ($i=0;$ichamps);$i++) { - if ($this->champs[$i]->aControler() && ($this->champs[$i]->controler($this->pivot_siecle) == false)) { - $succes = false; - } - } - return $succes; - } - - function affecterValeursChamps($valeurs) { - $valeurs = convertirPost($valeurs); - for ($i=0;$ichamps);$i++) - $this->champs[$i]->affecterValeur($valeurs); - } - - function retournerTableauValeurs($mode_retour) { - $retour = array(); - for ($i=0;$ichamps);$i++) - { //echo "------------------------------------\r\n$i : \r\n"; - //print_r($this->champs); - // print_r($this->champs[$i]); - //echo "\r\n\r\n"; - $this->champs[$i]->retournerTableauValeurs(&$retour, $mode_retour);} - - return $retour; - } - - function envoyerMail() { - $mail = new ClasseMail($this->titre); - $mail->contenu = $this->champs; - return $mail->envoyer($this->cible); - } - - function existeChampFacultatif() { - $ok = false; - for ($i=0;$ichamps);$i++) { - if ($this->champs[$i]->type && !$this->champs[$i]->valObligatoire()) { - $ok = true; - break; - } - } - return $ok; - } - - function enregistrerLog($valeurs, $resultat) { - if ($f = fopen($this->log, "a")) { - $texte = ($resultat ? "" : "ECHEC ") . "[ " . date("d/mY H:i:s") . " ] - "; - $texte .= $this->titre ? "$this->titre - " : ""; - $texte .= $valeurs; - fputs($f, $texte); - fclose($f); - } - } - -} - - - -class ClasseFormChamp { - var $label; - var $nom; - var $type; - var $format; - var $oblig; - var $taille_max; - var $taille_min; - var $valeur; - var $options; - var $descro; - var $multiple; - var $fonction; - var $ctl_taille1; - var $ctl_taille2; - var $fin_ligne; - var $erreur; - var $valeur_defaut; - var $valeur_db; - - function ClasseFormChamp($label, $nom, $type=null, $format=null, $oblig=true, $min=null, $max=null, $valDef='') { - $this->label = $label; - $this->nom = $nom; - $this->type = $type; - $this->format = $format; - $this->taille_min = $min; - $this->taille_max = $max; - $this->oblig = $oblig; - if (($type == "select") || ($type == "checkbox") || ($type == "radio")) { - $this->valeur = array(); - $this->options = array(); - } - else { - $this->valeur = null; - $this->options = null; - } - $this->descro = null; - if ($type == "checkbox") $this->multiple = true; - else $this->multiple = false; - $this->fonction = null; - $this->ctl_taille1 = null; - $this->ctl_taille2 = null; - $this->fin_ligne = null; - $this->erreur = null; - $this->valeur_defaut = $valDef; - } - - - function valObligatoire() { - if ($this->oblig) return true; - else return false; - } - - function valFormat($format, $long_min=null, $long_max=null) { - if ($this->type == "text") { - $this->format = $format; - if ($long_min) $this->taille_min = $long_min; - if ($long_max) $this->taille_max = $long_max; - } - } - - function valLimites($min, $max) { - if (($this->type == "text") || ($this->type == "password") || ($this->type == "textarea") || ($this->type == "file")) { - $this->taille_min = $min; - $this->taille_max = $max; - } - } - - function valCtlLimites($taille1, $taille2) { - if (($this->type == "text") || ($this->type == "password") || ($this->type == "textarea") || ($this->type == "select") || ($this->type == "file")) { - $this->ctl_taille1 = $taille1; - if ($taille2 && ($this->type != "select")) $this->ctl_taille2 = $taille2; - } - } - - function valFonction($fonction) { - $this->fonction = $fonction; - } - - function valDescro($descro) { - if (($this->type == "text") || ($this->type == "password") || ($this->type == "textarea") || ($this->type == "file")) { - $this->descro = $descro; - } - } - - function valMultiple() { - if ($this->type == "select") $this->multiple = true; - } - - function valFinLigne($fin_ligne) { - if (($this->type == "radio") || ($this->type == "checkbox")) $this->fin_ligne = $fin_ligne; - } - - function valOptions($options) { - if ($this->champAOptions()) { - if (is_array($options)) { - foreach ($options as $option) { - if (preg_match("/^s[e|é]lection\s?=\s?(.+)$/", $option, $regs)) - $this->options[] = new ClasseFormOption($regs[1], true); - else $this->options[] = new ClasseFormOption($option); - } - } - else { - if (preg_match("/^s[e|é]lection\s?=\s?(.+)$/", $options, $regs)) - $this->options[] = new ClasseFormOption($regs[1], true); - else $this->options[] = new ClasseFormOption($options); - } - } - } - - function ValOption1Vide($option_vide) { - if ($this->type == "select") $this->fin_ligne = $option_vide; - } - - - function afficherForm() { - if (!$this->type) $html = "$this->label"; - else { - if (!is_null($this->erreur)) - $html = " > $this->label ($this->erreur)"; - else if ($this->oblig) $html = "$this->label"; - else $html .= "$this->label"; - $html .= ""; - switch ($this->type) { - case "text" : $html .= $this->afficherFormTexte(); - break; - case "password" : $html .= $this->afficherFormPassword(); - break; - case "textarea" : $html .= $this->afficherFormTextarea(); - break; - case "select" : $html .= $this->afficherFormSelect(); - break; - case "radio" : $html .= $this->afficherFormRadio(); - break; - case "checkbox" : $html .= $this->afficherFormCheckbox(); - break; - case "file" : $html .= $this->afficherFormFile(); - } - $html .= "\n"; - } - return $html; - } - - function afficherFormCache() { - $html = "valeur)) { - $chaine = implode(_SEPA_VALEUR_MULTIPLE, $this->valeur); - $html .= " value='" . $chaine . "' />\n"; - } - else $html .= " value='" . $this->valeur . "' />\n"; - return $html; - } - - function afficherTexte() { - $html = "$this->label"; - if (is_array($this->valeur)) { - $chaine = implode(_SEPA_AFFICHE_MULTIPLE, $this->valeur); - $html .= $chaine; - } - else $html .= $this->valeur; - $html .= "\n"; - return $html; - } - - function champAOptions() { - if (($this->type == "select") || ($this->type == "checkbox") || ($this->type == "radio")) return true; - else return false; - } - - function controler($pivot=null) { - global $erreur_message; - $this->valeur_db=$this->valeur; - if ($this->type) { - if (($this->type == "text") || ($this->type == "password") || ($this->type == "textarea") || ($this->type == "file")) { - $this->controlerChampTexte($pivot); - if (is_null($this->erreur)) return true; - else return false; - } - else if (($this->type == "select") || ($this->type == "radio")) { - if (!$this->valeur || (sizeof($this->valeur) == 0)) { - $this->erreur = $erreur_message["option"]; - return false; - } - else return true; - } - else return true; - } - else return true; - } - - function aControler() { - if ($this->type && $this->oblig) return true; - else return false; - } - - function retournerTableauValeurs(&$tableau, $mode_retour) { - if (is_array($this->valeur)) {$valeur = implode(_SEPA_VALEUR_MULTIPLE, $this->valeur); - print_r($this->valeur); - die('Cas non géré dans inc_classeform.php'); - } - else $valeur = $this->valeur_db; - switch ($mode_retour) { - case "noms & valeurs" : - $tableau[$this->nom] = $valeur; - break; - case "labels & valeurs" : - $tableau[$this->label] = $valeur; - break; - case "valeurs" : - $tableau[] = $valeur; - } - } - - function affecterValeur($valeurs) { - $valeur = $valeurs[$this->nom]; - if ($this->champAOptions()) { - if (strpos($valeur, _SEPA_VALEUR_MULTIPLE) !== false) - $this->valeur = explode(_SEPA_VALEUR_MULTIPLE, $valeur); - else $this->valeur = $valeur; - for ($i=0;$ioptions);$i++) - $this->options[$i]->selectionnerSiValeur($this->valeur); - } - else $this->valeur = $valeur; - } - - - function controlerChampTexte($pivot) { - global $erreur_message; - if (trim($this->valeur) == "") $this->erreur = $erreur_message["vide"]; - else { - $this->erreur = champTexteConforme($this->valeur, $this->taille_min, $this->taille_max); - if (is_null($this->erreur) && $this->format) { - switch ($this->format) { - case "alphanum" : - if (!controlerAlphanum($this->valeur)) $this->erreur = $erreur_message["alphanum"]; - break; - case "num" : - if (!controlerNum($this->valeur)) $this->erreur = $erreur_message["num"]; - break; - case "num-strict" : - if (!controlerNum($this->valeur, true)) $this->erreur = $erreur_message["num"]; - break; - case "tel" : - if (!controlerTel($this->valeur)) $this->erreur = $erreur_message["tel"]; - break; - case "email" : - if (!controlerEmail($this->valeur)) $this->erreur = $erreur_message["email"]; - break; - case "date" : - if (!controlerDate($this->valeur, $pivot)) $this->erreur = $erreur_message["date"]; - else $this->valeur_db=substr($this->valeur,6,4).'-'.substr($this->valeur,3,2).'-'.substr($this->valeur,0,2); - break; - case "url" : - if (!controlerUrl($this->valeur)) $this->erreur = $erreur_message["url"]; - break; - } - } - } - } - - function afficherFormTexte() { - $html .= "ctl_taille2) $html .= " maxlength='$this->ctl_taille2'"; - if ($this->valeur) $html .= " value='" . $this->valeur . "' />"; - else if ($this->valeur_defaut) $html .= " value='" . $this->valeur_defaut . "' />"; - else if ($this->descro) { $html .= " value='" . htmlentities(stripslashes($this->descro), ENT_QUOTES) . "'"; - $html .= " onFocus='this.value=\"\"' />"; - } - else $html .= " value='' />"; - return $html; - } - - function afficherFormPassword() { - $html .= "ctl_taille2) $html .= " maxlength='$this->ctl_taille2'"; - if ($this->valeur) $html .= " value='" . $this->valeur . "' />"; - else if ($this->descro) { - $html .= " value='" . htmlentities(stripslashes($this->descro), ENT_QUOTES) . "'"; - $html .= " onFocus='this.value=\"\"' />"; - } - else $html .= " value='' />"; - return $html; - } - - function afficherFormTextarea() { - $html .= ""; - return $html; - } - - function afficherFormSelect() { - $html = "\n"; - return $html; - } - - function afficherFormRadio() { - for ($i=0;$ioptions);$i++) { - $html .= $this->options[$i]->afficherFormCase("radio", $this->nom, $this->oblig); - $html .= $this->fin_ligne ? "
    " : " "; - } - return $html; - } - - function afficherFormCheckbox() { - for ($i=0;$ioptions);$i++) { - $html .= $this->options[$i]->afficherFormCase("checkbox", "$this->nom[]", $this->oblig); - $html .= $this->fin_ligne ? "
    " : " "; - } - return $html; - } - - function afficherFormFile() { - $html .= "taille_max) $html .= " maxlength='$this->ctl_taille2'"; - if ($this->descro) $html .= " value='$this->descro' onChange='this.value=\"\"' />"; - else $html .= " value='' />"; - return $html; - } - -} - - - -class ClasseFormOption { - var $valeur; - var $selection; - - function ClasseFormOption($val, $selec=false) { - $this->valeur = htmlspecialchars(stripslashes($val), ENT_QUOTES); - $this->selection = $selec; - } - - - function afficherFormSelect() { - $html = "\n"; - return $html; - } - - function afficherFormCase($type, $nom, $oblig) { - $html = "selection) ? " checked />" : " />"; - if ($oblig) $html .= "" . $this->valeur . ""; - else $html .= "" . $this->valeur . ""; - return $html; - } - - function selectionnerSiValeur($valeurs) { - if (is_array($valeurs)) { - if (in_array($this->valeur, $valeurs)) $this->selection = true; - else $this->selection = false; - } - else if ($this->valeur == $valeurs) $this->selection = true; - else $this->selection = false; - } - -} - - -function controlerEmail($valeur) { - if (preg_match("/^[\w|-]+(\.[\w|-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$/", $valeur)) return true; - else return false; -} - -function controlerDate($valeur, $pivot) { - if (preg_match("/^(\d{1,2})[\/|\-|\.](\d{1,2})[\/|\-|\.](\d\d)(\d\d)?$/", $valeur, $regs)) { - $jour = ($regs[1] < 10) ? "0".$regs[1] : $regs[1]; - $mois = ($regs[2] < 10) ? "0".$regs[2] : $regs[2]; - if ($regs[4]) $an = $regs[3] . $regs[4]; - else { - if ($pivot) { - if ($regs[3] <= $pivot) $an = $regs[3] + 2000; - else $an = $regs[3] + 1900; - } - else $an = $regs[3] + 2000; - } - if (checkdate($mois, $jour, $an)) return true; - else return false; - } - else return false; -} - -function controlerUrl($valeur) { - if (ereg("^((http|ftp):\/\/)?([0-9a-z_]+[\.\-])+[0-9a-z]+(\/[0-9a-z_]+)*(\/[0-9a-z_]+\.[0-9a-z]+)?$", $valeur)) return true; - else return false; -} - -function controlerAlphanum($valeur) { - if (preg_match("/^[\w|\d|\s|'|\"|\\|,|\.|\-|&|#|;]+$/", $valeur)) return true; - else return false; -} - -function controlerNum($valeur, $strict=false) { - if ($strict) { - if (ereg("^[0-9]+$", $valeur)) return true; - else return false; - } - else if (preg_match("/^[\d|\s|\-|\+|E|e|,|\.]+$/", $valeur)) return true; - else return false; -} - -function controlerTel($valeur) { - if (preg_match("/^[\d|\s|\-|\.|\(|\)]+$/", $valeur)) return true; - else return false; -} - -function champTexteConforme($valeur, $min, $max) { - global $erreur_message; - if ($min && (strlen($valeur) < $min)) return $min . " " . $erreur_message["min"]; - else if ($max && (strlen($valeur) > $max)) return $max . " " . $erreur_message["max"]; - else if (preg_match('/(.)\1{4,}/', $valeur)) return $erreur_message["texte"]; - else return null; -} - - -function convertirPost($post) { - $result = array(); - foreach ($post as $cle => $valeur) { - if (is_array($valeur)) { - for ($i=0;$i diff --git a/framework/default/_includes/includes/ICotation.inc b/framework/default/_includes/includes/ICotation.inc deleted file mode 100644 index 2e6c97421..000000000 --- a/framework/default/_includes/includes/ICotation.inc +++ /dev/null @@ -1,302 +0,0 @@ -reTrtAuto = $retraitementAutomatique; - $this->tabBilan = $tabBilan; - - include ('paramCotation.inc'); - } - - function calculProvisionsPourRisque () { - if ( !$this->reTrtAuto ) - return $this->tabBilan['DP'] + $this->tabBilan['DQ'] - $this->tabBilan['X04']; - else - return (1/2*$this->tabBilan['DP'])+(1/2*$this->tabBilan['DQ']); - } - - function calculEBE () { - return $this->tabBilan['FC'] + $this->tabBilan['FF'] + $this->tabBilan['FI'] + $this->tabBilan['FOB'] - + $this->tabBilan['FM'] + $this->tabBilan['FN'] - $this->tabBilan['FC'] + $this->tabBilan['FC'] - - ( $this->tabBilan['FS'] + $this->tabBilan['FT'] + $this->tabBilan['FU'] + $this->tabBilan['FV'] ) - - ( $this->tabBilan['FW'] - $this->tabBilan['HP'] - $this->tabBilan['HQ'] - $this->tabBilan['HP2'] - $this->tabBilan['HQ2'] ) - - $this->tabBilan['FX'] - ( $this->tabBilan['FY'] + $this->tabBilan['FZ'] ) + ( $this->tabBilan['FO'] - $this->tabBilan['FOB'] ) ; - } - - function calculChiffreAffaires () { - return $this->tabBilan['FC'] - + $this->tabBilan['FF'] - + $this->tabBilan['FI'] - + $this->tabBilan['FO'] - - $this->tabBilan['FOB'] ; - } - - function calculMargeCommerciale () { - return $this->tabBilan['FC'] - ( $this->tabBilan['FS'] + $this->tabBilan['FT'] ) ; - } - - function calculProduction () { - return $this->tabBilan['FF'] + $this->tabBilan['FI'] + $this->tabBilan['FM'] + $this->tabBilan['FN'] ; - } - - function calculValeurAjoutee () { - return $this->calculMargeCommerciale() + $this->calculProduction() - - ( $this->tabBilan['FU'] + $this->tabBilan['FV'] + $this->tabBilan['FW'] ) ; - } - - function calculEBEnonCASA () { - return $this->calculValeurAjoutee() + $this->tabBilan['FO'] - $this->tabBilan['FX'] - ( $this->tabBilan['FY'] + $this->tabBilan['FZ'] ) ; - } - - function calculFondsPropresNetsCorriges() { - return $this->tabBilan['DA'] + $this->tabBilan['DC'] + $this->tabBilan['DB'] + $this->tabBilan['DD'] + $this->tabBilan['DE'] + $this->tabBilan['DF'] + $this->tabBilan['DG'] + $this->tabBilan['DK'] - (1/3*$this->tabBilan['X01']) - + $this->tabBilan['DH'] + $this->tabBilan['DI'] + $this->tabBilan['DJ'] - - $this->tabBilan['CL'] - $this->tabBilan['AB'] + $this->tabBilan['AC'] - $this->tabBilan['AA'] - $this->tabBilan['CB'] + $this->tabBilan['CC'] - $this->tabBilan['X02'] - $this->tabBilan['CM'] - $this->tabBilan['CN'] - + $this->tabBilan['DM'] + $this->tabBilan['DN'] - - $this->tabBilan['X03'] + $this->calculProvisionsPourRisque() - $this->tabBilan['RAD'] ; - } - - function calculDettesFinancieresBancairesBrutes () { - return $this->tabBilan['DS'] - $this->tabBilan['CM1'] + $this->tabBilan['EI'] - $this->tabBilan['CM2'] - + $this->tabBilan['DT'] - $this->tabBilan['CM3'] + $this->tabBilan['DU'] - $this->tabBilan['EH'] - + (3/4*$this->tabBilan['YQ']) + (2/3*$this->tabBilan['YR']) - + (3/4*$this->tabBilan['YQ2']) + (2/3*$this->tabBilan['YR2']) - + $this->tabBilan['DV'] - $this->tabBilan['EI'] - $this->tabBilan['DVI1'] - $this->tabBilan['CM2'] - + $this->tabBilan['YS'] + $this->tabBilan['X08'] - + $this->tabBilan['EH'] + $this->tabBilan['VI1'] - ( $this->tabBilan['X20'] + $this->tabBilan['X21'] ) ; - } - - - - function noteCapitalisation () { - if ( !$this->reTrtAuto ) { - $autresDettesExploit = $this->tabBilan['EA'] - $this->tabBilan['EAVI1'] - $this->tabBilan['EAB'] + $this->tabBilan['EB'] + $this->tabBilan['X01'] + $this->tabBilan['X04'] ; - $dettesFiscalesSociales = $this->tabBilan['DY'] - $this->tabBilan['DYA']; - } else { - $autresDettesExploit = $this->tabBilan['EA'] - $this->tabBilan['EAVI1'] - $this->tabBilan['EAB'] + $this->tabBilan['EB'] + $this->tabBilan['X01'] + 2/3*((1/2*$this->tabBilan['DP'])+(1/2*$this->tabBilan['DQ'])); - $dettesFiscalesSociales = $this->tabBilan['DY'] + 1/3*((1/2*$this->tabBilan['DP'])+(1/2*$this->tabBilan['DQ'])) - $this->tabBilan['DYA'] ; - } - - $numerateur = $this->calculFondsPropresNetsCorriges(); - - $denominateur = $numerateur + $this->tabBilan['DS'] - $this->tabBilan['CM1'] + $this->tabBilan['EI'] - $this->tabBilan['CM2'] + $this->tabBilan['DU'] - $this->tabBilan['EH'] - + $this->tabBilan['DV'] - $this->tabBilan['DVI1'] - $this->tabBilan['EI'] + $this->tabBilan['DT'] - $this->tabBilan['CM3'] + 3/4*$this->tabBilan['YQ'] + 2/3*$this->tabBilan['YR'] - + 3/4*$this->tabBilan['YQ2'] + 2/3*$this->tabBilan['YR2'] - + $this->tabBilan['DW'] + $this->tabBilan['DX'] + $dettesFiscalesSociales - + $autresDettesExploit + $this->tabBilan['DZ'] + $this->tabBilan['DIA'] + $this->tabBilan['ED'] + $this->tabBilan['EAB'] + $this->tabBilan['DYA'] - + $this->tabBilan['EH'] + $this->tabBilan['YS'] + $this->tabBilan['VI1']; - // + $this->tabBilan['X08'] - // - $this->tabBilan['X20'] + $this->tabBilan['YS'] - $this->tabBilan['X08']; - - if ($denominateur==0) - return array('NUMERATEUR'=>$numerateur*100,'DENOMINATEUR'=>$denominateur,'NOTE'=>0); - - return array('NUMERATEUR'=>$numerateur* 100,'DENOMINATEUR'=>$denominateur,'NOTE'=>($numerateur* 100)/$denominateur); - } - - function noteLevierEndettement () { - - $numerateur = $this->calculDettesFinancieresBancairesBrutes(); - - $denominateur = $this->calculFondsPropresNetsCorriges(); - - if ($denominateur==0) - return array('NUMERATEUR'=>$numerateur,'DENOMINATEUR'=>$denominateur,'NOTE'=>0); - - return array('NUMERATEUR'=>$numerateur,'DENOMINATEUR'=>$denominateur,'NOTE'=>$numerateur/$denominateur); - } - - function noteCapaciteRemboursement () { - - $numerateur = $this->calculDettesFinancieresBancairesBrutes(); - - $denominateur = $this->calculEBE(); - - if ($denominateur==0) - return array('NUMERATEUR'=>$numerateur,'DENOMINATEUR'=>$denominateur,'NOTE'=>0); - - return array('NUMERATEUR'=>$numerateur,'DENOMINATEUR'=>$denominateur,'NOTE'=>$numerateur/$denominateur); - } - - function noteCouvChargesFi () { - - $numerateur = $this->calculEBE(); - - $denominateur = $this->tabBilan['GR'] + ( 1/4*$this->tabBilan['HP'] + 1/3*$this->tabBilan['HQ'] ) - + ( 1/4*$this->tabBilan['HP2'] + 1/3*$this->tabBilan['HQ2'] ) - + $this->tabBilan['GS'] - + $this->tabBilan['GT'] - - $this->tabBilan['GJ'] - - $this->tabBilan['GK'] - - $this->tabBilan['GL'] - - $this->tabBilan['GN'] - - $this->tabBilan['GO'] - - $this->tabBilan['GH'] - + $this->tabBilan['GI'] ; - - if ($denominateur==0) - return array('NUMERATEUR'=>$numerateur,'DENOMINATEUR'=>$denominateur,'NOTE'=>0); - - return array('NUMERATEUR'=>$numerateur,'DENOMINATEUR'=>$denominateur,'NOTE'=>$numerateur/$denominateur); - } - - function noteTresorerie () { - - $numerateur = $this->tabBilan['CD'] - $this->tabBilan['CE'] + $this->tabBilan['CF'] - $this->tabBilan['CG'] - - $this->tabBilan['EH'] - ( $this->tabBilan['YS'] + $this->tabBilan['X08'] ) ; - - $denominateur = $this->calculChiffreAffaires(); - if ($denominateur==0) - return array('NUMERATEUR'=>$numerateur*360,'DENOMINATEUR'=>$denominateur,'NOTE'=>0); - - return array('NUMERATEUR'=>$numerateur*360,'DENOMINATEUR'=>$denominateur,'NOTE'=>$numerateur*360/$denominateur); - - } - - function noteMargeExploitation () { - - $numerateur = $this->calculEBE(); - - $denominateur = $this->calculChiffreAffaires(); - - if ($denominateur==0) - return array('NUMERATEUR'=>$numerateur*100,'DENOMINATEUR'=>$denominateur,'NOTE'=>0); - - return array('NUMERATEUR'=>$numerateur*100,'DENOMINATEUR'=>$denominateur,'NOTE'=>$numerateur*100/$denominateur); - } - - - - function getSecteurActivite($naf) { - - $nbSecteurs=count($this->tabActivite); - - while (strlen($naf) > 1) - { - for ($i=1; $i<$nbSecteurs; $i++) - { - for ($j=0; isset($this->tabActivite[$i][$j]); $j++) - { - if ($this->tabActivite[$i][$j]==$naf) - // echo 'NAF '.$naf.' TROUVÉ !
    '; - return $i; - } - } - // echo 'NAF '.$naf.' non trouvé !
    '; - $naf=substr($naf,0,strlen($naf)-1); - } - return 17; // Secteur d'activité par défaut si non trouvé - } - - function getBorne($note, $borne, $secteur) { - - // print_array($this->tabR[$borne][$secteur],0); - for ($j=0; $j<10; $j++) - { - $tabMinMax=explode(':',$this->tabR[$borne][$secteur][$j]); - if ($tabMinMax[0]!='') $min=$tabMinMax[0]; - else $min=-1E99; - if ($tabMinMax[1]!='') $max=$tabMinMax[1]; - else $max=1E99; - - if ( ( $note>$min && $note<=$max ) ) - { -// echo "TROUVE ++++ $note > ".$tabMinMax[0]." et $note <= ". $tabMinMax[1].'
    '; - if ($j==0) return 3; - elseif ($j<4) return $j+4; - else return $j*2+1; - } -// echo "NOK $note < ".$tabMinMax[0]." ou $note > ". $tabMinMax[1].'
    '; - } - return 3; // On retourne la plus basse note par défaut - } - - - function getNoteBorne($note, $borne, $secteur, $numerateur, $denominateur) { - - $noteBorneBrute=$this->getBorne($note, $borne, $secteur); - - switch($borne) - { - case 1: - if ($numerateur<0) return 3; - else return $noteBorneBrute; - break; - case 2: - if ($numerateur==0) return 19; - else return $noteBorneBrute; - break; - case 3: - if ($numerateur==0 && $denominateur>0) return 19; - elseif ($denominateur<0) return 3; - else return $noteBorneBrute; - break; - case 4: - if ($note<0) return 19; - else return $noteBorneBrute; - break; - default: - return $noteBorneBrute; - break; - } - } - - - function getNotationFin ($coteMoy) { - if( $coteMoy > 18.5 ) - return 'A'; - elseif( $coteMoy > 16 ) - return 'B+'; - elseif( $coteMoy > 14 ) - return 'B'; - elseif( $coteMoy > 12.5 ) - return 'C+'; - elseif( $coteMoy > 11 ) - return 'C'; - elseif( $coteMoy > 10 ) - return 'C-'; - elseif( $coteMoy > 9 ) - return 'D+'; - elseif( $coteMoy > 8 ) - return 'D'; - elseif( $coteMoy > 7 ) - return 'D-'; - elseif( $coteMoy > 6 ) - return 'E+'; - elseif( $coteMoy > 4.5 ) - return 'E'; - elseif( $coteMoy > 3 ) - return 'E-'; - else - return 'E--'; - } - - - function getInfosNotation ($notation, $csv=false) { - if ($csv) { - $str =$this->tabNotation[$notation][1].';'. - $this->tabNotation[$notation][2].';'. - $this->tabNotation[$notation][3].';'. - $this->tabNotation[$notation][4].';'; - return $str; - } else { - $str ='Notation : '. $this->tabNotation[$notation][0]."\r\n"; - $str.='Equivalence BDF : '. $this->tabNotation[$notation][1]."\r\n"; - $str.='Grades Moody\'s : '. $this->tabNotation[$notation][2]."\r\n"; - $str.='Grades S&P : '. $this->tabNotation[$notation][3]."\r\n"; - $str.='Probabilité de défaillance : '. $this->tabNotation[$notation][4]." %\r\n"; - return $str; - } -} - -} \ No newline at end of file diff --git a/framework/default/_includes/includes/fonctions.php b/framework/default/_includes/includes/fonctions.php deleted file mode 100644 index 53b974393..000000000 --- a/framework/default/_includes/includes/fonctions.php +++ /dev/null @@ -1,418 +0,0 @@ - Code réponse Serveur - ** "header" => Headers du serveur - ** "body" => Page HTML - **/ -function parse_response($this_response) { - - - // Split response into header and body sections - list($response_headers, $response_body) = explode("\r\n\r\n", $this_response, 2); - $response_header_lines = explode("\r\n", $response_headers); - - // First line of headers is the HTTP response code - $http_response_line = array_shift($response_header_lines); - if(preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; } - - // put the rest of the headers in an array - $response_header_array = array(); - $nbRMID=0; - foreach($response_header_lines as $header_line) - { - list($header,$value) = explode(': ', $header_line, 2); - - if ($header=='Set-cookie' && substr($value,0,5)=='RMID=' && $nbRMID<5)//{ - $nbRMID++; -// echo ("Je gicle le RMID n°$nbRMID\r\n");} - else - $response_header_array[$header] .= $value."\n"; - } - return array('code' => $response_code, 'header' => $response_header_array, 'body' => $response_body); -} - -/** Récupère une page HTML en fonction des paramètres : - ** $url Url distante de la page à récupérer - ** $strCookies Chaine de caractère contenant les cookies - ** $postData Tableau des données à passer en POST uniquement - ** $referer Referer à indiquer lors de l'appel de la page - ** $debug Activer le débogage (True/False) - ** - ** ... et retourne son contenu dans un tableau : - ** "code" => Code réponse Serveur - ** "header" => Headers du serveur - ** "body" => Page HTML - **/ -function getUrl($url, $strCookies='', $postData='', $referer='', $debug=false, $host='') { - - - $ch = curl_init(); - - if ($host=='') - $this_header = array('Host: '. HOST_INSEE); - else - $this_header = array('Host: '. $host); - - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_HEADER, 1); - //curl_setopt($ch, CURLOPT_PROXY, '10.142.10.254:80'); - //curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'username:password'); // Pas nécessaire en authentification NT - - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); - //curl_setopt($ch, CURLOPT_MAXREDIRS, 1); - - $user_agent = 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)'; - curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); - curl_setopt($ch, CURLOPT_REFERER, $referer); - - // Add each cookie that has been returned in the response - // If cookies need to be added/deleted or value changed, then add code here - if ($strCookies!='') { - //die('"'.$strCookies.'"'); - //echo $strCookies."\r\n"; - $cookies = explode("\n", $strCookies); - // Create the basic header - foreach($cookies as $this_cookie) { - if (trim($this_cookie)<>'') - array_push($this_header, 'Cookie: '.$this_cookie); - } - } - - if ($postData!='') { - if (is_array($postData)) - $post_data=$postData; - - $o=""; - foreach ($post_data as $k=>$v) - { - $o.= "$k=".utf8_encode($v)."&"; - } - $post_data=substr($o,0,-1); - - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); - //if in_array('',$this_header - /*array_push($this_header, "Content-type: application/x-www-form-urlencoded"); - array_push($this_header, "Content-Length: 44");*/ - } - - curl_setopt($ch, CURLOPT_HTTPHEADER, $this_header); - //print_r($this_header); - - $page=curl_exec($ch); - $response = parse_response($page); - if ($debug){ - $url2=str_replace('http://', '', $url); - $url2=str_replace('/', '_', $url2); - $url2=str_replace('?', '(param)', $url2); - $url2=str_replace('&', '(et)', $url2); - - - $fp=fopen('/var/www/_includes/partenaires/insee/'. date('Ymd-His') .'-'. microtime_float(true) .'-'. $url2 . '.html', 'a'); - fwrite($fp, $url."\r\n"); - fwrite($fp, $page); - fclose($fp); - //echo strip_tags(html_entity_decode($response['body']), ''); - } - //print_r(curl_getinfo($ch)); - curl_close($ch); - return $response; -} - -/**Verification de la validité des données pour la demande*/ -function valideData($variable, $taille_min, $taille_max, $type_variable, $erreur=false){ - if ( strlen((string)$variable) < $taille_min ) - return $erreur; - - if ( strlen((string)$variable) > $taille_max ) - return $erreur; - - if ( $type_variable == 'A' ) - if ( is_string($variable) == true ) - return true; - else - return $erreur; - - elseif ( $type_variable == 'N') - { - for ($i=0; $i < strlen((string)$variable); $i++) - { - $car = substr((string)$variable,$i,1); - if ($car<'0' || $car>'9') - return $erreur; - } - return true; - } - - return $erreur; -} - -/** Test de la validité du siren demandé */ -function valideSiren($siren, $nic='', $erreur=false) { - - $lenSIREN=strlen($siren); - if (!valideData($siren, 9, 9,'N')) //Siren non précisé ou incorrect. - return $erreur; - else - { - if (!isset($nic) || trim($nic)=='') - { - $somme=0; - for ($i=0; $i<=8; $i+=2) // Traitement IMPAIR - $somme+=(integer)substr($siren,$i,1); - - for ($i=1; $i<=7; $i+=2) - { // Traitement PAIR - $var_tmp=(string)(2*((integer)substr($siren,$i,1))); - $som_tmp=0; - for($j=0;$j'); - $VID=getTextInHtml($pageHtml, ''); - $e_cookie=getTextInHtml($pageHtml, ''); - - $response=getUrl(SITE_PJ.'files/look2002/FR/commun/pji.css', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ); - $response=getUrl(SITE_PJ.'files/look2002/FR/commun/pji_PJ.css', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ); - $response=getUrl(SITE_PJ.'files/look2002/FR/commun/script_open.js', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ); - $response=getUrl(SITE_PJ.'files/look2002/FR/commun/alerte.js', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ); - $response=getUrl(SITE_PJ.'files/look2002/FR/commun/script_VED.js', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ); - $response=getUrl(SITE_PJ.'sitecrm/popup.js', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ); - $response=getUrl('http://sbx.pagesjaunes.fr/RealMedia/ads/Creatives/OasDefault/AUTOPROMO_PJ_banniere_activite/hotel_pj.swf?clickTAG=http://sbx.pagesjaunes.fr/RealMedia/ads/click_lx.ads/www.pagesjaunes.fr/GENERAL/GENERAL/PJ/1238513556/Top/OasDefault/AUTOPROMO_PJ_banniere_activite/hotel_pj.html/61633130323433353434346339306330?', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ); - $response=getUrl(SITE_PJ.'files/look2002/FR/commun/script_VED.js', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ); - $response=getUrl('http://sbx.pagesjaunes.fr/RealMedia/ads/Creatives/OasDefault/EDITO_HOME_RIGHT/anim_HP_v2-04-2006.swf', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ); - $response=getUrl('http://sbx.pagesjaunes.fr/RealMedia/ads/Creatives/OasDefault/EDITO_HOME_RIGHT/visuels_webcam.swf', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ); - $response=getUrl('http://sbx.pagesjaunes.fr/RealMedia/ads/Creatives/OasDefault/EDITO_HOME_RIGHT/visuels_photo.swf', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ); - $response=getUrl('http://sbx.pagesjaunes.fr/RealMedia/ads/Creatives/OasDefault/EDITO_HOME_RIGHT/visuels_trafic.swf', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ); - $response=getUrl('http://sbx.pagesjaunes.fr/RealMedia/ads/Creatives/OasDefault/Edito_webcams/new_04-2006.jpg', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ); - $response=getUrl('http://e.pagesjaunes.fr/js/m.js', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ); - - $response2=getUrl($e_cookie, $response1['header']['Set-cookie'], '', SITE_PJ, true, HOST_PJ); - - $cookies=$response1['header']['Set-cookie'] . $response2['header']['Set-Cookie']; - - $input_image=$VALID_ARR=$NUM_RUE=$NEW_DEPARTEMENT=$OBJ_GEO=''; - - // Requête d'interrogation - $postData=array( - 'ACTIVITE_VALIDATED_ASCII'=>'', - 'ID_THEME_SDE'=>'', - 'LISTE_RUB_AVEC_THEME'=>'', - 'input_image'=>$input_image, - - 'FRM_ACTIVITE'=>$activite, - 'FRM_NOM'=>$raisonSociale, - 'FRM_ADRESSE'=>$adresse, - 'FRM_LOCALITE'=>$localite, - 'FRM_DEPARTEMENT'=>$departement, - - 'JF_INSCRIPTIONS_REQ.x'=>'25', - 'JF_INSCRIPTIONS_REQ.y'=>'4', - 'faire'=>'decode_input_image', - 'DEFAULT_ACTION'=>'jf_inscriptions_req', - 'SESSION_ID'=>$SESSION_ID, - 'VID'=>$VID, - 'INFO_VILLE'=>'non', - 'CODE_LOC_INFO_VILLE'=>'00000000', - 'IV_ACTIVATION'=>'oui', - 'lang'=>'FR', - 'pays'=>'FR', - 'srv'=>'PJ', - 'TYPE_RECHERCHE'=>'ZZZ'); -//print_r($postData);//die(); -sleep(1); - $response=getUrl(SITE_PJ, $cookies, $postData, SITE_PJ, true, HOST_PJ); - $pageHtml=$response['body']; - - if (count($tabNT=getTabListeNonTrouve($pageHtml))>0) - { - // Pas de réponses pour ces critères - // Il faut élargir la recherche ! - $tabNTk=array_keys($tabNT); - $input_image=$tabNT[0]; - $DEFAULT_ACTION='inscriptions_req'; - $NEW_DEPARTEMENT=getTextInHtml($pageHtml, ''); - $OBJ_GEO=getTextInHtml($pageHtml, ''); - } - elseif (count($tabGU=getTabListeGU($pageHtml))>0) - { - // Plusieurs Adresses possibles pour l'adresse donnée -// print_r($tabGU); - $input_image=getBonneAdresse($adresse, $tabGU); - $DEFAULT_ACTION='jf_inscriptions_req'; - $VALID_ARR=getTextInHtml($pageHtml, ''); - $NUM_RUE=getTextInHtml($pageHtml, ''); - } - - if ($input_image<>'') { - $CODE_LOC_INFO_VILLE=getTextInHtml($pageHtml, ''); - - $postData=array( - 'GEO_DEP'=>'', // New - 'faire'=>'decode_input_image', - 'DEFAULT_ACTION'=>$DEFAULT_ACTION, - 'input_image'=>$input_image,// diff - 'SESSION_ID'=>$SESSION_ID, - 'VID'=>$VID, - 'INFO_VILLE'=>'oui', // non dans la recherche préc. - 'CODE_LOC_INFO_VILLE'=>$CODE_LOC_INFO_VILLE, // diff - 'IV_ACTIVATION'=>'oui', - 'lang'=>'FR', - 'pays'=>'FR', - 'srv'=>'PJ', - 'TYPE_RECHERCHE'=>'CLOC', // ZZZ - 'SAV_ADRESSE'=>$adresse, // - 'SAV_LOCALITE'=>$localite, // New - 'SAV_DEPARTEMENT'=>$departement, // - 'FRM_NOM'=>$raisonSociale, - 'FRM_ADRESSE'=>$adresse, - 'FRM_LOCALITE'=>$localite, - 'FRM_DEPARTEMENT'=>$departement, - - 'FRM_TYPE_PUB'=>'TOUS', - 'RP_FORM'=>'', - 'VALID_LOC'=>$CODE_LOC_INFO_VILLE, - 'VALID_ARR'=>$VALID_ARR, - 'NUM_RUE'=>$NUM_RUE, - 'test_flash'=>'', - 'ESPLUS'=>'', - 'NEW_DEPARTEMENT'=>$NEW_DEPARTEMENT, - 'OBJ_GEO'=>$OBJ_GEO, - ); -print_r($postData); -sleep(1); - $response=getUrl(SITE_PJ, $cookies, $postData, SITE_PJ, true, HOST_PJ); - $pageHtml=$response['body']; - } - - $nbReponses=trim(getTextInHtml($pageHtml, '', '', 'réponse(s)')); - $tabRep=getTabResponses($pageHtml); - - if (count($tabRep)==$nbReponses) - return $tabRep; - else - return false; -} - -function getTabResponses($pageHtml) { - - $tabRepTmp=explode ('class=fdinscr', $pageHtml); - $tabRep=array(); - foreach($tabRepTmp as $key => $value) - { - if ($key>0) { - $raisonSociale=getTextInHtml($value, 'class=fdrsinscr', '', ''); - $ligneAdresse=html_entity_decode(getTextInHtml($value, '', '', '|')); - $tabligneAdresse=explode('
    ', $ligneAdresse); - $ligneAdresse1=strip_tags($tabligneAdresse[0]); - $ligneAdresse2=strip_tags($tabligneAdresse[1]); - $dispoPlan =(bool)(strpos($value, 'Plan')); - $dispoIti =(bool)(strpos($value, 'Itinéraire')); - $dispoPhoto =(bool)(strpos($value, 'Photo')); - $dispoWeb =(bool)(strpos($value, 'Site   ')); - $lienWeb=getTextInHtml($value, '$raisonSociale, - 'AdresseLigne1' =>$ligneAdresse1, - 'AdresseLigne2' =>$ligneAdresse2, - 'Dispo_Plan' =>$dispoPlan, - 'Dispo_Iti' =>$dispoIti, - 'Dispo_Photo' =>$dispoPhoto, - 'Dispo_Web' =>$dispoWeb, - 'LienWeb' =>$lienWeb)); - } - } - return $tabRep; -} - -function getBonneAdresse($adresse, $tabGU) { - -// tableau de mots à vérifier -$words = array_keys($tabGU); - -// aucune distance de trouvée pour le moment -$shortest = -1; - -// boucle sur les des mots pour trouver le plus près -foreach ($words as $word) { - - // calcule la distance avec le mot mis en entrée, - // et le mot courant - $lev = levenshtein($adresse, $word); - - // cherche une correspondance exacte - if ($lev == 0) { - - // le mot le plus près est celui-ci (correspondance exacte) - $closest = $word; - $shortest = 0; - - // on sort de la boucle ; nous avons trouvé une correspondance exacte - break; - } - - // Si la distance est plus petite que la prochaine distance trouvée - // OU, si le prochain mot le plus près n'a pas encore été trouvé - if ($lev <= $shortest || $shortest < 0) { - // définission du mot le plus près ainsi que la distance - $closest = $word; - $shortest = $lev; - } -} -/* -echo "Mot entré : $adresse\n"; -if ($shortest == 0) { - echo "Correspondance exacte trouvée : $closest\n"; -} else { - echo "Vous voulez dire : $closest ?\n"; -}*/ -return $tabGU[$closest]; -} -?> \ No newline at end of file diff --git a/framework/default/_includes/includes/insee.class.php b/framework/default/_includes/includes/insee.class.php deleted file mode 100644 index e05690dbb..000000000 --- a/framework/default/_includes/includes/insee.class.php +++ /dev/null @@ -1,548 +0,0 @@ -Fiche Etablissement'); - if ($pos>0) - $tabRet['typeEtablissement']='secondaire'; - - $pos=strpos($pageHtml, '', 'class="basictext">', ''); - $tabRet['adresseSiege']=getTextInHtml($pageHtml, '', 'class="basictext">', ''); - print_r($tabRet); - die(); - // Capital social - - // Chiffre d'affaires - - // Date CA - - // Effectif - - // Forme Juridique - - // Nationalité - - // Activité - - // Siège social - /* - - - - - - - -
    Fiche siège'); - if ($pos>0) - $tabRet['typeEtablissement']='siège'; - - // Recherche Dernière MAJ / Activité - $pos=strpos($responseSiege, '(dernière mise à jour :'); - if ($pos>0) { - $tabRet['dateMAJ']=substr($responseSiege, $pos+51, 10); - $tabRet['dateAbsActivite']=''; - $tabRet['active']='O'; - } else { - $tabRet['active']='N'; - $tabRet['dateMAJ']=''; - $pos=strpos($responseSiege, 'Absence d\'activité notée le : '); - if ($pos>0) $tabRet['dateAbsActivite']=substr($responseSiege, $pos+78, 10); - else { - $pos=strpos($responseSiege, 'Absence d\'activité'); - if ($pos>0) $tabRet['dateAbsActivite']=''; - } - } - - $pos=strpos($responseSiege, ' size="-1"> n° SIRET :'); - $tabRet['siret']=str_replace(' ', '', html_entity_decode(substr($responseSiege, $pos+97, 32))); - - $pos=strpos($responseSiege, 'size="-1"> Date de création :'); - if ($pos>0) { - $posFin=strpos($responseSiege, '', $pos+109); - $tabRet['dateCreation']=str_replace(' ', '', html_entity_decode(substr($responseSiege, $pos+109, $posFin-($pos+109)))); - } - else $tabRet['dateCreation']=''; - - $pos=strpos($responseSiege, ' size="-1"> Raison sociale et Enseigne :'); - $len=127; - if ($pos==0){ - $pos=strpos($responseSiege, ' size="-1"> Raison sociale et Enseigne :'); - $len=122; - if ($pos==0){ - $pos=strpos($responseSiege, ' size="-1"> Raison sociale et Enseigne :'); - $len=126; - $libelleErreur='Informations INSEE non diffusables'; - } - } - if ($libelleErreur=='') { - //LARGE*DOMINIQUE MICHEL/
    GERANT SARL BIMAGIQUE  
    - $posFin=strpos($responseSiege, '', $pos+$len); - $raisonSocialeStr=trim(substr($responseSiege, $pos+$len, $posFin-($pos+$len))); - $raisonSocialeTabLigne=explode('
    ', $raisonSocialeStr); - $tabRet['raisonSociale']=trim(str_replace(' ', '', html_entity_decode($raisonSocialeTabLigne[0]))); - $tabRet['Enseigne']=trim(str_replace(' ', '', html_entity_decode($raisonSocialeTabLigne[1]))); - - $pos=strpos($responseSiege, ' size="-1"> Activité principale :
    '); - $tabRet['NafCode']=substr($responseSiege, $pos+120, 4); - $tabRet['NafLib']=trim(substr($responseSiege, $pos+137, 70)); - - $pos=strpos($responseSiege, ' size="-1"> Adresse :'); - $posFin=strpos($responseSiege, '', $pos+103); - $AdresseStr=substr($responseSiege, $pos+103, $posFin-($pos+103)); - $AdresseTabLigne=explode('
    ', $AdresseStr);//' - $tabRet['AdresseLigne1']=str_replace(' ', '/', $AdresseTabLigne[0]); - $tabRet['AdresseLigne2']=str_replace(' ', '/', $AdresseTabLigne[1]); - $tabRet['AdresseLigne3']=str_replace(' ', '/', $AdresseTabLigne[2]); - /* - $AdresseNum=$AdresseTabLigne1[0]; - $AdresseVoi=$AdresseTabLigne1[1]; - $AdresseRue=$AdresseTabLigne1[2]; - $AdresseCP=$AdresseTabLigne2[0]; - $AdresseVille=$AdresseTabLigne2[1]; - */ - $pos=strpos($responseSiege, 'L\'entreprise est connue au répertoire comme '); - if ($pos>0) { - $posFin=strpos($responseSiege, '', $pos+106); - $tabRet['etatJuridique']=html_entity_decode(substr($responseSiege, $pos+106, $posFin-($pos+106))); - $tabRet['dateEtatJuridique']=''; - } else { - $pos=strpos($responseSiege, 'L\'entreprise est cessée le : '); - $tabRet['dateEtatJuridique']=substr($responseSiege, $pos+86, 10); - $tabRet['etatJuridique']='cessée'; - } - //echo 'GetDataEtab="'.$libelleErreur."\"\r\n"; - - return $tabRet; - } -} - - -function getDataEntreprise($pageHtml) -{ - global $libelleErreur; - - $responseEntreprise=$pageHtml; - $tabRet=array(); - - if ($libelleErreur=='') { - - $pos=strpos($responseEntreprise, 'size="-1"> Date de création :
    '); - if ($pos>0) - $tabRet['dateCreationEntrep']=substr($responseEntreprise, $pos+109, 10); - else - $tabRet['dateCreationEntrep']=''; - - // Raison sociale et Sigle - $pos=strpos($responseEntreprise, ' size="-1"> Raison sociale et Sigle :'); - $posFin=strpos($responseEntreprise, '', $pos+123); - $raisonSocialeStr=trim(substr($responseEntreprise, $pos+123, $posFin-($pos+123))); - $raisonSocialeTabLigne=explode('
    ', $raisonSocialeStr); - $tabRet['raisonSocialeEntrep']=trim(str_replace(' ', '', html_entity_decode($raisonSocialeTabLigne[0]))); - $tabRet['sigle']=trim(str_replace(' ', '', html_entity_decode($raisonSocialeTabLigne[1]))); - - // Activité prinicpale Entrep - $pos=strpos($responseEntreprise, ' size="-1"> Activité principale :
    '); - $tabRet['NafCodeEntrep']=substr($responseEntreprise, $pos+120, 4); - $tabRet['NafLibEntrep']=trim(substr($responseEntreprise, $pos+137, 70)); - - // Forme Juridique - $pos=strpos($responseEntreprise, ' size="-1"> Forme juridique :'); - $tabRet['FJCodeEntrep']=substr($responseEntreprise, $pos+116, 4); - $tabRet['FJLibEntrep']=trim(substr($responseEntreprise, $pos+133, 70)); - - // Nb Etab Actifs - $pos=strpos($responseEntreprise, ' size="-1"> Nb établissements actifs :'); - $posFin=strpos($responseEntreprise, '', $pos+118); - $tabRet['nbEtabActifs']=trim(str_replace(' ', '', html_entity_decode(substr($responseEntreprise, $pos+118, $posFin-($pos+118))))); - } - return $tabRet; -} - -/* -* parseHtml.php -* Author: Carlos Costa Jordao -* Email: carlosjordao@yahoo.com -* -* My notation of variables: -* i_ = integer, ex: i_count -* a_ = array, a_html -* b_ = boolean, -* s_ = string -* -* What it does: -* - parses a html string and get the tags -* - exceptions: html tags like

    , etc -* - At the end, the array will look like this: -* ["IMG"][0]["SRC"] = "xxx" -* ["IMG"][1]["SRC"] = "xxx" -* ["IMG"][1]["ALT"] = "xxx" -* ["A"][0]["HREF"] = "xxx" -* -*/ -function parseHtml( $s_str ) -{ - $i_indicatorL = 0; - $i_indicatorR = 0; - $s_tagOption = ''; - $i_arrayCounter = 0; - $a_html = array(); - // Search for a tag in string - while( is_int(($i_indicatorL=strpos($s_str,'<',$i_indicatorR))) ) { - // Get everything into tag... - $i_indicatorL++; - $i_indicatorR = strpos($s_str,'>', $i_indicatorL); - $s_temp = substr($s_str, $i_indicatorL, ($i_indicatorR-$i_indicatorL) ); - $a_tag = explode( ' ', $s_temp ); - // Here we get the tag's name - list( ,$s_tagName,, ) = each($a_tag); - $s_tagName = strtoupper($s_tagName); - // Well, I am not interesting in
    , or anything else like that... - // So, this is false for tags without options. - $b_boolOptions = is_array(($s_tagOption=each($a_tag))) && $s_tagOption[1]; - if( $b_boolOptions ) { - // Without this, we will mess up the array - $i_arrayCounter = (int)count($a_html[$s_tagName]); - // get the tag options, like src="htt://". Here, s_tagTokOption is 'src' and s_tagTokValue is '"http://"' - - do { - $s_tagTokOption = strtoupper(strtok($s_tagOption[1], "=")); - $s_tagTokValue = trim(strtok("=")); - $a_html[$s_tagName][$i_arrayCounter][$s_tagTokOption] = - $s_tagTokValue; - $b_boolOptions = is_array(($s_tagOption=each($a_tag))) && - $s_tagOption[1]; - } while( $b_boolOptions ); - } - } - return $a_html; -} - -function getDataEntrepriseRNCS($pageHtml) { - - global $libelleErreur; - - $tabRet=array(); - - // Liste et liens vers les Bilans - $tabRet['tabListeBilans']=getTabListeBilans($pageHtml); - $tabRet['raisonSociale']=getTextInHtml($pageHtml, '

    ', '
    ', '
    '); - $tabRet['RCS']=getTextInHtml($pageHtml, 'RCS ', 'RCS ', '', true); - $tabRet['activite']=getTextInHtml($pageHtml, '
    ActivitéSiège - social
    Siège - social75 Avenue la Grande Armee
    - 75116 PARIS 16
    -

    -
    -
    - - - - - - -
    Renseignements - juridiques 
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Forme - juridiqueSA à conseil d'administration
    Capital social171.285.000,00 - EURO
    NationalitéFrance
    -

    -
    -
    -
    - - - - - - -
    Chiffres - clésau 31-12-2004
    - - - - - - - - - - - - - - - -
    Chiffre - d'affaires18.049.000.000 - EU
    EffectifDe 5150 à 5720
    -

    -
    -
    -
    -
    - */ - return $tabRet; -} - -function getDataEcoCoface($pageHtml) { - - global $libelleErreur; - - $tabRet=array(); - - // SIREN - $pos=strpos($pageHtml, 'La forme juridique ou la date de création trop récente de l\'entreprise ne nous permettant pas d\'obtenir suffisamment d\'informations, nous vous offrons ce produit.'); - if ($pos>0) { - $tabRet['infoEco']='OUI'; - $tabRet['societeInactive']=@getTextInHtml($pageHtml, '', ''); - $strCapital=@getTextInHtml($pageHtml, ''); - $tabTmp=explode('', $strCapital); - $tabRet['capital_source']=str_replace(')', '', $tabTmp[0]); - $tabTmp=explode(' ', $tabTmp[1]); - $tabRet['capital_montant']=str_replace(chr(160), '', trim(strip_tags($tabTmp[0]))); - $tabRet['capital_devise']=trim(strip_tags($tabTmp[1])); - $tabRet['dateCreation']=@getTextInHtml($pageHtml, '', ''); - $tabRet['formeJuridique']=@getTextInHtml($pageHtml, '', ''); - $tabRet['cotationBourse']=@getTextInHtml($pageHtml, '', ''); - $tabRet['effectifSociete']=@getTextInHtml($pageHtml, '', ''); - $tabRet['activite']=@getTextInHtml($pageHtml, '', ''); - - $tabRet['sigle']=@getTextInHtml($pageHtml, '', ''); - $tabRet['enseigne']=@getTextInHtml($pageHtml, '', ''); - - // Dirigeants - $strDir=@getTextInHtml($pageHtml, '', '', '
    Société inactive ', ' Capital   (', '(', '
    Date de création ', ' Forme juridique ', ' Cotation en bourse ', ' Effectif société ', ' Activité ', ' Sigle ', ' Enseigne ', 'IDENTITE 
    '); - $tabDir=explode('', $strDir); - $nbDir=1; - foreach ($tabDir as $key => $dir) - { - $tabTmp=explode(' ', $dir); - $typeDir=trim(strip_tags($tabTmp[0])); - $nomDir=trim(strip_tags($tabTmp[1])); - if ($typeDir<>'' && $typeDir<>'Date de création' && $typeDir<>'Forme juridique' && $typeDir<>'Cotation en bourse' - && $typeDir<>'Effectif société' && $typeDir<>'Société inactive' && $typeDir<>'Activité' - && $typeDir<>'Sigle' && $typeDir<>'Enseigne' - && substr($typeDir, 0, 8) <>'Capital ' ) - { - //$tabDir['Produits'].=$produit.'/'; - //$produit=str_replace(' ','_',$produit); - $tabRet['Dirigeant'.$nbDir.'Type']=trim($typeDir); - $tabTmp=explode(' ', $nomDir); - $tabRet['Dirigeant'.$nbDir.'Genre']=trim($tabTmp[0]); - $tabRet['Dirigeant'.$nbDir.'Prenom']=trim($tabTmp[1]); - $tabRet['Dirigeant'.$nbDir.'Nom']=trim($tabTmp[2]); - $nbDir++; - } - } - $tabRet['NbDirigeants']=$nbDir-1; - - // Liens Financiers - $strTmp=@getTextInHtml($pageHtml, 'LIENS FINANCIERS', ' ', ''); - if (strpos($strTmp, 'Néant')>0) - $tabRet['LiensFinanciers']='Néant'; - else - $tabRet['LiensFinanciers']='Présence liens'; - - // ELEMENTS FINANCIERS - $strTmp=@getTextInHtml($pageHtml, 'ELEMENTS FINANCIERS', ' ', ''); - if (strpos($strTmp, 'Néant')>0) - $tabRet['ElementsFinanciers']='Néant'; - else - $tabRet['ElementsFinanciers']='Présence El.Fi.'; - } - else - $tabRet['infoEco']='NON'; - - //echo $pageHtml; - //print_r($tabRet); - //die(); - - return $tabRet; -} - - -function getDataEntrepriseCoface($pageHtml) { - - global $libelleErreur; - - $tabRet=array(); - - // SIREN - $tabRet['siren']=@getTextInHtml($pageHtml, 'portail/entreprise_identite/identite.asp?nsiren=', '?nsiren=', '&IMPRESSION=OUI'); - //$tabRet['siren']=@getTextInHtml($pageHtml, '
     Qui sommes nous - Qui sommes nous - Raison sociale
    ', '', ''); - $tabRS_Adr=explode('
    ', $strRS_Adr); - $tabRet['raisonSociale']=trim($tabRS_Adr[0]); - $tabRS_Adr1=explode(' ', $tabRS_Adr[1]); - $tabRet['AdresseLigne1']=trim($tabRS_Adr1[0]); - $tabRet['AdresseLigne2']=trim($tabRS_Adr1[1]); - $tabRS_Adr1=explode(' ', $tabRS_Adr[2]); - $tabRet['codePostal']=trim($tabRS_Adr1[0]); - $tabRet['ville']=trim($tabRS_Adr1[1]); - $tabRet['UrlGeoLoc']=@getTextInHtml($pageHtml, '
    Téléphone
    ', '', ''); - $tabTelFax=explode('
    ', $strTelFax); - $tabRet['tel']=trim($tabTelFax[0]); - $tabRet['fax']=trim($tabTelFax[1]); - - // Adresse Internet / Email - $strInet=@getTextInHtml($pageHtml, 'Adresse internet
    ', '
    ', '>', '') ); - $tabRet['mail']=trim( @getTextInHtml($tabInet[1], ' href="mailto:', ':', '">') ); - - // Bourse - $strBourse=@getTextInHtml($pageHtml, ' '."\r\n".' Code Sicovam
    ', '', ''); - $tabBourse=explode('
    ', $strBourse); - $tabRet['bourse_isin']=trim($tabBourse[0]); - $tabRet['bourse_marche']=trim($tabBourse[1]); - $tabRet['bourse_ville']=trim($tabBourse[2]); - - // Activité - $tabRet['activite']=trim(str_replace(' ', ' ', @getTextInHtml($pageHtml, 'Libellé code activité ', '', ''))); - - // Produits disponibles - $strDispos=@getTextInHtml($pageHtml, '
    Produits disponibles


    ', '', '
    '); - $tabDispos=explode(' $produit) - { - $produit=trim(str_replace('>', '', str_replace('nowrap>', '', strip_tags($produit)))); - if ($produit<>'' && $produit<>' ') { - $tabRet['Produits'].=$produit.'/'; - $produit=str_replace(' ','_',$produit); - $tabRet['Produit_'.$produit]='Oui'; - } - } -// print_r($tabRet); -// die(); - - return $tabRet; -} - - -function getTabListeBilans($pageHtml) { - $tabUrl=array(); - $deb=$fin=0; - while( is_int(($deb=strpos($pageHtml,'', $s_temp); - $tabUrl[$a_temp[1]]=$a_temp[0]; - } - return $tabUrl; -} - -function getTabListeGU($pageHtml) { - $tabGU=array(); - $deb=$fin=0; - /* Lancer la recherche dans toute la localité -Lancer la recherche sans l'adresse -*/ - while( is_int(($deb=strpos($pageHtml,'', $s_temp); - $tabGU[$a_temp[1]]=$a_temp[0]; - } - return $tabGU; -} - -function getTabListeNonTrouve($pageHtml) { - $tabGU=array(); - $deb=$fin=0; - /* onMouseOver="javascript:mOvr(this);" onMouseOut="javascript:mOut(this);">Lancer la recherche dans toute la localité - onMouseOver="javascript:mOvr(this);" onMouseOut="javascript:mOut(this);">Lancer la recherche sans l'adresse -*/ - while( is_int(($deb=strpos($pageHtml,'onMouseOver="javascript:mOvr(this);" onMouseOut="javascript:mOut(this);">', $s_temp); - $tabGU[$a_temp[1]]=$a_temp[0]; - } - return $tabGU; -} -/** Recherche un texte dans une page HTML - ** - **/ -function getTextInHtml($pageHtml, $strToFind, $strDeb, $strEnd, $include_strDeb=false, $include_strEnd=false, $ltrim=true, $rtrim=true, &$fin, $nbOcc=1) { - $tabRet=array(); - $deb=$nbOccTrouve=0; - while( is_int(($deb=strpos($pageHtml,$strToFind,$fin))) ) { - $deb++; - $deb2 = strpos($pageHtml,$strDeb, $deb); - $fin = strpos($pageHtml,$strEnd, $deb2); - if (!$include_strDeb) - $deb2+=strlen($strDeb); - $s_temp = substr($pageHtml, $deb2, ($fin-$deb2)); - - if ($ltrim) $s_temp=ltrim($s_temp); - if ($rtrim) $s_temp=rtrim($s_temp); - - if ($nbOcc==1) return $s_temp; - //echo $s_temp."\r\n"; - //$a_temp = explode('" class="basic">', $s_temp); - $tabUrl[$nbOccTrouve]=$s_temp; - $nbOccTrouve++; - - if ($nbOcc==$nbOccTrouve) { - // echo "j'ai trouvé le nb demandé, je sort\r\n"; - break; - }; - } - - return $tabUrl; - /* -
  • Le type de voie a été modifié
    -
  • L'orthographe du mot directeur a été modifiée
    -
  • Le code postal a été forcé à partir du département et de la localité
    -*/ -} - ?> \ No newline at end of file diff --git a/framework/default/_includes/includes/normad.class.php b/framework/default/_includes/includes/normad.class.php deleted file mode 100644 index 7419b5264..000000000 --- a/framework/default/_includes/includes/normad.class.php +++ /dev/null @@ -1,89 +0,0 @@ -$adrL2, //htmlentities($adrL2), - 'ad2'=>$adrL3, //htmlentities($adrL3), - 'ad3'=>$adrL4, //htmlentities($adrL4), - 'ad4'=>$adrL5, //htmlentities($adrL5), - 'cod'=>$codPos, - 'loc'=>htmlentities($ville), - 'hiddenField'=>'GEN',); - $tabHtml=getUrl(SITE_NORMAD.'traiter_adresse.php', '', $postData, SITE_NORMAD.'validez.php', true, HOST_NORMAD); - $page=$tabHtml['body']; - $posInHtml=0; - $tabRet=array(); - - $retour=trim(str_replace(chr(173), '', getTextInHtml($page, '', '', '', false, true, true, true, $posInHtml))); - $retour=explode('[*', $retour); - $tabRet['retour_code']=str_replace(']','',$retour[1]); - $tabRet['retour_libelle']=trim($retour[0]); - $tabRet['retour_messages']=getTextInHtml($page, '
  • ', 'i>', '
    ', false, false, true, true, $posInHtml, 0); - - // Récupération des Lignes d'adresse - $tabRet['ligne1']=$adrL1; - $tabRet['ligne2']=getTextInHtml($page, 'Adresse en sortie :', '', '', false, false, true, true, $posInHtml); - $tabRet['ligne3']=getTextInHtml($page, ' Volet 2 : ', '', '', false, false, true, true, $posInHtml); - $tabRet['ligne4']=getTextInHtml($page, ' Volet ', '', '', false, false, true, true, $posInHtml); - $tabRet['ligne5']=getTextInHtml($page, ' Volet 4 : ', '', '', false, false, true, true, $posInHtml); - $tabRet['CP']=getTextInHtml($page, ' CP : ', '', '', false, false, true, true, $posInHtml); - $tabRet['ville']=getTextInHtml($page, ' Localité : ', '', '', false, false, true, true, $posInHtml); - $tabRet['ligne6']=$tabRet['CP'] .' '. $tabRet['ville']; - - // Découpage de la rue - $tabRet['voie_num']=getTextInHtml($page, 'Numéro ', '', '
    ', false, false, true, true, $posInHtml); - $tabRet['voie_btq']=getTextInHtml($page, 'Bis/Ter/Quater/...', '', '
    ', false, false, true, true, $posInHtml); - $tabRet['voie_type']=getTextInHtml($page, 'Type', '', '
    ', false, false, true, true, $posInHtml); - $tabRet['voie_denom']=getTextInHtml($page, 'Dénomination', '', '
    ', false, false, true, true, $posInHtml); - $tabRet['voie_motDir']=getTextInHtml($page, 'directeur :
    ', '', '
    ', false, false, true, true, $posInHtml); - $tabRet['voie_matric']=getTextInHtml($page, 'Matricule voie :', '
    ', '
    ', false, true, true, true, $posInHtml); - $tabRet['code_insee_commune']=getTextInHtml($page, 'Code INSEE commune :', '
    ', '
    ', false, true, true, true, $posInHtml); - - print_r($tabRet); - //echo "$voie_num\r\n$voie_btq\r\n$voie_type\r\n$voie_denom\r\n$voie_motDir\r\n$voie_matric\r\n$code_insee_commune\r\n"; - } - -/* - Détails :
    - - 00441644
    - - 28074
    -
    -
    - - - -
    - - - -

     

    -

    Référentiels - d'avril 2006

    -*/ - - } ?> \ No newline at end of file diff --git a/framework/default/_includes/includes/paramCotation.inc b/framework/default/_includes/includes/paramCotation.inc deleted file mode 100644 index 6fcc54160..000000000 --- a/framework/default/_includes/includes/paramCotation.inc +++ /dev/null @@ -1,170 +0,0 @@ -tabNotation['A+']=array('Exceptionnel', 'A3++', 'Aaa' ,'AAA' ,'0.001'); - $this->tabNotation['A'] =array('Excellent', 'A3+', 'Aa1 Aa2 Aa3' ,'AA+ AA AA-' ,'0.01'); - $this->tabNotation['B+']=array('Très bon', '3++', 'A1' ,'A+' ,'0.02'); - $this->tabNotation['B'] =array('Bon', '3+', 'A2 A3' ,'A A-' ,'0.04'); - $this->tabNotation['C+']=array('Assez bon', '3', 'Baa1' ,'BBB+' ,'0.15'); - $this->tabNotation['C'] =array('Acceptable', '3', 'Baa2' ,'BBB' ,'0.30'); - $this->tabNotation['C-']=array('Moyen', '3', 'Baa3' ,'BBB-' ,'0.60'); - $this->tabNotation['D+']=array('Passable', '4+', 'Ba1' ,'BB+' ,'0.90'); - $this->tabNotation['D'] =array('Médiocre', '4', 'Ba2' ,'BB' ,'1.25'); - $this->tabNotation['D-']=array('Très médiocre', '4', 'Ba3' ,'BB-' ,'1.60'); - $this->tabNotation['E+']=array('Mauvais (sous surveillance)', '5', 'B1 B2 B3', 'B+ B B-', '5.00'); - $this->tabNotation['E'] =array('Très mauvais (sensible, sans incident)', '6', 'Caa', 'CCC', '14.00'); - $this->tabNotation['E-']=array('Très mauvais (sensible avec incidents)', '8', 'Ca C', 'CC C', '17.00'); - $this->tabNotation['F'] =array('En défaut, hors procédures judiciaires (douteux)', '8 9', 'D', 'D', 'Défaut'); - $this->tabNotation['Z'] =array('En défaut, avec procédures judiciaires ou contentieuses (douteux)', 'P', '', '', 'Défaut'); - - $this->tabLibActivite[0]=''; - $this->tabLibActivite[15]='Industries Alimentaires : Collecte Appro'; - $this->tabLibActivite[3]='Industries Alimentaires : Collecte et 1ère transformation'; - $this->tabLibActivite[5]='Industries Alimentaires : Eaux de vie et Champagne'; - $this->tabLibActivite[2]='Industries Alimentaires : Autres activités'; - $this->tabLibActivite[6]='Industries extractives / Production Distribution : Énergie Eau'; - $this->tabLibActivite[7]='Construction - BTP'; - $this->tabLibActivite[1]='Industries Manufacturières'; - $this->tabLibActivite[8]='Négoce'; - $this->tabLibActivite[4]='Commerce de Gros'; - $this->tabLibActivite[9]='Commerce Distribution'; - $this->tabLibActivite[10]='Grande Distribution'; - $this->tabLibActivite[12]='Transports'; - $this->tabLibActivite[13]='Media Technologie de l\'information'; - $this->tabLibActivite[14]='Services'; - $this->tabLibActivite[11]='Hôtellerie et Loisirs / Activités immobilières'; - $this->tabLibActivite[16]='Banques. Assurances. Activités financières'; - $this->tabLibActivite[17]='Agriculture. Sylviculture. Pêche. Aquaculture'; - - $this->tabActivite[15]=array('512A'); - $this->tabActivite[3]=array('151A','151C','152','153E','155','157','159G','159J','159N','159Q'); - $this->tabActivite[5]=array('159A','159F'); - $this->tabActivite[2]=array('151E','151F','153A','153C','153F','154','156','158','159B','159D','159L','159S','159T'); - $this->tabActivite[6]=array('11','10','12','13','14','401','402','403','410'); - $this->tabActivite[7]=array('451','452','453','454','455'); - $this->tabActivite[1]=array('251','252','241','242','243','245','246','247','261','262','263','264','265','266','267','268','244','297','300','311','312','313','314','315','316','321','322','323','17','18','19','20','21','271','272','273','274','275','281','282','283','284','285','286','287','291','292','293','294','295','296','341','342','343','353','351','352','354','355','223','331','332','333','334','335','361','362','363','364','365','366','231','232','233','222','371','372'); - $this->tabActivite[8]=array(); - $this->tabActivite[4]=array('511A','511N','511P','512C','512E','512G','512J','513','511C','515A','515C','511E','511G','511J','511L','511R','511T','511U','514','515E','515F','515H','515J','515L','515N','515Q','516','517'); - $this->tabActivite[9]=array('501','502','503','504','505','521A','521B','521C','521J','522','523','524A','524C','524E','524F','524H','524J','524L','524N','524R','524T','524U','524V','524W','524X','524Y','524Z','525','526'); - $this->tabActivite[10]=array('521D','521E','521F','521H','524P'); - $this->tabActivite[12]=array('621','622','623','611','612','602','603','631','632','634','634B','634C','634A','641'); - $this->tabActivite[13]=array('221','722','721','723','724','725','726','924','642','922','921'); - $this->tabActivite[14]=array('703','712E','711','712A','713','714','712C','741A','741C','741E','741G','742','743','741J','744','745','746','747','748','900','633','801','802','803','804','851','852','853','930','911','912','913','527','950'); - $this->tabActivite[11]=array('923','925','926','927','551','552','553','554','555','702'); - $this->tabActivite[16]=array('651','660','672','652E','652A','652C','652F','671'); - $this->tabActivite[17]=array('751','990','752','990','701'); - - $this->tabR[1][0]=array(); - $this->tabR[1][1]=array('0:15.5','15.5:21.7','21.7:25','25:29.1','29.1:33.4','33.4:37','37:40','40:42.6','42.6:44.9','44.9:100'); - $this->tabR[1][2]=array('0:18.7','18.7:22.8','22.8:25','25:27.7','27.7:30.6','30.6:33','33:35','35:36.7','36.7:38.3','38.3:100'); - $this->tabR[1][3]=array('0:18.7','18.7:22.8','22.8:25','25:27.7','27.7:30.6','30.6:33','33:35','35:36.7','36.7:38.3','38.3:100'); - $this->tabR[1][4]=array('0:8.7','8.7:12.8','12.8:15','15:17.7','17.7:20.6','20.6:23','23:25','25:26.7','26.7:28.3','28.3:100'); - $this->tabR[1][5]=array('0:18.7','18.7:22.8','22.8:25','25:27.7','27.7:30.6','30.6:33','33:35','35:36.7','36.7:38.3','38.3:100'); - $this->tabR[1][6]=array('0:20.5','20.5:26.7','26.7:30','30:34.1','34.1:38.4','38.4:42','42:45','45:47.6','47.6:49.9','49.9:100'); - $this->tabR[1][7]=array('0:13.7','13.7:17.8','17.8:20','20:22.7','22.7:25.6','25.6:28','28:30','30:31.7','31.7:33.3','33.3:100'); - $this->tabR[1][8]=array('0:3.7','3.7:7.8','7.8:10','10:12.7','12.7:15.6','15.6:18','18:20','20:21.7','21.7:23.3','23.3:100'); - $this->tabR[1][9]=array('0:13.7','13.7:17.8','17.8:20','20:22.7','22.7:25.6','25.6:28','28:30','30:31.7','31.7:33.3','33.3:100'); - $this->tabR[1][10]=array('0:5.7','5.7:9.8','9.8:12','12:14.7','14.7:17.6','17.6:20','20:22','22:23.7','23.7:25.3','25.3:100'); - $this->tabR[1][11]=array('0:18.7','18.7:22.8','22.8:25','25:27.7','27.7:30.6','30.6:33','33:35','35:36.7','36.7:38.3','38.3:100'); - $this->tabR[1][12]=array('0:13.7','13.7:17.8','17.8:20','20:22.7','22.7:25.6','25.6:28','28:30','30:31.7','31.7:33.3','33.3:100'); - $this->tabR[1][13]=array('0:23.7','23.7:27.8','27.8:30','30:32.7','32.7:35.6','35.6:38','38:40','40:41.7','41.7:43.3','43.3:100'); - $this->tabR[1][14]=array('0:18.7','18.7:22.8','22.8:25','25:27.7','27.7:30.6','30.6:33','33:35','35:36.7','36.7:38.3','38.3:100'); - $this->tabR[1][15]=array('0:15.5','15.5:21.7','21.7:25','25:29.1','29.1:33.4','33.4:37','37:40','40:42.6','42.6:44.9','44.9:100'); - $this->tabR[1][16]=array('0:6.8','6.8:8.9','8.9:10','10:11.4','11.4:12.8','12.8:14','14:15','15:15.9','15.9:16.6','16.6:100'); - $this->tabR[1][17]=array('0:18.7','18.7:22.8','22.8:25','25:27.7','27.7:30.6','30.6:33','33:35','35:36.7','36.7:38.3','38.3:100'); - - $this->tabR[2][0]=array(); - $this->tabR[2][1]=array('1.8:','1.6:1.8','1.5:1.6','1.4:1,5','1.2:1.4','1.0:1.2','0.9:1.0','0.8:0,9','0.7:0,8','0:0.7'); - $this->tabR[2][2]=array('2.2:','1.9:2.2','1.8:1.9','1.6:1.8','1.4:1.6','1.2:1.4','1.0:1.2','0.9:1.0','0.7:0.9','0:0.7'); - $this->tabR[2][3]=array('2.2:','1.9:2.2','1.8:1.9','1.6:1.8','1.4:1.6','1.2:1.4','1.0:1.2','0.9:1.0','0.7:0.9','0:0.7'); - $this->tabR[2][4]=array('3.0:','2.7:3.0','2.5:2.7','2.3:2.5','2.0:2.3','1.7:2.0','1.5:1.7','1.3:1.5','1.1:1.3','0:1.1'); - $this->tabR[2][5]=array('2.6:','2.4:2.6','2.2:2.4','2.0:2.2','1.7:2.0','1.5:1.7','1.3:1.5','1.1:1.3','1.0:1.1','0:1'); - $this->tabR[2][6]=array('1.7:','1.6:1.7','1.5:1.6','1.4:1.5','1.2:1.4','1.1:1.2','1.0:1.1','0.9:1.0','0.8:0.9','0:0.8'); - $this->tabR[2][7]=array('1.5:','1.4:1.5','1.3:1.4','1.1:1.3','1.0:1.2','0.9:1.0','0.8:0.9','0.7:0.8','0.6:0.7','0:0.6'); - $this->tabR[2][8]=array('10.1:','8.8:10.1','8:8.8','7:8','5.8:7','4.8:5.8','4:4.8','3.3:4','2.8:3.3','0:2.8'); - $this->tabR[2][9]=array('3:','2.7:3','2.5:2.7','2.3:2.5','2:2.3','1.7:2','1.5:1.7','1.3:1.5','1.1:1.3','0:1.1'); - $this->tabR[2][10]=array('3.8:','3.3:3.8','3.0:3.3','2.6:3.0','2.2:2.6','1.8:2.2','1.5:1.8','1.2:1.5','1.0:1.2','0:1'); - $this->tabR[2][11]=array('2.3:','2.1:2.3','2:2.1','1.8:2','1.6:1.8','1.5:1.6','1.3:1.5','1.2:1.3','1:1.2','0:1'); - $this->tabR[2][12]=array('2.3:','2.1:2.3','2:2.1','1.8:2','1.6:1.8','1.5:1.6','1.3:1.5','1.2:1.3','1:1.2','0:1'); - $this->tabR[2][13]=array('1.8:','1.6:1.8','1.5:1.6','1.4:1.5','1.2:1.4','1:1.2','0.9:1','0.8:0.9','0.7:0.8','0:0.7'); - $this->tabR[2][14]=array('1.8:','1.6:1.8','1.5:1.6','1.4:1.5','1.2:1.4','1:1.2','0.9:1','0.8:0.9','0.7:0.8','0:0.7'); - $this->tabR[2][15]=array('2.2:','1.9:2.2','1.7:1.9','1.5:1.7','1.2:1.5','1.0:1.2','0.8:1.0','0.7:0.8','0.5:0.7','0:0.5'); - $this->tabR[2][16]=array('10.1:','8.8:10.1','8:8.8','7:8','5.8:7','4.8:5.8','4:4.8','3.3:4','2.8:3.3','0:2.8'); - $this->tabR[2][17]=array('2.2:','1.9:2.2','1.8:1.9','1.6:1.8','1.4:1.6','1.2:1.4','1:1.2','0.9:1','0.7:0.9','0:0.7'); - - $this->tabR[3][0]=array(); - $this->tabR[3][1]=array('4.4:','4:4.4','3.8:4','3.5:3.8','3.1:3.5','2.8:3.1','2.5:2.8','2.2:2.5','2:2.2','0:2'); - $this->tabR[3][2]=array('5.2:','4.7:5.2','4.5:4.7','4.1:4.5','3.7:4.1','3.3:3.7','3:3.3','2.7:3','2.4:2.7','0:2.4'); - $this->tabR[3][3]=array('5.2:','4.7:5.2','4.5:4.7','4.1:4.5','3.7:4.1','3.3:3.7','3:3.3','2.7:3','2.4:2.7','0:2.4'); - $this->tabR[3][4]=array('5.2:','4.7:5.2','4.5:4.7','4.1:4.5','3.7:4.1','3.3:3.7','3:3.3','2.7:3','2.4:2.7','0:2.4'); - $this->tabR[3][5]=array('8.6:','7.9:8.6','7.5:7.9','6.9:7.5','6.2:6.9','5.6:6.2','5:5.6','4.5:5','4:4.5','0:4'); - $this->tabR[3][6]=array('4.4:','4:4.4','3.8:4','3.5:3.8','3.1:3.5','2.8:3.1','2.5:2.8','2.2:2.5','2:2.2','0:2'); - $this->tabR[3][7]=array('4.4:','4:4.4','3.8:4','3.5:3.8','3.1:3.5','2.8:3.1','2.5:2.8','2.2:2.5','2:2.2','0:2'); - $this->tabR[3][8]=array('10.9:','9.7:10.9','9:9.7','8:9','6.8:8','5.8:6.8','5:5.8','4.3:5','3.7:4.3','0:3.7'); - $this->tabR[3][9]=array('5.2:','4.7:5.2','4.5:4.7','4.1:4.5','3.7:4.1','3.3:3.7','3:3.3','2.7:3','2.4:2.7','0:2.4'); - $this->tabR[3][10]=array('5.2:','4.7:5.2','4.5:4.7','4.1:4.5','3.7:4.1','3.3:3.7','3:3.3','2.7:3','2.4:2.7','0:2.4'); - $this->tabR[3][11]=array('5.2:','4.7:5.2','4.5:4.7','4.1:4.5','3.7:4.1','3.3:3.7','3:3.3','2.7:3','2.4:2.7','0:2.4'); - $this->tabR[3][12]=array('5.9:','5.4:5.9','5:5.4','4.5:5','3.9:4.5','3.4:3.9','3:3.4','2.6:3','2.3:2.6','0:2.3'); - $this->tabR[3][13]=array('4.2:','3.8:4.2','3.5:3.8','3.1:3.5','2.7:3.1','2.3:2.7','2:2.3','1.7:2','1.5:1.7','0:1.5'); - $this->tabR[3][14]=array('4.2:','3.8:4.2','3.5:3.8','3.1:3.5','2.7:3.1','2.3:2.7','2:2.3','1.7:2','1.5:1.7','0:1.5'); - $this->tabR[3][15]=array('6.9:','6.3:6.9','6.0:6.3','5.5:6.0','5.0:5.5','4.5:5.0','4.0:4.5','3.6:4.0','3.2:3.6','0:3.2'); - $this->tabR[3][16]=array('10.9:','9.7:10.9','9:9.7','8:9','6.8:8','5.8:6.8','5:5.8','4.3:5','3.7:4.3','0:3.7'); - $this->tabR[3][17]=array('5.2:','4.7:5.2','4.5:4.7','4.1:4.5','3.7:4.1','3.3:3.7','3:3.3','2.7:3','2.4:2.7','0:2.4'); - - $this->tabR[4][0]=array(); - $this->tabR[4][1]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:'); - $this->tabR[4][2]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:'); - $this->tabR[4][3]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:'); - $this->tabR[4][4]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:'); - $this->tabR[4][5]=array('0:1.36','1.36:1.44','1.44:1.5','1.5:1.58','1.58:1.71','1.71:1.85','1.85:2','2:2.16','2.16:2.33','2.33:'); - $this->tabR[4][6]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:'); - $this->tabR[4][7]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:'); - $this->tabR[4][8]=array('0:1.1','1.1:1.2','1.2:1.3','1.3:1.4','1.4:1.6','1.6:1.8','1.8:2','2:2.2','2.2:2.5','2.5:'); - $this->tabR[4][9]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:'); - $this->tabR[4][10]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:'); - $this->tabR[4][11]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:'); - $this->tabR[4][12]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:'); - $this->tabR[4][13]=array('0:2.4','2.4:2.7','2.7:3','3:3.4','3.4:4.1','4.1:5','5:6','6:7.2','7.2:8.7','8.7:'); - $this->tabR[4][14]=array('0:2.4','2.4:2.7','2.7:3','3:3.4','3.4:4.1','4.1:5','5:6','6:7.2','7.2:8.7','8.7:'); - $this->tabR[4][15]=array('0:2.9','2.9:3.4','3.4:3.7','3.7:4.3','4.3:5.2','5.2:6.2','6.2:7.5','7.5:9.1','9.1:10.9','10.9:'); - $this->tabR[4][16]=array('0:1.1','1.1:1.2','1.2:1.3','1.3:1.4','1.4:1.6','1.6:1.8','1.8:2','2:2.2','2.2:2.5','2.5:'); - $this->tabR[4][17]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:'); - - $this->tabR[5][0]=array(); - $this->tabR[5][1]=array('-99:-40','-40:-34','-34:-30','-30:-24','-24:-16','-16:-8','-8:0','0:8.1','8.1:16.1','16.1:'); - $this->tabR[5][2]=array('-99:-40','-40:-34','-34:-30','-30:-24','-24:-16','-16:-8','-8:0','0:8.1','8.1:16.1','16.1:'); - $this->tabR[5][3]=array('-99:-40','-40:-34','-34:-30','-30:-24','-24:-16','-16:-8','-8:0','0:8.1','8.1:16.1','16.1:'); - $this->tabR[5][4]=array('-99:-16.7','-16.7:-12.7','-12.7:-10','-10:-6','-6:-0.7','-0.7:4.7','4.7:10','10:15.3','15.3:20.7','20.7:'); - $this->tabR[5][5]=array('-999:-420','-420:-384','-384:-360','-360:-324','-324:-276','-276:-228','-228:-180','-180:-132','-132:-84','-84:'); - $this->tabR[5][6]=array('-99:-40','-40:-34','-34:-30','-30:-24','-24:-16','-16:-8','-8:0','0:8.1','8.1:16.1','16.1:'); - $this->tabR[5][7]=array('-99:-30','-30:-24','-24:-20','-20:-14','-14:-6','-6:2','2:10','10:18','18:26','26:'); - $this->tabR[5][8]=array('-99:-41.7','-41.7:-34.7','-34.7:-30','-30:-23','-23:-13.7','-13.7:-4.3','-4.3:5','5:14.3','14.3:23.7','23.7:'); - $this->tabR[5][9]=array('-99:-16.7','-16.7:-12.7','-12.7:-10','-10:-6','-6:-0.7','-0.7:4.7','4.7:10','10:15.3','15.3:20.7','20.7:'); - $this->tabR[5][10]=array('-99:-5','-5:-2','-2:0','0:3','3:7','7:11','11:15','15:19','19:23','23:'); - $this->tabR[5][11]=array('-99:-6.7','-6.7:-2.7','-2.7:0','0:4','4:9.3','9.3:14.7','14.7:20','20:25.3','25.3:30.7','30.7:'); - $this->tabR[5][12]=array('-99:-6.7','-6.7:-2.7','-2.7:0','0:4','4:9.3','9.3:14.7','14.7:20','20:25.3','25.3:30.7','30.7:'); - $this->tabR[5][13]=array('-99:-6.7','-6.7:-2.7','-2.7:0','0:4','4:9.3','9.3:14.7','14.7:20','20:25.3','25.3:30.7','30.7:'); - $this->tabR[5][14]=array('-99:-6.7','-6.7:-2.7','-2.7:0','0:4','4:9.3','9.3:14.7','14.7:20','20:25.3','25.3:30.7','30.7:'); - $this->tabR[5][15]=array('-99:-38.3','-38.3:-36.3','-36.3:-35.0','-35:-33','-33.0:-30','-30:-27.7','-27.7:-25.0','-25.0:-22.3','-22.3:-19.7','-19.7:'); - $this->tabR[5][16]=array('-99:-41.7','-41.7:-34.7','-34.7:-30','-30:-23','-23:-13.7','-13.7:-4.3','-4.3:5','5:14.3','14.3:23.7','23.7:'); - $this->tabR[5][17]=array(':-58.3','-58.3:53.3','-53.3:-50','-50:-45','-45:-38.3','-38.3:-31.7','-31.7:-25','-25:-18.3','-18.3:-11.7','-11.7:'); - - $this->tabR[6][0]=array(); - $this->tabR[6][1]=array('0:6','6:6.6','6.6:7','7:7.6','7.6:8.4','8.4:9.2','9.2:10','10:10.8','10.8:11.6','11.6:'); - $this->tabR[6][2]=array('0:6','6:6.6','6.6:7','7:7.6','7.6:8.4','8.4:9.2','9.2:10','10:10.8','10.8:11.6','11.6:'); - $this->tabR[6][3]=array('0:1.5','1.5:2.1','2.1:2.5','2.5:3.1','3.1:3.9','3.9:4.7','4.7:5.5','5.5:6.3','6.3:7.1','7.1:'); - $this->tabR[6][4]=array('0:1.8','1.8:2.2','2.2:2.5','2.5:2.9','2.9:3.4','3.4:4','4:4.5','4.5:5','5:5.6','5.6:'); - $this->tabR[6][5]=array('0:6.7','6.7:7.5','7.5:8','8:8.8','8.8:9.9','9.9:10.9','10.9:12','12:13.1','13.1:14.1','14.1:'); - $this->tabR[6][6]=array('0:7.7','7.7:8.5','8.5:9','9:9.8','9.8:10.9','10.9:11.9','11.9:13','13:14.1','14.1:15.1','15.1:'); - $this->tabR[6][7]=array('0:3','3:3.6','3.6:4','4:4.6','4.6:5.4','5.4:6.2','6.2:7','7:7.8','7.8:8.6','8.6:'); - $this->tabR[6][8]=array('0:1.3','1.3:1.7','1.7:2','2:2.4','2.4:2.9','2.9:3.5','3.5:4','4:4.5','4.5:5.1','5.1:'); - $this->tabR[6][9]=array('0:1.8','1.8:2.2','2.2:2.5','2.5:2.9','2.9:3.4','3.4:4','4:4.5','4.5:5','5:5.6','5.6:'); - $this->tabR[6][10]=array('0:1.3','1.3:1.7','1.7:2','2:2.4','2.4:2.9','2.9:3.5','3.5:4','4:4.5','4.5:5.1','5.1:'); - $this->tabR[6][11]=array('0:8.3','8.3:9.3','9.3:10','10:11','11:12.3','12.3:13.7','13.7:15','15:16.3','16.3:17.7','17.7:'); - $this->tabR[6][12]=array('0:4.7','4.7:5.5','5.5:6','6:6.8','6.8:7.9','7.9:8.9','8.9:10','10:11.1','11.1:12.1','12.1:'); - $this->tabR[6][13]=array('0:3','3:4.8','4.8:6','6:7.8','7.8:10.2','10.2:12.6','12.6:15','15:17.4','17.4:19.8','19.8:'); - $this->tabR[6][14]=array('0:3','3:4.8','4.8:6','6:7.8','7.8:10.2','10.2:12.6','12.6:15','15:17.4','17.4:19.8','19.8:'); - $this->tabR[6][15]=array('0:2','2:2.3','2.3:2.5','2.5:2.8','2.8:3.2','3.2:3.6','3.6:4.0','4.0:4.4','4.4:4.8','4.8:'); - $this->tabR[6][16]=array('0:1.7','1.7:1.9','1.9:2','2:2.2','2.2:2.5','2.5:2.7','2.7:3','3:3.3','3.3:3.5','3.5:'); - $this->tabR[6][17]=array('0:4.7','4.7:5.5','5.5:6','6:6.8','6.8:7.9','7.9:8.9','8.9:10','10:11.1','11.1:12.1','12.1:'); - - ?> \ No newline at end of file diff --git a/framework/default/_includes/includes/rncs.class.php b/framework/default/_includes/includes/rncs.class.php deleted file mode 100644 index cc0c0025a..000000000 --- a/framework/default/_includes/includes/rncs.class.php +++ /dev/null @@ -1,9 +0,0 @@ - \ No newline at end of file diff --git a/framework/default/_includes/index.html b/framework/default/_includes/index.html deleted file mode 100644 index e69de29bb..000000000 diff --git a/framework/default/_includes/mail.php b/framework/default/_includes/mail.php deleted file mode 100644 index b41efcf2a..000000000 --- a/framework/default/_includes/mail.php +++ /dev/null @@ -1,195 +0,0 @@ -][] -//if attachment- subarray is [filename][binary data] -//if text- subarray is [type of text(HTML/PLAIN)][text string] - -//i.e. -//$partsarray[3.1][attachment][filename]=filename of attachment in part 3.1 -//$partsarray[3.1][attachment][binary]=binary data of attachment in part 3.1 -//$partsarray[2][text][type]=type of text in part 2 -//$partsarray[2][text][string]=decoded text string in part 2 -//$partsarray[not multipart][text][string]=decoded text string in message that isn't multipart - -function parsepart($p,$i){ - global $link,$msgid,$partsarray; - //where to write file attachments to: - $filestore = '[full/path/to/attachment/store/(chmod777)]'; - - //fetch part - $part=imap_fetchbody($link,$msgid,$i); - //if type is not text - if ($p->type!=0){ - //DECODE PART - //decode if base64 - if ($p->encoding==3)$part=base64_decode($part); - //decode if quoted printable - if ($p->encoding==4)$part=quoted_printable_decode($part); - //no need to decode binary or 8bit! - - //get filename of attachment if present - $filename=''; - // if there are any dparameters present in this part - if (count($p->dparameters)>0){ - foreach ($p->dparameters as $dparam){ - if ((strtoupper($dparam->attribute)=='NAME') ||(strtoupper($dparam->attribute)=='FILENAME')) $filename=$dparam->value; - } - } - //if no filename found - if ($filename==''){ - // if there are any parameters present in this part - if (count($p->parameters)>0){ - foreach ($p->parameters as $param){ - if ((strtoupper($param->attribute)=='NAME') ||(strtoupper($param->attribute)=='FILENAME')) $filename=$param->value; - } - } - } - //write to disk and set partsarray variable - if ($filename!=''){ - $partsarray[$i][attachment] = array('filename'=>$filename,'binary'=>$part); - $fp=fopen($filestore.$filename,"w+"); - fwrite($fp,$part); - fclose($fp); - } - //end if type!=0 - } - - //if part is text - else if($p->type==0){ - //decode text - //if QUOTED-PRINTABLE - if ($p->encoding==4) $part=quoted_printable_decode($part); - //if base 64 - if ($p->encoding==3) $part=base64_decode($part); - - //OPTIONAL PROCESSING e.g. nl2br for plain text - //if plain text - - if (strtoupper($p->subtype)=='PLAIN')1; - //if HTML - else if (strtoupper($p->subtype)=='HTML')1; - $partsarray[$i][text] = array('type'=>$p->subtype,'string'=>$part); - } - - //if subparts... recurse into function and parse them too! - if (count($p->parts)>0){ - foreach ($p->parts as $pno=>$parr){ - parsepart($parr,($i.'.'.($pno+1))); - } - } -return; -} - - -//require('./constantes.php'); -$imap_server='{imap.online.net}'; -$imap_account='buzuk@lenaour.org';//'scores-decisions.com'; -$imap_password='bzh4231*';//catsysyo92'; - -if (!$mbox = imap_open($imap_server, $imap_account, $imap_password)) die("Connexion IMAP impossible : ". imap_last_error()); - -$list = imap_list($mbox, $imap_server, "*"); -if(is_array($list)) { - reset($list); - foreach ($list as $val) { - echo imap_utf7_decode($val) . "
    \n"; - } -} else { - echo "imap_list a échoué : " . imap_last_error() . "\n"; -} - - echo "

    Entetes de mail dans INBOX

    \n"; - $headers = imap_headers ($mbox); - if ($headers == false) { - echo "Erreur !\n"; - } else { - while (list ($key,$val) = each ($headers)) { - echo $val."
    \n"; - } - } - -$check = imap_mailboxmsginfo($mbox); -if($check) { - echo "Date: " . $check->Date ."
    \n" ; - echo "Pilote: " . $check->Driver ."
    \n" ; - echo "Mailbox: " . $check->Mailbox ."
    \n" ; - echo "Messages: ". $check->Nmsgs ."
    \n" ; - echo "Récent: " . $check->Recent ."
    \n" ; - echo "Non lus: " . $check->Unread ."
    \n" ; - echo "Effacés: " . $check->Deleted ."
    \n" ; - echo "Taille: " . $check->Size ."
    \n" ; -} else { - echo "imap_check() a échoué: ".imap_last_error(). "
    \n"; -} - -$imap_obj = imap_check($mbox); -$imap_sorted = imap_sort($mbox, SORTARRIVAL, 0); - -$MN=$imap_obj->Nmsgs; -echo '
    Nombre de messages '.$MN.'
    '; - -$overview = imap_fetch_overview($mbox,"1:$MN",0); -$k=0; -$partsarray=array(); - while( list($key,$val) = each($overview)) - { - if (strpos($val->from, 'rapports@neoveille.fr')!==false) { - $unsorted[$k]=$val;//->uid; - /*$unsorted[$k]["subject"]=imap_utf8($val->subject); // Le sujet du message - $unsorted[$k]['from']=$val->from; - $unsorted[$k]['to']=$val->to; - $unsorted[$k]['date']=$val->date;// Date d'expédition - $unsorted[$k]['message_id - Identification du message - references - est une référence sur l'id de ce message - in_reply_to - est une réponse à cet identifiant de message - size - taille en octets - uid - UID du message dans la boîte aux lettres - msgno - numéro de séquence du message dans la boîte - recent - Ce message est récent - flagged - Ce message est marqué - answered - Ce message a donné lieu à une réponse - deleted - Ce message est marqué pour l'effacement - seen - Ce message est déjà lu - draft - Ce message est un brouillon - */ - $s=imap_fetchstructure($mbox,$val->message_id); - /*if (count($s->parts)>0){ - foreach ($s->parts as $partno=>$partarr){ - //parse parts of email - parsepart($partarr,$partno+1); - } - } - else { //for not multipart messages - //get body of message - //decode if quoted-printable - if ($s->encoding==4) $text=quoted_printable_decode($text); - //OPTIONAL PROCESSING - if (strtoupper($s->subtype)=='PLAIN') $text=$text; - if (strtoupper($s->subtype)=='HTML') $text=$text; - - $partsarray['not multipart'][text]=array('type'=>$s->subtype,'string'=>$text); - }*/ - $full_bodacc=imap_body($mbox,$val->msgno).'[FIN]'; - $k++; - } - - } - - //usort ($unsorted, create_function('$a,$b','setlocale(LC_ALL,$locale);return strcoll($a["subject"],$b["subject"]);')); - -$Bodacc=explode("-------------------------------------------------- \r\n--------------------------------------------------", $full_bodacc); -echo '
    ';
    -/*var_dump($imap_obj);
    -print_r($imap_obj);
    -print_r($imap_sorted);
    -print_r($unsorted);
    -print_r($partsarray);*/
    -print_r($Bodacc);
    -echo '
    '; - - -imap_close($mbox); -?> \ No newline at end of file diff --git a/framework/default/_includes/mysql.php b/framework/default/_includes/mysql.php deleted file mode 100644 index eaf5c9688..000000000 --- a/framework/default/_includes/mysql.php +++ /dev/null @@ -1,76 +0,0 @@ -$array_values) - $tmp[$key]=addslashes($array_values); - - $values = "'".implode(array_values($tmp), "','")."'"; # better - $values = str_replace("'NULL'", 'NULL', $values); - $query = 'INSERT INTO `'.$table.'` (`'.$fields.'`) VALUES ('.$values.');'; - - $res = mysql_query($query);// OR die(mysql_error()); - if ($res!==false) - { - if (mysql_insert_id()>0) - $res=mysql_insert_id(); - else - $res=true; - } - if ($debug) mysql_trace($query, $res); - - return $res; - //-- Example of usage - //$tToAdd = array('id'=>3, 'name'=>'Yo', 'salary' => 5000); - //insertIntoDB('myTable', $tToAdd) -} - -function mysql_update($table, $update, $where, $debug=false){ - $fields = array_keys($update); - $values = array_values($update); - $i=0; - $query='UPDATE `'.$table.'` SET '; - while($fields[$i]){ - if($i>0){$query.=', ';} - $query.=' `'.$fields[$i]."`='".addslashes($values[$i])."'"; - $i++; - } - $query = str_replace("'NULL'", 'NULL', $query); - $query.=' WHERE '.$where.' LIMIT 1;'; - if ($debug) mysql_trace($query, mysql_errno()); - mysql_query($query);// or die(mysql_error()); - return true; - - //Example - // mysql_update('myTable', $anarray, "type = 'main'") - -} - -function mysql_select($table, $fields, $where, $debug=false, $assoc=MYSQL_BOTH) { - $query="SELECT $fields FROM $table WHERE $where;"; - // if ($debug) mysql_trace($query, count($tab)); - $result=mysql_query($query) or die(mysql_error()); - $tab=array(); - while ($ligne = mysql_fetch_array($result, $assoc)) - $tab[]=$ligne; - - mysql_free_result($result); - if ($debug) mysql_trace($query, count($tab)); -// echo $query; - return $tab; -} - -?> diff --git a/framework/default/_includes/partenaires/insee.php b/framework/default/_includes/partenaires/insee.php deleted file mode 100644 index 7c44c12be..000000000 --- a/framework/default/_includes/partenaires/insee.php +++ /dev/null @@ -1,404 +0,0 @@ - - - Where is : - id siren.tm.fr : Fiche d'identite INSEE (établissement+entreprise) - lst siren.tm.fr : Liste des etablissements du SIREN (+infos entreprise) - rncs societe.com : Informations du RNCS - pj pagesjaunes.fr : Données des pages jaunes - coface cofacerating.fr : Coface - - Where is : - csv Fichier IN au format CSV (; ou ,) SIREN;NIC;REF - plat Fichier IN au format plat (blancs significatifs) SIREN_____NIC__REF______________ - - Where is : csv / todo - - Le fichier en entrée doit être au format et contenir le SIREN en première colonne. -*/ - -$insee=&new Insee(); -function getInfosSirene($sirenLu, $nicLu='') { - $tabRet=array(); - - $invalide=false; - if (valideSiren($sirenLu)==false) { - $libelleErreur='SIREN invalide'; - $invalide=true; - } - if ( $nicLu<>'' && valideSiren($sirenLu, $nicLu)==false) { - $libelleErreur='SIRET invalide'; - $invalide=true; - } - if ($invalide==true) - { - $siret=$sirenLu.$nicLu; - $str=date('d/m/Y à H:i:s') .';'. $libelleErreur .';'. $siret .';;;;;;;;;;;;;;;;;;;;;;;'; - $fp=fopen('/var/www/_includes/partenaires/insee/debug.csv', 'a'); - fwrite($fp, $str."\r\n"); - fclose($fp); - $num=$key+1; - flush(); - } else { // La demande est valide on va à l'INSEE - /** Paramètre de requête "option" à l'insee : - ** 1: Fiche du siège + Données entreprises - ** 2: Tous les établissements de l'entreprise - ** 3: Un établissement particulier - ** 4: Département - **/ - if ($nicLu<>'') $option=3; - else $option=1; - - $libelleErreur='Erreur SCRIPT Inconnue'; - $tabInfoEtab=array(); - $tabInfoEntrep=array(); - - /** Etape de connexion au site de l'INSEE pour simuler correctement un utilisateur WEB - **/ - $response1=getUrl(SITE_INSEE); - $response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/frame_interrogation.asp?ACTION=nouvelle&Niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'SIRENET_Script/Accueil/script_page_accueil.asp'); - - $response=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/frame_interrogation.asp?ACTION=nouvelle&Niveau=siren'); - $response=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/frame_interrogation.asp?ACTION=nouvelle&Niveau=siren'); - - $response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_haut.asp?grille=siren&action=nouvelle', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/frame_interrogation.asp?ACTION=nouvelle&Niveau=siren'); - $response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?grille=siren&action=nouvelle', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/frame_interrogation.asp?ACTION=nouvelle&Niveau=siren'); - $response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_bas.asp?grille=siren&action=nouvelle', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/frame_interrogation.asp?ACTION=nouvelle&Niveau=siren'); - - $response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_haut.asp?grille=siren&action=nouvelle', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?grille=siren&action=nouvelle'); - $response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_bas.asp?grille=siren&action=nouvelle', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?grille=siren&action=nouvelle'); - - if ($nicLu=='') //Faire une boucle de recherche de tous les établissement et y inclure le reste du traitement - { - // Requête d'interrogation - $postData=array( - 'siren'=>$sirenLu, - 'option'=>2, - 'nic'=>'', - 'dep'=>'', - 'listeDep'=>''); - - $response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false', $response1["header"]["Set-Cookie"], $postData, SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?grille=siren&action=nouvelle'); - $action='nouveau'; - $referer=SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false'; - $nbRepTot=$pageCour=$nbTotPage=$nbRepParPage=$numEtab=0; - $tabInfoEtab=array(); - - while(true) - { - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/reponse/question.asp?action='.$action, $response1["header"]["Set-Cookie"], '', $referer); - if ($responseQ['code']==302) - { - //$libelleErreur='Erreur INSEE inconnue 1'; - - // Siren Invalide ou autre erreur non répertoriée ! - $header=$responseQ['header']; - if (trim($header['Location'])=='/REPERTOIRE/Reponse/Frame_Reponse.asp?dest=erreur') - { - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=erreur', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false'); - $responseErreur=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Erreur_principal.asp', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=erreur',true); - $pos=strpos($responseErreur['body'], ''); - if ($pos>0){ - $posFin=strpos($responseErreur['body'], '', $pos+60); - $libelleErreur=trim(substr($responseErreur['body'], $pos+60, $posFin-($pos+60))); - } else - $libelleErreur='Erreur INSEE inconnue'; - } - - // On déroule les URLs d'appels liste des établissements - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=liste', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false'); - //sleep(1); - // Frames réponse niveau Etab - $responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=liste'); - $responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=liste'); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Reponse_haut.asp', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=liste'); - $responseListe=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Liste_principal.asp', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=liste', true); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Liste_bas.asp', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=liste'); - $responseListe=$responseListe['body']; - - $pos=strpos($responseListe, 'Nombre total de réponses : '."\r\n\t\t\t".''); - if ($pos>0) { - $posFin=strpos($responseListe, '', $pos+73); - $nbRepTot=trim(substr($responseListe, $pos+73, $posFin-($pos+73))); - } - $pos=strpos($responseListe, ' - Affichage de la page '."\r\n\t\t\t".''); - if ($pos>0) { - $posFin=strpos($responseListe, ' - ', $pos+75); - $strPages=trim(substr($responseListe, $pos+75, $posFin-($pos+75))); - $tabPages=explode(' / ', $strPages); - $pageCour=$tabPages[0]; - $nbTotPage=$tabPages[1]; - } - $pos=strpos($responseListe, ' - 
    '."\r\n\t\t\t".''); - if ($pos>0) { - $posFin=strpos($responseListe, '', $pos+60); - $nbRepParPage=trim(substr($responseListe, $pos+60, $posFin-($pos+60))); - } - - /* TODO = Récupérer les infos étab + entrep pour chaque ligne du tableau !!!* - */ - if ($libelleErreur=='Erreur SCRIPT Inconnue') - $libelleErreur=''; - for ($i=1;$i<11; $i++) - { - if ($numEtab==$nbRepTot) - break; // Il n'y a pas plus d'établissement à récupérer ! On sort... - - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/reponse/question.asp?action=detail&numtableau='.$i, $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Liste_principal.asp'); - if ($responseQ['code']==302) - { - // Siren Invalide ou autre erreur non répertoriée ! - $header=$responseQ['header']; - if (trim($header['Location'])=='/REPERTOIRE/Reponse/Frame_Reponse.asp?origine=liste&dest=detail&niveau=siege&numtableau='.$i) - { - // On déroule les URLs d'appels fiche siège - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege&numtableau='.$i, $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false'); - //sleep(1); - // Frames réponse niveau Etab - $responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege'); - $responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege'); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Reponse_haut.asp', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege'); - $responseEtab=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=siege&numtableau='.$i.'&origine=liste', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?origine=liste&dest=detail&niveau=siege&numtableau='.$i, true); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_bas.asp?niveau=siege&numtableau='.$i.'&origine=liste', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?origine=liste&dest=detail&niveau=siege&numtableau='.$i); - $responseEtab=$responseEtab['body']; - - // Récupération de la fiche entreprise INSEE - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail&origine=liste&numtableau='.$i, $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=siege&numtableau='.$i.'&origine=liste'); - $responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail&origine=liste&numtableau='.$i); - $responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?niveau=entreprise&dest=detail&origine=liste&numtableau='.$i); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Reponse_haut.asp', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail&origine=liste&numtableau='.$i); - $responseEntreprise=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=entreprise&numtableau='.$i.'&origine=liste', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/Frame_Reponse.asp?niveau=entreprise&dest=detail&origine=liste&numtableau='.$i, true); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_bas.asp?niveau=entreprise&numtableau='.$i.'&origine=liste', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/Frame_Reponse.asp?niveau=entreprise&dest=detail&origine=liste&numtableau='.$i); - $responseEntreprise=$responseEntreprise['body']; - $tabInfoEntrep=getDataEntreprise($responseEntreprise); - } - elseif (trim($header['Location'])=='/REPERTOIRE/Reponse/Frame_Reponse.asp?origine=liste&dest=detail&niveau=etablissement&numtableau='.$i) - { - // On déroule les URLs d'appels établissement - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement&numtableau='.$i, $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false'); - //sleep(1); - // Frames réponse niveau Etab - $responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement'); - $responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement'); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Reponse_haut.asp', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement'); - $responseEtab=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=etablissement&numtableau='.$i.'&origine=liste', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?origine=liste&dest=detail&niveau=etablissement&numtableau='.$i, true); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_bas.asp?niveau=etablissement&numtableau='.$i.'&origine=liste', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?origine=liste&dest=detail&niveau=etablissement&numtableau='.$i); - $responseEtab=$responseEtab['body']; - } - - $tabInfoEtab=getDataEtablissement($responseEtab); - $tabRet[]=array_merge($tabInfoEtab, $tabInfoEntrep); - - if ($libelleErreur<>'' && $tabInfoEtab['siret'] =='') $siret=$sirenLu . $nicLu; - else $siret=$tabInfoEtab['siret']; - - $str= date('d/m/Y à H:i:s') .';'. - $libelleErreur .';'. - // Siège - $siret .';'. - $tabInfoEtab['active'] .';'. - $tabInfoEtab['dateAbsActivite'] .';'. - $tabInfoEtab['typeEtablissement'] .';'. - $tabInfoEtab['dateMAJ'] .';'. - $tabInfoEtab['dateCreation'] .';'. - $tabInfoEtab['raisonSociale'] .';'. - $tabInfoEtab['Enseigne'] .';'. - $tabInfoEtab['NafCode'] .';'. - $tabInfoEtab['NafLib'] .';'. - $tabInfoEtab['AdresseLigne1'] .';'. - $tabInfoEtab['AdresseLigne2'] .';'. - $tabInfoEtab['AdresseLigne3'] .';'. - $tabInfoEtab['etatJuridique'] .';'. - $tabInfoEtab['dateEtatJuridique'] .';'. - // Entreprise - $tabInfoEntrep['dateCreationEntrep'] .';'. - $tabInfoEntrep['raisonSocialeEntrep'] .';'. - $tabInfoEntrep['sigle'] .';'. - $tabInfoEntrep['NafCodeEntrep'] .';'. - $tabInfoEntrep['NafLibEntrep'] .';'. - $tabInfoEntrep['FJCodeEntrep'] .';'. - $tabInfoEntrep['FJLibEntrep'] .';'. - $tabInfoEntrep['nbEtabActifs'] .';'; - - $fp=fopen('/var/www/_includes/partenaires/insee/debug.csv', 'a'); - fwrite($fp, $str."\r\n"); - fclose($fp); - - $numEtab++; - $num=$key+1; - $typeEtablissement=$tabInfoEtab['typeEtablissement']; -// echo "Question $num/$nbLignes : Demande=$sirenLu$nicLu Etablissement $numEtab/$nbRepTot $typeEtablissement=$siret $libelleErreur\r\n"; - flush(); - sleep(1); - - }//end for - }//end if - if ($pageCour==$nbTotPage) { - // On sort de la boucle de passage à la page de liste suivante car il n'y a plus d'autres pages - break; - } else { - $action='listeplus'; - $referer=SITE_INSEE .'REPERTOIRE/Reponse/Liste_principal.asp'; - } - } - } //Fin While -// die('Boucle'); - } /* Fin de la boucle option 'lst' */ else - { - // Requête d'interrogation - $postData=array('siren'=>$sirenLu, - 'option'=>$option, - 'nic'=>$nicLu, - 'dep'=>'', - 'listeDep'=>''); - - $response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false', $response1["header"]["Set-Cookie"], $postData, SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?grille=siren&action=nouvelle'); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/reponse/question.asp?action=nouveau', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false'); - if ($responseQ['code']==302) - { - //$libelleErreur='Erreur INSEE inconnue 1'; - - // Siren Invalide ou autre erreur non répertoriée ! - $header=$responseQ['header']; - if (trim($header['Location'])=='/REPERTOIRE/Reponse/Frame_Reponse.asp?dest=erreur') - { - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=erreur', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false'); - $responseErreur=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Erreur_principal.asp', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=erreur',true); - $pos=strpos($responseErreur['body'], ''); - if ($pos>0){ - $posFin=strpos($responseErreur['body'], '', $pos+60); - $libelleErreur=trim(substr($responseErreur['body'], $pos+60, $posFin-($pos+60))); - } else - $libelleErreur='Erreur INSEE inconnue'; - } - else - { if (trim($header['Location'])=='/REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege') - // L'établissement demandé est un siège ! - $option=1; - - if ($option==3) - { - // On déroule les URLs d'appels établissement - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false'); - //sleep(1); - // Frames réponse niveau Etab - $responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement'); - $responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement'); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Reponse_haut.asp', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement'); - $responseEtab=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=etablissement', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement', true); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_bas.asp?niveau=etablissement', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement'); - $responseEtab=$responseEtab['body']; - // On recherche si on est bien sur un fiche établissement - $pos=strpos($responseEtab, '
    Fiche Etablissement'); - if ($pos<1) - $libelleErreur='Erreur SCRIPT Fiche Etablissement non trouvée'; - else - $libelleErreur=''; - $responseSiege=$responseEtab; - } - else - { - // On déroule les URLs d'appels Sièges - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false'); - //sleep(1); - // Frames réponse niveau sièges - $responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege'); - $responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege'); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Reponse_haut.asp', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege'); - $responseSiege=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=siege', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege', true); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_bas.asp?niveau=siege', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege'); - $responseSiege=$responseSiege['body'];//strip_tags(html_entity_decode(), ''); - // On recherche si on est bien sur un fiche siège - $pos=strpos($responseSiege, '
    Fiche siège'); - if ($pos<1) - $libelleErreur='Erreur SCRIPT Fiche Siège non trouvée'; - else - $libelleErreur=''; - } - - // Niveau entreprise - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=siege'); - - $responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail'); - $responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=entreprise'); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Reponse_haut.asp', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail'); - $responseEntreprise=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=entreprise', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail', true); - $responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_bas.asp?niveau=entreprise', $response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail'); - $responseEntreprise=$responseEntreprise['body']; - $pos=strpos($responseEntreprise, ' - -
    Fiche Entreprise'); - if ($pos<1) { - $libelleErreur='Erreur SCRIPT Fiche Entreprise non trouvée'; - } - - /** Recherche des données établissement - **/ - $tabInfoEtab=getDataEtablissement($responseSiege); - - /** Recherche des données entreprise - **/ - $tabInfoEntrep=getDataEntreprise($responseEntreprise); - - } - } - - if ($libelleErreur<>'' && $tabInfoEtab['siret'] =='') $siret=$sirenLu . $nicLu; - else $siret=$tabInfoEtab['siret']; - - $str= date('d/m/Y à H:i:s') .';'. - $libelleErreur .';'. - // Siège - $siret .';'. - $tabInfoEtab['active'] .';'. - $tabInfoEtab['dateAbsActivite'] .';'. - $tabInfoEtab['typeEtablissement'] .';'. - $tabInfoEtab['dateMAJ'] .';'. - $tabInfoEtab['dateCreation'] .';'. - $tabInfoEtab['raisonSociale'] .';'. - $tabInfoEtab['Enseigne'] .';'. - $tabInfoEtab['NafCode'] .';'. - $tabInfoEtab['NafLib'] .';'. - $tabInfoEtab['AdresseLigne1'] .';'. - $tabInfoEtab['AdresseLigne2'] .';'. - $tabInfoEtab['AdresseLigne3'] .';'. - $tabInfoEtab['etatJuridique'] .';'. - $tabInfoEtab['dateEtatJuridique'] .';'. - // Entreprise - $tabInfoEntrep['dateCreationEntrep'] .';'. - $tabInfoEntrep['raisonSocialeEntrep'] .';'. - $tabInfoEntrep['sigle'] .';'. - $tabInfoEntrep['NafCodeEntrep'] .';'. - $tabInfoEntrep['NafLibEntrep'] .';'. - $tabInfoEntrep['FJCodeEntrep'] .';'. - $tabInfoEntrep['FJLibEntrep'] .';'. - $tabInfoEntrep['nbEtabActifs'] .';'. - //echo $str.'
    '; - - $fp=fopen('/var/www/_includes/partenaires/insee/debug.csv', 'a'); - fwrite($fp, $str."\r\n"); - fclose($fp); - - $num=$key+1; - $typeEtablissement=$tabInfoEtab['typeEtablissement']; -// echo "Ligne $num/$nbLignes : Question=$sirenLu$nicLu Retour $typeEtablissement=$siret $libelleErreur (PJ=$nbPJ)\r\n"; - //echo $str."
    "; - - flush(); - $tabRet=array(0=>array_merge($tabInfoEntrep, $tabInfoEtab)); - } - } - - return $tabRet; -} - ?> \ No newline at end of file diff --git a/framework/default/_includes/partenaires/insee/20061103-014010-0.08203800-avis-situation-sirene.insee.fr_REPERTOIRE_Reponse_Liste_principal.asp.html b/framework/default/_includes/partenaires/insee/20061103-014010-0.08203800-avis-situation-sirene.insee.fr_REPERTOIRE_Reponse_Liste_principal.asp.html deleted file mode 100644 index b8f482d09..000000000 --- a/framework/default/_includes/partenaires/insee/20061103-014010-0.08203800-avis-situation-sirene.insee.fr_REPERTOIRE_Reponse_Liste_principal.asp.html +++ /dev/null @@ -1,54 +0,0 @@ -http://avis-situation-sirene.insee.fr/REPERTOIRE/Reponse/Liste_principal.asp -HTTP/1.1 200 OK -Server: Microsoft-IIS/5.0 -Date: Fri, 03 Nov 2006 00:40:09 GMT -Content-Length: 1173 -Content-Type: text/html -Expires: Thu, 02 Nov 2006 00:40:09 GMT -Cache-control: private - - - - - -Le répertoire SIRENE - - - - - - - - - - - - -
    -  Nombre total de réponses :  - -  - Affichage de la page  -  /  -  - -  réponses affichées dans cette page  -
    - - - - - - -
      - Page précédente/suivante :Page précédente  Page suivante -
    - - - - - - - - - diff --git a/framework/default/_includes/phonex.php b/framework/default/_includes/phonex.php deleted file mode 100644 index 921abdde3..000000000 --- a/framework/default/_includes/phonex.php +++ /dev/null @@ -1,174 +0,0 @@ - $voy) - $posMot1=strpos($strIn, $mot1); - while ($posMot1!==false) { - $lettreAV=$strIn[$posMot1-1]; - $lettreAP=$strIn[$posMot1+strlen($mot1)]; - //echo "Lettre AV=$lettreAV
    "; - //echo "Lettre AP=$lettreAP
    "; - if ( ( $rule==0 && !in_array($lettreAV, $Voyelle) ) || - ( $rule==1 && !in_array($lettreAP, $Voyelle) ) || - ( $rule==2 && !in_array($lettreAV, $Voyelle) && !in_array($lettreAP, $Voyelle) )) - $strIn=substr($strIn,0,$posMot1) . $mot2 . substr($strIn,$posMot1+strlen($mot1),strlen($strIn)); - //echo "Le Mot devient : $strIn
    "; - $posMot1=@strpos($strIn, $mot1, $posMot1+strlen($mot1)); - } - return $strIn; - } - //echo "Erreur : $mot2 contient $mot1 !
    "; - return $strIn; - } - - /** Retourne le phonex d'un mot - **/ - function phonex($strIn) { - if ($strIn=='') return 0.0; - $tabSonAIA=array('aina', 'eina', 'aima', 'eima'); - $tabSonAIE=array('ainr', 'eine', 'aime', 'eime'); - $tabSonAII=array('aini', 'eini', 'aimi', 'eimi'); - $tabSonAIO=array('aino', 'eino', 'aimo', 'eimo'); - $tabSonAIU=array('ainu', 'einu', 'aimu', 'eimu'); - $tabCarPhon=array('1', '2', '3', '4', '5', 'e', 'f', 'g', 'h', 'i', 'k', 'l', 'n', 'o', 'r', 's', 't', 'u', 'w', 'x', 'y', 'z'); - - /** On traite tout en minuscule **/ - $strIn=strtolower($strIn); - /** On remplace les 'Y' par des 'I' **/ - $strIn=str_replace('y', 'i', $strIn); - /** On supprime les accents **/ - $strIn=trimAccent($strIn); - /** On retire les 'H' muets sauf ceux précédés par 'C' ou 'S' **/ - $strIn = preg_replace ('/(?4; $i++) { - $strIn=str_replace($tabSonAIA[$i], 'yna', $strIn); - $strIn=str_replace($tabSonAIE[$i], 'yne', $strIn); - $strIn=str_replace($tabSonAII[$i], 'yni', $strIn); - $strIn=str_replace($tabSonAIO[$i], 'yno', $strIn); - $strIn=str_replace($tabSonAIU[$i], 'ynu', $strIn); - } - /** Remplacement des groupes de 3 lettres **/ - $strIn=str_replace('eau', 'o', $strIn); - $strIn=str_replace('oua', '2', $strIn); - $strIn=str_replace('ein', '4', $strIn); - $strIn=str_replace('ain', '4', $strIn); - /** Remplacement du son 'é' **/ - $strIn=str_replace('ai', 'y', $strIn); - $strIn=str_replace('ei', 'y', $strIn); - $strIn=str_replace('er', 'yr', $strIn); - $strIn=str_replace('ess', 'yss', $strIn); - $strIn=str_replace('et', 'yt', $strIn); - $strIn=str_replace('ez', 'yz', $strIn); - /** Remplacement des groupes de 2 lettres sauf si voyelle ou son (1 à 4) AVANT **/ - $strIn=str_replace_except_voy('an', '1', $strIn, BEFORE); - $strIn=str_replace_except_voy('am', '1', $strIn, BEFORE); - $strIn=str_replace_except_voy('en', '1', $strIn, BEFORE); - $strIn=str_replace_except_voy('em', '1', $strIn, BEFORE); - $strIn=str_replace_except_voy('in', '4', $strIn, BEFORE); - /** Remplacement du son 'SCH' **/ - $strIn=str_replace('sch', '5', $strIn); - /** Remplacement du 'S' sauf si voyelle ou son (1 à 4) avant ou après **/ - $strIn=str_replace_except_voy('in', '4', $strIn, BOTH); - /** Remplacement de groupe de 2 lettres diverses **/ - $strIn=str_replace('oe', 'e', $strIn); - $strIn=str_replace('eu', 'e', $strIn); - $strIn=str_replace('au', 'o', $strIn); - $strIn=str_replace('oi', '2', $strIn); - $strIn=str_replace('oy', '2', $strIn); - $strIn=str_replace('ou', '3', $strIn); - $strIn=str_replace('ch', '5', $strIn); - $strIn=str_replace('sh', '5', $strIn); - $strIn=str_replace('ss', 's', $strIn); - $strIn=str_replace('sc', 's', $strIn); - /** Remplacement du 'C' par 'S' s'il est suivi d'un 'E' ou d'un 'I' **/ - $strIn=str_replace('ce', 'se', $strIn); - $strIn=str_replace('ci', 'si', $strIn); - /** Remplacement divers **/ - $strIn=str_replace('c', 'k', $strIn); - $strIn=str_replace('q', 'k', $strIn); - $strIn=str_replace('qu', 'k', $strIn); - - $strIn=str_replace('ga', 'ka', $strIn); - $strIn=str_replace('go', 'ko', $strIn); - $strIn=str_replace('gu', 'ku', $strIn); - $strIn=str_replace('gy', 'ky', $strIn); - $strIn=str_replace('g2', 'k2', $strIn); - $strIn=str_replace('g1', 'k1', $strIn); - $strIn=str_replace('g3', 'k3', $strIn); - - $strIn=str_replace('a', 'o', $strIn); - $strIn=str_replace('d', 't', $strIn); - $strIn=str_replace('p', 't', $strIn); - $strIn=str_replace('j', 'g', $strIn); - $strIn=str_replace('b', 'f', $strIn); - $strIn=str_replace('v', 'f', $strIn); - $strIn=str_replace('m', 'n', $strIn); - - /** Supression des lettres dupliquées **/ - $let=$strIn[0]; - $strIn2=$let; - for ($i=1; $i0; $j--) - $result+=$sout[$j]*pow($j-1,10); - - return $result; - } - - ?> \ No newline at end of file diff --git a/framework/default/_includes/sin2004.csv b/framework/default/_includes/sin2004.csv deleted file mode 100644 index 2a3f92bf9..000000000 --- a/framework/default/_includes/sin2004.csv +++ /dev/null @@ -1,527 +0,0 @@ -codeZone;valeur;NBEntreprises;NbProCol;Pourcentage;Risque;Points -GLOBALE;TOTAL;6447249;43572;0.006758231;0.006758231;0 -insAPEN31;DB;18973;612;0.032256364;4.729218896;-3.729218896 -insAPEN31;FA;367665;9644;0.0262304;3.845731092;-2.845731092 -insAPEN31;DJ;32346;786;0.024299759;3.562673018;-2.562673018 -insAPEN31;DM;5682;132;0.023231257;3.406016148;-2.406016148 -insAPEN31;DC;2430;55;0.022633745;3.318412852;-2.318412852 -insAPEN31;DE;36701;740;0.020162938;2.956159228;-1.956159228 -insAPEN31;DH;5546;111;0.020014425;2.934385137;-1.934385137 -insAPEN31;DD;11292;225;0.019925611;2.92136384;-1.92136384 -insAPEN31;DK;17243;334;0.019370179;2.839930026;-1.839930026 -insAPEN31;HA;242687;4586;0.018896768;2.770521585;-1.770521585 -insAPEN31;IA;111075;1916;0.017249606;2.529025356;-1.529025356 -insAPEN31;DL;20515;323;0.015744577;2.308367769;-1.308367769 -insAPEN31;GA;693458;10740;0.0154876;2.270691423;-1.270691423 -insAPEN31;DI;9391;138;0.014694921;2.154473946;-1.154473946 -insAPEN31;DA;69613;995;0.014293307;2.095591997;-1.095591997 -insAPEN31;DG;4389;61;0.013898382;2.037690661;-1.037690661 -insAPEN31;DN;33557;435;0.012963018;1.900553633;-0.900553633 -insAPEN31;ZZ;16576;119;0.007179054;1.052546337;-0.052546337 -insAPEN31;CB;2833;17;0.006000706;0.879784584;0.120215416 -insAPEN31;GG;9721;52;0.005349244;0.784271442;0.215728558 -insAPEN31;MA;70612;373;0.005282388;0.774469502;0.225530498 -insAPEN31;FF;4750;25;0.005263158;0.77165007;0.22834993 -insAPEN31;CA;195;1;0.005128205;0.751864171;0.248135829 -insAPEN31;HH;3757;16;0.004258717;0.62438547;0.37561453 -insAPEN31;JA;72234;289;0.004000886;0.586583954;0.413416046 -insAPEN31;OA;611504;2075;0.003393273;0.497499673;0.502500327 -insAPEN31;KA;2657556;7102;0.00267238;0.391807048;0.608192952 -insAPEN31;BA;14187;37;0.002608021;0.382371184;0.617628816 -insAPEN31;OO;2450;6;0.00244898;0.359053502;0.640946498 -insAPEN31;II;1476;3;0.00203252;0.297994946;0.702005054 -insAPEN31;KK;22395;40;0.001786113;0.261868298;0.738131702 -insAPEN31;AA;777002;1339;0.00172329;0.252657643;0.747342357 -insAPEN31;EA;5687;7;0.001230877;0.180463266;0.819536734 -insAPEN31;NA;432746;238;0.000549976;0.080633943;0.919366057 -insAPEN31;BB;81;;0;0;1 -insAPEN31;DF;149;;0;0;1 -insAPEN31;EE;79;;0;0;1 -insAPEN31;JJ;596;;0;0;1 -insAPEN31;LA;56364;;0;0;1 -insAPEN31;LL;79;;0;0;1 -insAPEN31;MM;343;;0;0;1 -insAPEN31;NN;772;;0;0;1 -insAPEN31;PA;32;;0;0;1 -insAPEN31;QA;510;;0;0;1 -insMONOACT;1;57315;535;0.00933438;1.368546272;-0.368546272 -insMONOACT;2;6175850;41794;0.006767328;0.992181671;0.007818329 -insMONOACT;0;214084;1243;0.005806132;0.851257436;0.148742564 -insSAISONAT;0;6422146;43477;0.006769855;0.99255229;0.00744771 -insSAISONAT;1;25103;95;0.003784408;0.554845387;0.445154613 -insDEPET;93;99100;1332;0.013440969;1.988829034;-0.988829034 -insDEPET;77;87496;937;0.010709061;1.58459497;-0.58459497 -insDEPET;94;94293;975;0.01034011;1.530002158;-0.530002158 -insDEPET;57;67886;694;0.010223021;1.51267675;-0.51267675 -insDEPET;95;72827;735;0.010092411;1.493350666;-0.493350666 -insDEPET;13;198603;1935;0.009743055;1.441657335;-0.441657335 -insDEPET;59;165430;1504;0.009091459;1.345242092;-0.345242092 -insDEPET;91;75252;675;0.008969861;1.327249612;-0.327249612 -insDEPET;06;158986;1366;0.008591951;1.271331178;-0.271331178 -insDEPET;62;87566;730;0.008336569;1.23354282;-0.23354282 -insDEPET;54;50761;411;0.008096767;1.198059904;-0.198059904 -insDEPET;90;9792;79;0.00806781;1.193775242;-0.193775242 -insDEPET;42;68973;550;0.007974135;1.179914273;-0.179914273 -insDEPET;60;52888;420;0.00794131;1.175057253;-0.175057253 -insDEPET;92;147353;1169;0.00793333;1.173876504;-0.173876504 -insDEPET;68;61653;481;0.007801729;1.154403789;-0.154403789 -insDEPET;72;43306;332;0.007666374;1.134375644;-0.134375644 -insDEPET;31;116009;868;0.007482178;1.107120578;-0.107120578 -insDEPET;02;39818;295;0.00740871;1.096249618;-0.096249618 -insDEPET;78;101841;754;0.007403698;1.095508047;-0.095508047 -insDEPET;67;93946;692;0.007365934;1.089920151;-0.089920151 -insDEPET;28;34301;252;0.007346725;1.087077834;-0.087077834 -insDEPET;33;152528;1107;0.007257684;1.07390268;-0.07390268 -insDEPET;84;67613;488;0.007217547;1.067963714;-0.067963714 -insDEPET;83;126540;909;0.007183499;1.062925765;-0.062925765 -insDEPET;66;58946;419;0.007108201;1.051784011;-0.051784011 -insDEPET;18;27790;193;0.006944944;1.027627324;-0.027627324 -insDEPET;69;174961;1214;0.006938689;1.026701782;-0.026701782 -insDEPET;88;34443;238;0.006909967;1.022451853;-0.022451853 -insDEPET;30;76395;525;0.006872177;1.0168602;-0.0168602 -insDEPET;08;23202;157;0.006766658;1.001246731;-0.001246731 -insDEPET;87;34338;231;0.006727241;0.995414275;0.004585725 -insDEPET;76;86118;579;0.006723333;0.994836039;0.005163961 -insDEPET;26;53631;358;0.006675244;0.987720376;0.012279624 -insDEPET;34;133650;876;0.006554433;0.969844315;0.030155685 -insDEPET;2A;17005;111;0.006527492;0.965857872;0.034142128 -insDEPET;25;44175;286;0.00647425;0.95797981;0.04202019 -insDEPET;38;119307;770;0.006453938;0.954974293;0.045025707 -insDEPET;41;28978;186;0.006418662;0.949754625;0.050245375 -insDEPET;45;49561;318;0.006416335;0.949410303;0.050589697 -insDEPET;2B;19519;124;0.006352784;0.940006815;0.059993185 -insDEPET;70;21399;132;0.006168513;0.912740526;0.087259474 -insDEPET;37;49723;305;0.006133982;0.907631159;0.092368841 -insDEPET;55;17276;105;0.006077796;0.899317376;0.100682624 -insDEPET;27;45311;273;0.006025027;0.891509307;0.108490693 -insDEPET;39;26947;162;0.006011801;0.889552272;0.110447728 -insDEPET;80;42871;257;0.005994728;0.887026083;0.112973917 -insDEPET;47;40592;242;0.005961766;0.882148698;0.117851302 -insDEPET;82;27230;159;0.005839148;0.864005216;0.135994784 -insDEPET;36;23734;137;0.00577231;0.854115317;0.145884683 -insDEPET;63;65589;373;0.005686929;0.841481754;0.158518246 -insDEPET;89;33216;188;0.005659923;0.837485697;0.162514303 -insDEPET;52;16860;94;0.005575326;0.824968117;0.175031883 -insDEPET;24;51134;284;0.005554034;0.821817631;0.178182369 -insDEPET;58;22345;123;0.005504587;0.814501022;0.185498978 -insDEPET;17;75422;415;0.005502373;0.814173445;0.185826555 -insDEPET;71;55680;306;0.00549569;0.813184479;0.186815521 -insDEPET;03;34938;192;0.005495449;0.813148882;0.186851118 -insDEPET;21;53379;290;0.005432848;0.803885963;0.196114037 -insDEPET;49;68055;368;0.005407391;0.800119144;0.199880856 -insDEPET;11;55513;300;0.00540414;0.799638025;0.200361975 -insDEPET;86;38412;205;0.005336874;0.789684879;0.210315121 -insDEPET;51;65810;346;0.00525756;0.777948932;0.222051068 -insDEPET;56;72609;378;0.005205966;0.770314771;0.229685229 -insDEPET;07;33636;169;0.005024379;0.74344568;0.25655432 -insDEPET;44;106703;532;0.004985802;0.73773754;0.26226246 -insDEPET;01;51685;255;0.004933733;0.730033082;0.269966918 -insDEPET;10;30663;149;0.004859277;0.71901592;0.28098408 -insDEPET;14;64428;310;0.004811573;0.711957263;0.288042737 -insDEPET;19;30160;144;0.004774536;0.706477014;0.293522986 -insDEPET;16;39889;190;0.004763218;0.704802333;0.295197667 -insDEPET;73;71454;339;0.004744311;0.702004723;0.297995277 -insDEPET;81;40986;194;0.004733324;0.700378935;0.299621065 -insDEPET;35;90680;422;0.004653727;0.688601272;0.311398728 -insDEPET;29;86330;400;0.004633384;0.685591038;0.314408962 -insDEPET;61;32758;149;0.004548507;0.673032089;0.326967911 -insDEPET;74;93707;423;0.00451407;0.667936558;0.332063442 -insDEPET;09;17626;79;0.004482015;0.663193417;0.336806583 -insDEPET;79;37656;162;0.004302103;0.636572261;0.363427739 -insDEPET;64;83756;359;0.00428626;0.634227986;0.365772014 -insDEPET;23;16174;68;0.004204278;0.622097355;0.377902645 -insDEPET;50;52775;219;0.004149692;0.614020335;0.385979665 -insDEPET;04;22787;90;0.00394962;0.58441619;0.41558381 -insDEPET;40;49541;192;0.003875578;0.573460278;0.426539722 -insDEPET;43;27370;105;0.003836317;0.567650968;0.432349032 -insDEPET;22;64491;244;0.003783474;0.559831842;0.440168158 -insDEPET;85;64417;243;0.003772296;0.558177928;0.441822072 -insDEPET;46;26030;95;0.003649635;0.54002805;0.45997195 -insDEPET;53;32932;120;0.003643872;0.539175339;0.460824661 -insDEPET;99;40894;134;0.003276764;0.484855233;0.515144767 -insDEPET;65;34146;104;0.003045745;0.450671801;0.549328199 -insDEPET;32;32543;96;0.002949943;0.436496261;0.563503739 -insDEPET;15;22199;62;0.002792919;0.413261701;0.586738299 -insDEPET;05;25212;70;0.002776456;0.410825718;0.589174282 -insDEPET;48;12747;34;0.002667294;0.394673359;0.605326641 -insDEPET;98;775;2;0.002580645;0.381852092;0.618147908 -insDEPET;12;41281;104;0.002519319;0.372777775;0.627222225 -insDEPCOMEN;75120;23391;422;0.018041127;2.669503799;-1.669503799 -insDEPCOMEN;75110;28336;491;0.017327781;2.56395164;-1.56395164 -insDEPCOMEN;75102;19124;292;0.015268772;2.259284889;-1.259284889 -insDEPCOMEN;75103;14002;144;0.010284245;1.521735947;-0.521735947 -insDEPCOMEN;75112;23538;238;0.010111309;1.496147047;-0.496147047 -insDEPCOMEN;75119;18558;185;0.009968747;1.475052368;-0.475052368 -insDEPCOMEN;75109;30187;288;0.009540531;1.411690247;-0.411690247 -insDEPCOMEN;75111;32950;296;0.008983308;1.329239301;-0.329239301 -insDEPCOMEN;75101;16952;132;0.007786692;1.15217877;-0.15217877 -insDEPCOMEN;75118;26179;197;0.007525116;1.113473932;-0.113473932 -insDEPCOMEN;75114;21520;154;0.007156134;1.058876561;-0.058876561 -insDEPCOMEN;75108;66310;446;0.006725984;0.995228288;0.004771712 -insDEPCOMEN;75117;41679;278;0.006670026;0.986948262;0.013051738 -insDEPCOMEN;75115;36833;223;0.006054353;0.895848666;0.104151334 -insDEPCOMEN;75113;19497;113;0.005795763;0.857585705;0.142414295 -insDEPCOMEN;75104;10380;51;0.004913295;0.72700886;0.27299114 -insDEPCOMEN;75105;14528;71;0.004887115;0.723135028;0.276864972 -insDEPCOMEN;75116;48424;220;0.004543202;0.672247044;0.327752956 -insDEPCOMEN;75106;16345;72;0.004405017;0.651800145;0.348199855 -insDEPCOMEN;75107;18645;59;0.003164387;0.468227056;0.531772944 -insDEPCOMEN,3;974;61141;402;0.006574966;0.972882512;0.027117488 -insDEPCOMEN,3;972;42850;261;0.006091015;0.901273418;0.098726582 -insDEPCOMEN,3;971;63190;307;0.004858364;0.718880828;0.281119172 -insDEPCOMEN,3;973;13285;63;0.00474219;0.701690944;0.298309056 -insCJ,2;54;1046180;26431;0.025264295;3.738299821;-2.738299821 -insCJ,2;55;116455;1676;0.014391825;2.129525393;-1.129525393 -insCJ,2;13;332350;4569;0.013747555;2.034194255;-1.034194255 -insCJ,2;56;6079;81;0.01332456;1.971604606;-0.971604606 -insCJ,2;57;68076;864;0.012691698;1.8779614;-0.8779614 -insCJ,2;12;437093;5064;0.011585635;1.714299878;-0.714299878 -insCJ,2;11;197912;2096;0.010590566;1.567061711;-0.567061711 -insCJ,2;82;5102;51;0.00999608;1.479097048;-0.479097048 -insCJ,2;31;11814;115;0.009734214;1.440349288;-0.440349288 -insCJ,2;53;1525;13;0.00852459;1.261364073;-0.261364073 -insCJ,2;52;38818;186;0.004791592;0.709000819;0.290999181 -insCJ,2;51;517;1;0.001934236;0.286204465;0.713795535 -insCJ,2;92;417094;658;0.001577582;0.233431198;0.766568802 -insCJ,2;62;10141;12;0.001183315;0.175092447;0.824907553 -insCJ,2;17;40919;39;0.000953102;0.141028389;0.858971611 -insCJ,2;16;558658;471;0.000843092;0.124750367;0.875249633 -insCJ,2;65;1134849;828;0.000729612;0.107959088;0.892040912 -insCJ,2;32;26976;19;0.00070433;0.104218063;0.895781937 -insCJ,2;29;24080;14;0.000581395;0.086027738;0.913972262 -insCJ,2;84;8634;5;0.000579106;0.085688967;0.914311033 -insCJ,2;63;20101;6;0.000298493;0.044167268;0.955832732 -insCJ,2;19;511880;129;0.000252012;0.037289666;0.962710334 -insCJ,2;15;577704;133;0.000230222;0.034065378;0.965934622 -insCJ,2;18;497265;107;0.000215177;0.03183925;0.96816075 -insCJ,2;22;29402;3;0.000102034;0.015097719;0.984902281 -insCJ,2;21;24477;1;4.08547E-05;0.006045173;0.993954827 -insCJ,2;10;1;0;0;0;1 -insCJ,2;14;6117;0;0;0;1 -insCJ,2;23;7434;0;0;0;1 -insCJ,2;27;527;0;0;0;1 -insCJ,2;41;874;0;0;0;1 -insCJ,2;61;17;0;0;0;1 -insCJ,2;64;178;0;0;0;1 -insCJ,2;69;2;0;0;0;1 -insCJ,2;71;2984;0;0;0;1 -insCJ,2;72;36821;0;0;0;1 -insCJ,2;73;91862;0;0;0;1 -insCJ,2;74;2566;0;0;0;1 -insCJ,2;81;1202;0;0;0;1 -insCJ,2;83;4849;0;0;0;1 -insCJ,2;91;145682;0;0;0;1 -insCJ,2;93;461;0;0;0;1 -insCJ,2;99;1571;0;0;0;1 -ageDirigeant;0;4092989;11244;0.002747137;0.406487512;0.593512488 -ageDirigeant;1;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;2;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;3;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;4;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;5;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;6;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;7;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;8;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;9;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;10;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;11;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;12;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;13;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;14;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;15;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;16;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;17;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;18;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;19;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;20;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;21;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;22;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;23;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;24;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;25;7915;339;0.042830069;6.337467242;-5.337467242 -ageDirigeant;26;51311;1744;0.033988813;5.029246825;-4.029246825 -ageDirigeant;27;51311;1744;0.033988813;5.029246825;-4.029246825 -ageDirigeant;28;51311;1744;0.033988813;5.029246825;-4.029246825 -ageDirigeant;29;51311;1744;0.033988813;5.029246825;-4.029246825 -ageDirigeant;30;132700;3421;0.025779955;3.814600838;-2.814600838 -ageDirigeant;31;132700;3421;0.025779955;3.814600838;-2.814600838 -ageDirigeant;32;132700;3421;0.025779955;3.814600838;-2.814600838 -ageDirigeant;33;132700;3421;0.025779955;3.814600838;-2.814600838 -ageDirigeant;34;132700;3421;0.025779955;3.814600838;-2.814600838 -ageDirigeant;35;246272;4538;0.01842678;2.726568435;-1.726568435 -ageDirigeant;36;246272;4538;0.01842678;2.726568435;-1.726568435 -ageDirigeant;37;246272;4538;0.01842678;2.726568435;-1.726568435 -ageDirigeant;38;246272;4538;0.01842678;2.726568435;-1.726568435 -ageDirigeant;39;246272;4538;0.01842678;2.726568435;-1.726568435 -ageDirigeant;40;339245;5421;0.015979602;2.364465057;-1.364465057 -ageDirigeant;41;339245;5421;0.015979602;2.364465057;-1.364465057 -ageDirigeant;42;339245;5421;0.015979602;2.364465057;-1.364465057 -ageDirigeant;43;339245;5421;0.015979602;2.364465057;-1.364465057 -ageDirigeant;44;339245;5421;0.015979602;2.364465057;-1.364465057 -ageDirigeant;45;367968;5217;0.014177863;2.097865945;-1.097865945 -ageDirigeant;46;367968;5217;0.014177863;2.097865945;-1.097865945 -ageDirigeant;47;367968;5217;0.014177863;2.097865945;-1.097865945 -ageDirigeant;48;367968;5217;0.014177863;2.097865945;-1.097865945 -ageDirigeant;49;367968;5217;0.014177863;2.097865945;-1.097865945 -ageDirigeant;50;375026;4591;0.012241818;1.811393744;-0.811393744 -ageDirigeant;51;375026;4591;0.012241818;1.811393744;-0.811393744 -ageDirigeant;52;375026;4591;0.012241818;1.811393744;-0.811393744 -ageDirigeant;53;375026;4591;0.012241818;1.811393744;-0.811393744 -ageDirigeant;54;375026;4591;0.012241818;1.811393744;-0.811393744 -ageDirigeant;55;377653;3778;0.010003892;1.480253045;-0.480253045 -ageDirigeant;56;377653;3778;0.010003892;1.480253045;-0.480253045 -ageDirigeant;57;377653;3778;0.010003892;1.480253045;-0.480253045 -ageDirigeant;58;377653;3778;0.010003892;1.480253045;-0.480253045 -ageDirigeant;59;377653;3778;0.010003892;1.480253045;-0.480253045 -ageDirigeant;60;232451;2003;0.00861687;1.275018479;-0.275018479 -ageDirigeant;61;232451;2003;0.00861687;1.275018479;-0.275018479 -ageDirigeant;62;232451;2003;0.00861687;1.275018479;-0.275018479 -ageDirigeant;63;232451;2003;0.00861687;1.275018479;-0.275018479 -ageDirigeant;64;232451;2003;0.00861687;1.275018479;-0.275018479 -ageDirigeant;65;100941;680;0.006736609;0.996800526;0.003199474 -ageDirigeant;66;100941;680;0.006736609;0.996800526;0.003199474 -ageDirigeant;67;100941;680;0.006736609;0.996800526;0.003199474 -ageDirigeant;68;100941;680;0.006736609;0.996800526;0.003199474 -ageDirigeant;69;100941;680;0.006736609;0.996800526;0.003199474 -ageDirigeant;70;55612;320;0.005754154;0.85142895;0.14857105 -ageDirigeant;71;55612;320;0.005754154;0.85142895;0.14857105 -ageDirigeant;72;55612;320;0.005754154;0.85142895;0.14857105 -ageDirigeant;73;55612;320;0.005754154;0.85142895;0.14857105 -ageDirigeant;74;55612;320;0.005754154;0.85142895;0.14857105 -ageDirigeant;75;33744;164;0.004860123;0.719141306;0.280858694 -ageDirigeant;76;33744;164;0.004860123;0.719141306;0.280858694 -ageDirigeant;77;33744;164;0.004860123;0.719141306;0.280858694 -ageDirigeant;78;33744;164;0.004860123;0.719141306;0.280858694 -ageDirigeant;79;33744;164;0.004860123;0.719141306;0.280858694 -ageDirigeant;80;19900;73;0.003668342;0.542796117;0.457203883 -ageDirigeant;81;19900;73;0.003668342;0.542796117;0.457203883 -ageDirigeant;82;19900;73;0.003668342;0.542796117;0.457203883 -ageDirigeant;83;19900;73;0.003668342;0.542796117;0.457203883 -ageDirigeant;84;19900;73;0.003668342;0.542796117;0.457203883 -ageDirigeant;*;13522;39;0.002884189;0.426766798;0.573233202 -ageEntreprise;0;398545;3931;0,009863378;1,45812286;-0.45812286 -ageEntreprise;1;363230;5849;0.016102745;2.380500904;-1.380500904 -ageEntreprise;2;336945;5474;0.016245975;2.401674887;-1.401674887 -ageEntreprise;3;320242;4323;0.013499166;1.995608689;-0.995608689 -ageEntreprise;4;311256;3186;0.010235947;1.513200512;-0.513200512 -ageEntreprise;5;286481;2597;0.009065174;1.340122706;-0.340122706 -ageEntreprise;6;271422;2131;0.007851243;1.16066488;-0.16066488 -ageEntreprise;7;249689;1696;0.00679245;1.004141411;-0.004141411 -ageEntreprise;8;299828;1471;0.004906146;0.725285383;0.274714617 -ageEntreprise;9;251098;1368;0.005448072;0.805399367;0.194600633 -ageEntreprise;10;224326;1088;0.004850084;0.716997635;0.283002365 -ageEntreprise;11;225543;1016;0.004504684;0.665936463;0.334063537 -ageEntreprise;12;219141;911;0.004157141;0.614558427;0.385441573 -ageEntreprise;13;227433;890;0.00391324;0.578502136;0.421497864 -ageEntreprise;14;228796;849;0.003710729;0.548564505;0.451435495 -ageEntreprise;15;203213;738;0.003631657;0.536875165;0.463124835 -ageEntreprise;16;195413;723;0.003699856;0.546957126;0.453042874 -ageEntreprise;17;156467;621;0.003968888;0.586728635;0.413271365 -ageEntreprise;18;136150;578;0.004245318;0.627593783;0.372406217 -ageEntreprise;19;120966;421;0.003480317;0.514502176;0.485497824 -ageEntreprise;20;110350;344;0.003117354;0.460844645;0.539155355 -ageEntreprise;21;108829;314;0.00288526;0.426533798;0.573466202 -ageEntreprise;22;92057;306;0.003324028;0.49139762;0.50860238 -ageEntreprise;23;94394;225;0.002383626;0.3523762;0.6476238 -ageEntreprise;24;61811;133;0.002151721;0.318093146;0.681906854 -ageEntreprise;25;86450;215;0.002486987;0.367656207;0.632343793 -ageEntreprise;26;79203;222;0.002802924;0.414361868;0.585638132 -ageEntreprise;27;41020;131;0.003193564;0.472110957;0.527889043 -ageEntreprise;28;37137;119;0.003204351;0.473705671;0.526294329 -ageEntreprise;29;30627;110;0.003591602;0.530953718;0.469046282 -ageEntreprise;30;27785;106;0.003815008;0.563980261;0.436019739 -ageEntreprise;31;27100;87;0.003210332;0.474589802;0.525410198 -ageEntreprise;32;26851;86;0.00320286;0.47348522;0.52651478 -ageEntreprise;33;21279;48;0.002255745;0.3334713;0.6665287 -ageEntreprise;34;17287;42;0.002429571;0.359168382;0.640831618 -ageEntreprise;35;20082;45;0.002240813;0.331263809;0.668736191 -ageEntreprise;36;24005;33;0.001374714;0.203226655;0.796773345 -ageEntreprise;37;10981;36;0.00327839;0.484650929;0.515349071 -ageEntreprise;38;14152;43;0.00303844;0.449178619;0.550821381 -ageEntreprise;39;17017;67;0.003937239;0.582049933;0.417950067 -ageEntreprise;40;31055;102;0.003284495;0.485553488;0.514446512 -ageEntreprise;41;15175;43;0.002833608;0.418897912;0.581102088 -ageEntreprise;42;6992;15;0.002145309;0.3171453;0.6828547 -ageEntreprise;43;6310;14;0.0022187;0.327994919;0.672005081 -ageEntreprise;44;7244;15;0.002070679;0.306112636;0.693887364 -ageEntreprise;45;5863;13;0.002217295;0.32778713;0.67221287 -ageEntreprise;46;7647;52;0.006800052;1.005265304;-0.005265304 -ageEntreprise;47;9466;55;0.005810268;0.858943563;0.141056437 -ageEntreprise;48;6119;35;0.005719889;0.845582587;0.154417413 -ageEntreprise;49;6031;41;0.006798209;1.004992841;-0.004992841 -ageEntreprise;50;4954;22;0.004440856;0.656500587;0.343499413 -ageEntreprise;51;12623;11;0.000871425;0.128824523;0.871175477 -ageEntreprise;*;353169;621;0.001758365;0.259942604;0.740057396 -insTEFEN;11;122483;2586;0.021113134;3.12406207;-2.12406207 -insTEFEN;2;348140;6830;0.019618544;2.902911041;-1.902911041 -insTEFEN;3;178988;3509;0.019604666;2.900857541;-1.900857541 -insTEFEN;12;77324;1239;0.016023486;2.370958447;-1.370958447 -insTEFEN;1;946071;14717;0.015555915;2.301773089;-1.301773089 -insTEFEN;21;22652;290;0.012802402;1.894342023;-0.894342023 -insTEFEN;22;11018;103;0.009348339;1.383252313;-0.383252313 -insTEFEN;31;2325;13;0.005591398;0.827346328;0.172653672 -insTEFEN;0;4729670;14264;0.003015855;0.446249188;0.553750812 -insTEFEN;32;4541;13;0.002862806;0.423602777;0.576397223 -insTEFEN;41;2251;6;0.002665482;0.394405265;0.605594735 -insTEFEN;51;492;1;0.00203252;0.300747375;0.699252625 -insTEFEN;42;1121;1;0.000892061;0.131996172;0.868003828 -insTEFEN;52;172;0;0;0;1 -insTEFEN;53;1;0;0;0;1 -insNBTOA;13;445;8;0.017977528;2.660093638;-1.660093638 -insNBTOA;2;199031;2816;0.01414855;2.093528483;-1.093528483 -insNBTOA;3;38973;413;0.01059708;1.56802565;-0.56802565 -insNBTOA;1;3755472;38870;0.01035023;1.531499858;-0.531499858 -insNBTOA;8;1595;15;0.009404389;1.391545849;-0.391545849 -insNBTOA;11;743;6;0.00807537;1.194894013;-0.194894013 -insNBTOA;4;14851;119;0.008012928;1.185654658;-0.185654658 -insNBTOA;7;2443;19;0.007777323;1.150792658;-0.150792658 -insNBTOA;20-25;949;7;0.007376185;1.091437261;-0.091437261 -insNBTOA;10;869;6;0.006904488;1.021641256;-0.021641256 -insNBTOA;5;7090;46;0.006488011;0.960016163;0.039983837 -insNBTOA;6;3905;24;0.006145967;0.909404611;0.090595389 -insNBTOA;9;1144;6;0.005244755;0.776054416;0.223945584 -insNBTOA;14;412;2;0.004854369;0.718289848;0.281710152 -insNBTOA;75-99;225;1;0.004444444;0.657634261;0.342365739 -insNBTOA;35-49;639;2;0.00312989;0.463122719;0.536877281 -insNBTOA;50-74;424;1;0.002358491;0.348980445;0.651019555 -insNBTOA;15-19;1445;3;0.002076125;0.307199395;0.692800605 -insNBTOA;12;626;1;0.001597444;0.236370142;0.763629858 -insNBTOA;26-34;793;1;0.001261034;0.186592319;0.813407681 -insNBTOA;0;2414681;1206;0.000499445;0.073901711;0.926098289 -insNBTOA;100-;494;0;0;0;1 -insTCA;2;21622;409;0.018915919;2.798369096;-1.798369096 -insTCA;3;28973;507;0.017499051;2.588761516;-1.588761516 -insTCA;1;20023;348;0.017380013;2.571151383;-1.571151383 -insTCA;4;15955;207;0.012973989;1.919336348;-0.919336348 -insTCA;5;10403;89;0.008555224;1.265636407;-0.265636407 -insTCA;6;7600;51;0.006710526;0.992736831;0.007263169 -insTCA;0;6337365;41952;0.006619786;0.979312956;0.020687044 -insTCA;7;2667;7;0.002624672;0.388286754;0.611713246 -insTCA;9;1314;2;0.00152207;0.225170857;0.774829143 -insTCA;8;1327;0;0;0;1 -insTCAEXPOR;3;5258;109;0.020730316;3.066785966;-2.066785966 -insTCAEXPOR;2;12013;215;0.017897278;2.647674141;-1.647674141 -insTCAEXPOR;1;10029;173;0.017249975;2.551913931;-1.551913931 -insTCAEXPOR;4;5589;88;0.015745214;2.329303684;-1.329303684 -insTCAEXPOR;0;6414360;42987;0.006701682;0.991428405;0.008571595 -insSEXE;M;2233981;9893;0.004428417;0.655262754;0.344737246 -insSEXE;F;923849;2714;0.002937710;0.434686146;0.565313854 -insSEXE;*;3289419;30965;0.009413516;1.392896465;-0.392896465 -insRECME;0;6445782;43572;0.006759769;1.000227591;-0.000227591 -insRECME;1;1467;0;0.000000000;0;1 -insMONOREG;1;78856;935;0.011857056;1.754461392;-0.754461392 -insMONOREG;2;6170828;41393;0.006707852;0.992545468;0.007454532 -insMONOREG;0;197565;1244;0.006296662;0.931702627;0.068297373 -insRPET;11;1205539;10949;0.009082245;1.343874119;-0.343874119 -insRPET;31;252996;2234;0.008830179;1.306576712;-0.306576712 -insRPET;41;170366;1448;0.008499348;1.25762463;-0.25762463 -insRPET;93;599741;4858;0.008100163;1.198558318;-0.198558318 -insRPET;42;155599;1173;0.007538609;1.1154667;-0.1154667 -insRPET;22;135577;972;0.007169358;1.060829637;-0.060829637 -insRPET;4;60943;402;0.006596328;0.976040016;0.023959984 -insRPET;24;214087;1391;0.006497359;0.961395827;0.038604173 -insRPET;23;131429;852;0.006482588;0.959210205;0.040789795 -insRPET;43;102313;659;0.006441019;0.953059456;0.046940544 -insRPET;94;36450;234;0.006419753;0.949912765;0.050087235 -insRPET;91;337251;2154;0.006386934;0.945056671;0.054943329 -insRPET;82;667354;4078;0.0061107;0.904183032;0.095816968 -insRPET;2;42948;261;0.006077117;0.899213798;0.100786202 -insRPET;72;377551;2184;0.005784649;0.855938198;0.144061802 -insRPET;26;164649;907;0.005508688;0.81510506;0.18489494 -insRPET;74;80672;443;0.005491372;0.812542903;0.187457097 -insRPET;21;136535;746;0.0054638;0.808463155;0.191536845 -insRPET;54;191379;972;0.005078927;0.751514532;0.248485468 -insRPET;73;335852;1699;0.005058776;0.748532806;0.251467194 -insRPET;52;315413;1595;0.005056862;0.748249607;0.251750393 -insRPET;83;150096;732;0.004876879;0.721618007;0.278381993 -insRPET;1;63134;307;0.004862673;0.719516021;0.280483979 -insRPET;3;13275;63;0.004745763;0.702217129;0.297782871 -insRPET;53;314133;1445;0.004599962;0.680643473;0.319356527 -insRPET;25;149961;678;0.004521176;0.668985593;0.331014407 -insRPET;99;41208;134;0.003251796;0.481159052;0.518840948 -insRPET;98;775;2;0.002580645;0.381850789;0.618149211 -insSINGT;43;23550;425;0.018046709;2.670330198;-1.670330198 -insSINGT;2;76142;1237;0.016245961;2.403877696;-1.403877696 -insSINGT;1;3885595;40481;0.010418224;1.541560768;-0.541560768 -insSINGT;40;13737;119;0.008662736;1.281805149;-0.281805149 -insSINGT;31;35843;96;0.002678347;0.396308903;0.603691097 -insSINGT;33;3315;8;0.002413273;0.357086476;0.642913524 -insSINGT;52;6565;10;0.001523229;0.225388741;0.774611259 -insSINGT;10;96382;127;0.001317673;0.194973117;0.805026883 -insSINGT;60;216663;228;0.001052326;0.155710193;0.844289807 -insSINGT;90;577496;260;0.00045022;0.066617958;0.933382042 -insSINGT;70;1298907;576;0.00044345;0.065616245;0.934383755 -insSINGT;34;24032;1;4.16112E-05;0.006157112;0.993842888 -insSINGT;80;149852;4;2.6693E-05;0.003949703;0.996050297 -insSINGT;0;1;;0;0;1 -insSINGT;30;5741;0;0;0;1 -insSINGT;42;33428;0;0;0;1 -insORDIN;1;3412206;41477;0.012155479;1.798618445;-0.798618445 -insORDIN;0;3035043;2095;0.00069027;0.102137713;0.897862287 -insMODET;3;2787;130;0.046645138;6.901974209;-5.901974209 -insMODET;1;991;19;0.019172553;2.836918732;-1.836918732 -insMODET;2;3347;45;0.013444876;1.989407496;-0.989407496 -insMODET;0;6440124;43378;0.006735585;0.996649019;0.003350981 -insAUXILT;1;26364;474;0.017979062;2.66032066;-1.66032066 -insAUXILT;0;6420872;43098;0.006712172;0.993184774;0.006815226 -insAUXILT;*;13;0;0;0;1 -insTCD;73;83653;867;0.010364243;1.533573253;-0.533573253 -insTCD;44;207816;2036;0.009797128;1.449658615;-0.449658615 -insTCD;52;189137;1814;0.009590931;1.419148149;-0.419148149 -insTCD;43;241634;2262;0.009361265;1.385164989;-0.385164989 -insTCD;62;114691;1056;0.009207348;1.362390251;-0.362390251 -insTCD;41;193192;1687;0.008732246;1.292090379;-0.292090379 -insTCD;51;286358;2499;0.008726838;1.291290286;-0.291290286 -insTCD;72;161502;1371;0.008489059;1.256106603;-0.256106603 -insTCD;80;520175;4329;0.008322199;1.231416755;-0.231416755 -insTCD;42;173427;1427;0.008228246;1.21751469;-0.21751469 -insTCD;61;258193;2063;0.007990147;1.182283729;-0.182283729 -insTCD;31;307323;2413;0.007851674;1.161794206;-0.161794206 -insTCD;32;256048;1919;0.007494688;1.108971884;-0.108971884 -insTCD;71;137763;984;0.007142702;1.056889189;-0.056889189 -insTCD;22;291665;2073;0.007107469;1.051675929;-0.051675929 -insTCD;21;317427;2113;0.006656649;0.984969043;0.015030957 -insTCD;18;197044;1301;0.006602586;0.976969555;0.023030445 -insTCD;17;257376;1549;0.006018432;0.890533619;0.109466381 -insTCD;15;199766;1128;0.005646607;0.83551543;0.16448457 -insTCD;16;172805;968;0.00560169;0.828869199;0.171130801 -insTCD;14;249738;1244;0.00498122;0.737059757;0.262940243 -insTCD;0;120431;578;0.004799429;0.71016047;0.28983953 -insTCD;13;342501;1623;0.004738672;0.701170482;0.298829518 -insTCD;12;272656;1158;0.00424711;0.628435122;0.371564878 -insTCD;11;245321;1022;0.00416597;0.616429079;0.383570921 -insTCD;8;125432;481;0.003834747;0.567418744;0.432581256 -insTCD;7;149718;535;0.003573385;0.528745536;0.471254464 -insTCD;6;81869;265;0.003236878;0.478953484;0.521046516 -insTCD;4;81356;256;0.003146664;0.465604668;0.534395332 -insTCD;5;84330;243;0.002881537;0.426374401;0.573625599 -insTCD;3;74476;200;0.002685429;0.397356756;0.602643244 -insTCD;2;43091;94;0.00218143;0.322781198;0.677218802 -insTCD;1;9335;14;0.001499732;0.221911936;0.778088064 -insNATURE;91;238972;6564;0.027467653;4.064325692;-3.064325692 -insNATURE;20;144873;3353;0.023144409;3.424625203;-2.424625203 -insNATURE;22;10828;119;0.010990026;1.626168944;-0.626168944 -insNATURE;93;160570;1367;0.008513421;1.259711389;-0.259711389 -insNATURE;21;185819;1501;0.008077753;1.195246614;-0.195246614 -insNATURE;92;83924;635;0.00756637;1.119578368;-0.119578368 -insNATURE;99;5621113;30028;0.005342003;0.790443877;0.209556123 -insNATURE;23;1135;5;0.004405286;0.651840126;0.348159874 -insNATURE;*;15;0;0;0;1 -insORIGINE;3;296615;3962;0.013357382;1.976461277;-0.976461277 -insORIGINE;7;112298;1480;0.01317922;1.950098922;-0.950098922 -insORIGINE;2;907819;9870;0.010872211;1.608736195;-0.608736195 -insORIGINE;5;54475;462;0.008480955;1.254907414;-0.254907414 -insORIGINE;6;1914;11;0.005747126;0.85038913;0.14961087 -insORIGINE;1;4776418;27127;0.005679361;0.840361968;0.159638032 -insORIGINE;8;90133;230;0.002551785;0.377581718;0.622418282 -insORIGINE;0;173492;370;0.002132663;0.315565284;0.684434716 -insORIGINE;4;34085;60;0.001760305;0.260468315;0.739531685 -insTU;8;1084479;9960;0.009184134;1.358955201;-0.358955201 -insTU;7;1259040;10827;0.008599409;1.272434856;-0.272434856 -insTU;5;399066;3189;0.007991159;1.182433539;-0.182433539 -insTU;6;378843;2890;0.00762849;1.128770171;-0.128770171 -insTU;4;410877;2959;0.007201669;1.065614405;-0.065614405 -insTU;3;331773;2090;0.006299488;0.93212079;0.06787921 -insTU;2;343704;2076;0.006040081;0.893736945;0.106263055 -insTU;1;375638;2186;0.005819433;0.861088098;0.138911902 -insTU;0;1863829;7395;0.003967639;0.587082401;0.412917599 \ No newline at end of file diff --git a/framework/default/_includes/soundex.php b/framework/default/_includes/soundex.php deleted file mode 100644 index 9f154527e..000000000 --- a/framework/default/_includes/soundex.php +++ /dev/null @@ -1,194 +0,0 @@ - -*/ -class soundex2 { - - /** - * public sString - * main string we work on - */ - var $sString = ''; - - /** - * vowels replacement array - */ - var $aReplaceVoy1 = array ( - 'E' => 'A', - 'I' => 'A', - 'O' => 'A', - 'U' => 'A' - ); - - /** - * consonnants replacement array - */ - var $aReplaceGrp1 = array ( - 'GUI' => 'KI', - 'GUE' => 'KE', - 'GA' => 'KA', - 'GO' => 'KO', - 'GU' => 'K', - 'CA' => 'KA', - 'CO' => 'KO', - 'CU' => 'KU', - 'Q' => 'K', - 'CC' => 'K', - 'CK' => 'K' - ); - - /** - * other replacement array - */ - var $aReplaceGrp2 = array ( - 'ASA' => 'AZA', - 'KN' => 'NN', - 'PF' => 'FF', - 'PH' => 'FF', - 'SCH' => 'SSS' - ); - - /** - * endings replacement array - */ - var $aEnd = array ( - 'A', - 'T', - 'D', - 'S' - ); - - /** - * public function build - * core function of the class, go through the whole process - * @Param string sString : the string we want to check - */ - function build ($sString) { - /** - * let's check it's a real string... - */ - if (is_string ($sString) && !empty ($sString)) { - $this -> sString = $sString; - } else { - $this -> sString = ''; - //trigger_error ('Parameter string must not be empty', E_USER_ERROR); - } - /** - * remove starting and ending spaces - */ - $this -> sString = trim ($this -> sString); - /** - * remove special french characters - */ - $this -> trimAccent (); - /** - * string to upper case - */ - $this -> sString = strtoupper ($this -> sString ); - /** - * let's remove every space in the string - */ - $this -> sString = str_replace (' ', '', $this -> sString); - /** - * let's remove every '-' in the string - */ - $this -> sString = str_replace ('-', '', $this -> sString); - /** - * let's process through the first replacement array - */ - $this -> arrReplace ($this -> aReplaceGrp1); - /** - * let's process through th vowels replacement - */ - $sChar = substr ($this -> sString, 0, 1); - $this -> sString = substr ($this -> sString, 1, strlen ($this -> sString) - 1); - $this -> arrReplace ($this -> aReplaceVoy1); - $this -> sString = $sChar.$this -> sString; - /** - * let's process through the second replacement array - */ - $this -> arrReplace ($this -> aReplaceGrp2, true); - /** - * let's remove every 'H' but those prededed by a 'C' or an 'S' - */ - $this -> sString = preg_replace ('/(? sString); - /** - * let's remove every 'Y' but those preceded by an 'A' - */ - $this -> sString = preg_replace ('/(? sString); - /** - * remove endings in aEnd - */ - $length = strlen ($this -> sString) - 1; - if (in_array ($this -> sString{$length}, $this -> aEnd)) { - $this -> sString = substr ($this -> sString, 0, $length); - } - /** - * let's remove every 'A', but the one at the beginning of the string, if any. - */ - $sChar = ''; - if ($this -> sString{0} === 'A') { - $sChar = 'A'; - } - $this -> sString = str_replace ('A', '', $this -> sString); - $this -> sString = $sChar.$this -> sString; - /** - * let's have only 1 occurence of each letter - */ - $this -> sString = preg_replace( '/(.)\1/', '$1', $this -> sString ); - /** - * let's have the final code : a 4 letters string - */ - $this -> getFinal (); - } - - /** - * private function getFinal - * gets the first 4 letters, pads the string with white space if the string length < 4 - */ - function getFinal () { - if (strlen ($this -> sString) < 4) { - $this -> sString = str_pad ($this -> sString, 4, ' ', STR_PAD_RIGHT); - } else { - $this -> sString = substr ($this -> sString, 0, 4); - } - } - - /** - * private function trimAccent - * remove every special French letters - */ - function trimAccent () { - $this -> sString = htmlentities(strtolower($this -> sString )); - $this -> sString = preg_replace("/&(.)(acute|cedil|circ|ring|tilde|uml|grave);/", "$1", $this -> sString ); - $this -> sString = preg_replace("/([^a-z0-9]+)/", "-", html_entity_decode($this -> sString )); - $this -> sString = trim($this -> sString , "-"); - } - - /** - * private function arrReplace - * replacement method, given an array - * @Param array tab : the replacement array to be used - * @Param bool pref : if false, just replace keys by values; if true, do the same but only with prefix - */ - function arrReplace ($tab, $pref = false) { - $fromRep = array_keys ($tab); - $toRep = array_values ($tab); - if (false === $pref) { - $this -> sString = str_replace ($fromRep, $toRep, $this -> sString); - } else { - foreach ($fromRep as $clef => $val) { - $length = strlen ($val); - if (substr ($this -> sString, 0, $length) === $val) { - $this -> sString = substr_replace ($this -> sString, $toRep[$clef], 0, $length); - } - } - } - } - -} -?> \ No newline at end of file diff --git a/framework/default/_includes/strings.php b/framework/default/_includes/strings.php deleted file mode 100644 index 9fcde758d..000000000 --- a/framework/default/_includes/strings.php +++ /dev/null @@ -1,374 +0,0 @@ - $voy) - $posMot1=strpos($strIn, $mot1); - while ($posMot1!==false) { - $lettreAV=$strIn[$posMot1-1]; - $lettreAP=$strIn[$posMot1+strlen($mot1)]; - //echo "Lettre AV=$lettreAV
    "; - //echo "Lettre AP=$lettreAP
    "; - if ( ( $rule==0 && !in_array($lettreAV, $Voyelle) ) || - ( $rule==1 && !in_array($lettreAP, $Voyelle) ) || - ( $rule==2 && !in_array($lettreAV, $Voyelle) && !in_array($lettreAP, $Voyelle) )) - $strIn=substr($strIn,0,$posMot1) . $mot2 . substr($strIn,$posMot1+strlen($mot1),strlen($strIn)); - //echo "Le Mot devient : $strIn
    "; - $posMot1=strpos($strIn, $mot1, $posMot1+strlen($mot1)); - } - return $strIn; - } - //echo "Erreur : $mot2 contient $mot1 !
    "; - return $strIn; - } - - /** Retourne le phonex d'un mot - **/ - function phonex($strIn) { - if ($strIn=='') return 0.0; - $tabSonAIA=array('aina', 'eina', 'aima', 'eima'); - $tabSonAIE=array('ainr', 'eine', 'aime', 'eime'); - $tabSonAII=array('aini', 'eini', 'aimi', 'eimi'); - $tabSonAIO=array('aino', 'eino', 'aimo', 'eimo'); - $tabSonAIU=array('ainu', 'einu', 'aimu', 'eimu'); - $tabCarPhon=array('1', '2', '3', '4', '5', 'e', 'f', 'g', 'h', 'i', 'k', 'l', 'n', 'o', 'r', 's', 't', 'u', 'w', 'x', 'y', 'z'); - - /** On traite tout en minuscule **/ - $strIn=strtolower($strIn); - /** On remplace les 'Y' par des 'I' **/ - $strIn=str_replace('y', 'i', $strIn); - /** On supprime les accents **/ - $strIn=trimAccent($strIn); - /** On retire les 'H' muets sauf ceux précédés par 'C' ou 'S' **/ - $strIn = preg_replace ('/(?4; $i++) { - $strIn=str_replace($tabSonAIA[$i], 'yna', $strIn); - $strIn=str_replace($tabSonAIE[$i], 'yne', $strIn); - $strIn=str_replace($tabSonAII[$i], 'yni', $strIn); - $strIn=str_replace($tabSonAIO[$i], 'yno', $strIn); - $strIn=str_replace($tabSonAIU[$i], 'ynu', $strIn); - } - /** Remplacement des groupes de 3 lettres **/ - $strIn=str_replace('eau', 'o', $strIn); - $strIn=str_replace('oua', '2', $strIn); - $strIn=str_replace('ein', '4', $strIn); - $strIn=str_replace('ain', '4', $strIn); - /** Remplacement du son 'é' **/ - $strIn=str_replace('ai', 'y', $strIn); - $strIn=str_replace('ei', 'y', $strIn); - $strIn=str_replace('er', 'yr', $strIn); - $strIn=str_replace('ess', 'yss', $strIn); - $strIn=str_replace('et', 'yt', $strIn); - $strIn=str_replace('ez', 'yz', $strIn); - /** Remplacement des groupes de 2 lettres sauf si voyelle ou son (1 à 4) AVANT **/ - $strIn=str_replace_except_voy('an', '1', $strIn, BEFORE); - $strIn=str_replace_except_voy('am', '1', $strIn, BEFORE); - $strIn=str_replace_except_voy('en', '1', $strIn, BEFORE); - $strIn=str_replace_except_voy('em', '1', $strIn, BEFORE); - $strIn=str_replace_except_voy('in', '4', $strIn, BEFORE); - /** Remplacement du son 'SCH' **/ - $strIn=str_replace('sch', '5', $strIn); - /** Remplacement du 'S' sauf si voyelle ou son (1 à 4) avant ou après **/ - $strIn=str_replace_except_voy('in', '4', $strIn, BOTH); - /** Remplacement de groupe de 2 lettres diverses **/ - $strIn=str_replace('oe', 'e', $strIn); - $strIn=str_replace('eu', 'e', $strIn); - $strIn=str_replace('au', 'o', $strIn); - $strIn=str_replace('oi', '2', $strIn); - $strIn=str_replace('oy', '2', $strIn); - $strIn=str_replace('ou', '3', $strIn); - $strIn=str_replace('ch', '5', $strIn); - $strIn=str_replace('sh', '5', $strIn); - $strIn=str_replace('ss', 's', $strIn); - $strIn=str_replace('sc', 's', $strIn); - /** Remplacement du 'C' par 'S' s'il est suivi d'un 'E' ou d'un 'I' **/ - $strIn=str_replace('ce', 'se', $strIn); - $strIn=str_replace('ci', 'si', $strIn); - /** Remplacement divers **/ - $strIn=str_replace('c', 'k', $strIn); - $strIn=str_replace('q', 'k', $strIn); - $strIn=str_replace('qu', 'k', $strIn); - - $strIn=str_replace('ga', 'ka', $strIn); - $strIn=str_replace('go', 'ko', $strIn); - $strIn=str_replace('gu', 'ku', $strIn); - $strIn=str_replace('gy', 'ky', $strIn); - $strIn=str_replace('g2', 'k2', $strIn); - $strIn=str_replace('g1', 'k1', $strIn); - $strIn=str_replace('g3', 'k3', $strIn); - - $strIn=str_replace('a', 'o', $strIn); - $strIn=str_replace('d', 't', $strIn); - $strIn=str_replace('p', 't', $strIn); - $strIn=str_replace('j', 'g', $strIn); - $strIn=str_replace('b', 'f', $strIn); - $strIn=str_replace('v', 'f', $strIn); - $strIn=str_replace('m', 'n', $strIn); - - /** Supression des lettres dupliquées **/ - $let=$strIn[0]; - $strIn2=$let; - for ($i=1; $i0; $j--) - $result+=$sout[$j]*pow($j-1,10); - - return $result; - } - -/** -* CLASS soundex2 -* soundex2 French version -* based on the algorithm described here : http://sqlpro.developpez.com/cours/soundex/ by Frédéric BROUARD -* -* author Johan Barbier -*/ -class csoundex2 { - - /** - * public sString - * main string we work on - */ - var $sString = ''; - - /** - * vowels replacement array - */ - var $aReplaceVoy1 = array ( - 'E' => 'A', - 'I' => 'A', - 'O' => 'A', - 'U' => 'A' - ); - - /** - * consonnants replacement array - */ - var $aReplaceGrp1 = array ( - 'GUI' => 'KI', - 'GUE' => 'KE', - 'GA' => 'KA', - 'GO' => 'KO', - 'GU' => 'K', - 'CA' => 'KA', - 'CO' => 'KO', - 'CU' => 'KU', - 'Q' => 'K', - 'CC' => 'K', - 'CK' => 'K' - ); - - /** - * other replacement array - */ - var $aReplaceGrp2 = array ( - 'ASA' => 'AZA', - 'KN' => 'NN', - 'PF' => 'FF', - 'PH' => 'FF', - 'SCH' => 'SSS' - ); - - /** - * endings replacement array - */ - var $aEnd = array ( - 'A', - 'T', - 'D', - 'S' - ); - - /** - * public function build - * core function of the class, go through the whole process - * @Param string sString : the string we want to check - */ - function build ($sString) { - /** - * let's check it's a real string... - */ - if (is_string ($sString) && !empty ($sString)) { - $this -> sString = $sString; - } else { - trigger_error ('Parameter string must not be empty', E_USER_ERROR); - } - /** - * remove starting and ending spaces - */ - $this -> sString = trim ($this -> sString); - /** - * remove special french characters - */ - $this -> trimAccent (); - /** - * string to upper case - */ - $this -> sString = strtoupper ($this -> sString ); - /** - * let's remove every space in the string - */ - $this -> sString = str_replace (' ', '', $this -> sString); - /** - * let's remove every '-' in the string - */ - $this -> sString = str_replace ('-', '', $this -> sString); - /** - * let's process through the first replacement array - */ - $this -> arrReplace ($this -> aReplaceGrp1); - /** - * let's process through th vowels replacement - */ - $sChar = substr ($this -> sString, 0, 1); - $this -> sString = substr ($this -> sString, 1, strlen ($this -> sString) - 1); - $this -> arrReplace ($this -> aReplaceVoy1); - $this -> sString = $sChar.$this -> sString; - /** - * let's process through the second replacement array - */ - $this -> arrReplace ($this -> aReplaceGrp2, true); - /** - * let's remove every 'H' but those prededed by a 'C' or an 'S' - */ - $this -> sString = preg_replace ('/(? sString); - /** - * let's remove every 'Y' but those preceded by an 'A' - */ - $this -> sString = preg_replace ('/(? sString); - /** - * remove endings in aEnd - */ - $length = strlen ($this -> sString) - 1; - if (in_array ($this -> sString{$length}, $this -> aEnd)) { - $this -> sString = substr ($this -> sString, 0, $length); - } - /** - * let's remove every 'A', but the one at the beginning of the string, if any. - */ - $sChar = ''; - if ($this -> sString{0} === 'A') { - $sChar = 'A'; - } - $this -> sString = str_replace ('A', '', $this -> sString); - $this -> sString = $sChar.$this -> sString; - /** - * let's have only 1 occurence of each letter - */ - $this -> sString = preg_replace( '/(.)\1/', '$1', $this -> sString ); - /** - * let's have the final code : a 4 letters string - */ - $this -> getFinal (); - } - - /** - * private function getFinal - * gets the first 4 letters, pads the string with white space if the string length < 4 - */ - function getFinal () { - if (strlen ($this -> sString) < 4) { - $this -> sString = str_pad ($this -> sString, 4, ' ', STR_PAD_RIGHT); - } else { - $this -> sString = substr ($this -> sString, 0, 4); - } - } - - /** - * private function trimAccent - * remove every special French letters - */ - function trimAccent () { - $this -> sString = htmlentities(strtolower($this -> sString )); - $this -> sString = preg_replace("/&(.)(acute|cedil|circ|ring|tilde|uml|grave);/", "$1", $this -> sString ); - $this -> sString = preg_replace("/([^a-z0-9]+)/", "-", html_entity_decode($this -> sString )); - $this -> sString = trim($this -> sString , "-"); - } - - /** - * private function arrReplace - * replacement method, given an array - * @Param array tab : the replacement array to be used - * @Param bool pref : if false, just replace keys by values; if true, do the same but only with prefix - */ - function arrReplace ($tab, $pref = false) { - $fromRep = array_keys ($tab); - $toRep = array_values ($tab); - if (false === $pref) { - $this -> sString = str_replace ($fromRep, $toRep, $this -> sString); - } else { - foreach ($fromRep as $clef => $val) { - $length = strlen ($val); - if (substr ($this -> sString, 0, $length) === $val) { - $this -> sString = substr_replace ($this -> sString, $toRep[$clef], 0, $length); - } - } - } - } - -} - -function soundex2($str) { - $soundex2 = new csoundex2(); - - $soundex2 -> build ($str); - return $soundex2 -> sString; -} - -?> \ No newline at end of file diff --git a/framework/default/_includes/timer.php b/framework/default/_includes/timer.php deleted file mode 100644 index b7b30e525..000000000 --- a/framework/default/_includes/timer.php +++ /dev/null @@ -1,73 +0,0 @@ -'Janvier', - 2=>'Février', - 3=>'Mars', - 4=>'Avril', - 5=>'Mai', - 6=>'Juin', - 7=>'Juillet', - 8=>'Août', - 9=>'Septembre', - 10=>'Octobre', - 11=>'Novembre', - 12=>'Décembre'); - - function getLibelleMois($numMois) { - global $tabMois; - if ($numMois>0 && $numMois<13) - return $tabMois[$numMois]; - else - return false; - } - - function getNumMois($strMois) { - global $tabMois; - $mois=array_search(ucfirst(strtolower($strMois)), $tabMois); - return $mois; - } - - function dateT($formatIN, $formatOUT, $date) { - switch ($formatIN) { - case 'd M Y': $tmp=explode(' ', $date); $d=$tmp[0]; $m=getNumMois($tmp[1]); $Y=$tmp[2]; break; - case 'Ymd': $d=substr($date,6,2); $m=substr($date,4,2); $Y=substr($date,0,4); break; - case 'Y-m-d': $d=substr($date,8,2); $m=substr($date,5,2); $Y=substr($date,0,4); break; - case 'd/m/Y': $d=substr($date,0,2); $m=substr($date,3,2); $Y=substr($date,6,4); break; - default: return $date; - } - - if ($m*1>0 && $m*1<10) $m='0'.($m*1); - if ($d*1>0 && $d*1<10) $d='0'.($d*1); - - switch ($formatOUT) { - case 'd/m/Y': return $d.'/'.$m.'/'.$Y; break; - case 'Y': return $Y; break; - case 'm': return $m; break; - case 'd': return $d; break; - case 'Ym': return $Y.$m; break; - case 'Ymd': return $Y.$m.$d; break; - case 'Y-m-d': return $Y.'-'.$m.'-'.$d; break; - case 'Y/m/d': return $Y.'/'.$m.'/'.$d; break; - default: return $date; - } - } - ?> \ No newline at end of file diff --git a/framework/default/_includes/validation.php b/framework/default/_includes/validation.php deleted file mode 100644 index 3d33b73a2..000000000 --- a/framework/default/_includes/validation.php +++ /dev/null @@ -1,54 +0,0 @@ - \ No newline at end of file diff --git a/includes/infogreffe/index.php b/includes/infogreffe/index.php index c3b767e29..d6c771c88 100644 --- a/includes/infogreffe/index.php +++ b/includes/infogreffe/index.php @@ -11,7 +11,6 @@ isset($_REQUEST['rs'])? $raisonSociale = $_REQUEST['rs'] : ''; isset($_REQUEST['ref'])? $ref=$_REQUEST['ref'] : $ref = ''; $vecteur = isset($params[0]) ? strtoupper($params[0]) : 'XL' ; -require_once 'default/_includes/mysql.php'; require_once 'common/dates.php'; require_once 'common/curl.php'; require_once 'theme/theme.php'; diff --git a/includes/infogreffe/infogreffe_c.php b/includes/infogreffe/infogreffe_c.php index f81fca535..ae2c83b69 100644 --- a/includes/infogreffe/infogreffe_c.php +++ b/includes/infogreffe/infogreffe_c.php @@ -3,20 +3,14 @@ isset($_REQUEST['info']) ? $info = unserialize(urldecode($_REQUEST['info'])) : $info = false; - -//Connection à la base de données -$con = mysql_pconnect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS); -if (!($con === false)) -{ - if (mysql_select_db(MYSQL_DB, $con) === false) - echo (''); -} + $dejaCommande = false; $noemail = false; $sameLogin = false; $idCommande = 0; //Vérification des commandes -$rep = mysql_select('commandes', +$wdb = new WDB(); +$rep = $wdb->select('commandes', ' idCommande, login, emailCommande, dateCommande', "siren=$siren AND refDocument='$ref' AND statutCommande!=9"); //Déja commandé diff --git a/includes/infogreffe/infogreffe_courrier.php b/includes/infogreffe/infogreffe_courrier.php index 5af15e57e..f76b2028c 100644 --- a/includes/infogreffe/infogreffe_courrier.php +++ b/includes/infogreffe/infogreffe_courrier.php @@ -4,13 +4,6 @@ isset($_REQUEST['info']) ? $info = unserialize(urldecode($_REQUEST['info'])) : $info = false; -//Connection à la base de données -$con = mysql_pconnect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS); -if (!($con === false)) -{ - if (mysql_select_db(MYSQL_DB, $con) === false) - echo (''); -} $dejaCommande = false; $noemail = false; $sameLogin = false; @@ -30,7 +23,8 @@ else $searchRef = $ref; } -$rep = mysql_select('commandes', +$wdb = new WDB(); +$rep = $wdb->select('commandes', ' idCommande, login, emailCommande, dateCommande', "siren=$siren AND refDocument='$searchRef'"); diff --git a/includes/infogreffe/infogreffe_sauvcmd.php b/includes/infogreffe/infogreffe_sauvcmd.php index 3894a8ae9..e50d93d4c 100644 --- a/includes/infogreffe/infogreffe_sauvcmd.php +++ b/includes/infogreffe/infogreffe_sauvcmd.php @@ -14,33 +14,24 @@ $client = new SoapClient(null, array( 'login' => $_SESSION['tabInfo']['login'], 'password' => $_SESSION['tabInfo']['password'], )); -//Connection à la base de données -$con = mysql_pconnect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS); -if (!($con === false)) -{ - if (mysql_select_db(MYSQL_DB, $con) === false) - echo (''); -} -if($idCommande != 0) -{ +if($idCommande != 0) { if( !empty($_REQUEST['emailCommande']) && preg_match('#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$#', - $_REQUEST['emailCommande']) - ) - { + $_REQUEST['emailCommande']) ) { + $email = $_REQUEST['emailCommande']; $login = $_SESSION['tabInfo']['login']; $ip = $_SESSION['tabInfo']['ip']; $tabCommande = array( 'emailCommande' => $email ); - mysql_update('commandes', $tabCommande, "login='$login' AND siren='$siren'"); - + $wdb = new WDB(); + $wdb->update('commandes', $tabCommande, "login='$login' AND siren='$siren'"); $message = '

    Votre commande à été mise à jour.

    '; + } -} -else -{ +} else { + //Génération commande isset($_REQUEST['info']) ? $info = unserialize(urldecode($_REQUEST['info'])) : @@ -71,7 +62,8 @@ else ); //Enregistrement dans la bdd des informations de la commande - $idCommande = mysql_insert('commandes', $tabCommande); + $wdb = new WDB(); + $idCommande = $wdb->insert('commandes', $tabCommande); FB::log($idCommande, 'idCommande'); //Suppression fichier de vérouillage @@ -122,7 +114,7 @@ else 'Erreur '.$reponse['error']['errNum']); } else { //Mise à jour de la commande dans la bdd - mysql_update('commandes', array('statutCommande'=>0), + $wdb->update('commandes', array('statutCommande'=>0), 'idCommande = '.$idCommande); $message = diff --git a/includes/phplib/db_mysql.inc b/includes/phplib/db_mysql.inc deleted file mode 100644 index b97a21e27..000000000 --- a/includes/phplib/db_mysql.inc +++ /dev/null @@ -1,438 +0,0 @@ -query($query); - } - } - - /* public: some trivial reporting */ - function link_id() { - return $this->Link_ID; - } - - function query_id() { - return $this->Query_ID; - } - - /* public: connection management */ - function connect($Database = "", $Host = "", $User = "", $Password = "") { - /* Handle defaults */ - if ("" == $Database) - $Database = $this->Database; - if ("" == $Host) - $Host = $this->Host; - if ("" == $User) - $User = $this->User; - if ("" == $Password) - $Password = $this->Password; - - /* establish connection, select database */ - if ( 0 == $this->Link_ID ) { - - if(!$this->PConnect) { - $this->Link_ID = @mysql_connect($Host, $User, $Password); - } else { - $this->Link_ID = @mysql_pconnect($Host, $User, $Password); - } - if (!$this->Link_ID) { - $this->connect_failed("connect ($Host, $User, \$Password) failed"); - return 0; - } - - if (!@mysql_select_db($Database,$this->Link_ID)) { - $this->connect_failed("cannot use database ".$Database); - return 0; - } - } - - return $this->Link_ID; - } - - function connect_failed($message) { - $this->Halt_On_Error = "yes"; - $this->halt($message); - } - - /* public: discard the query result */ - function free() { - @mysql_free_result($this->Query_ID); - $this->Query_ID = 0; - } - - /* public: perform a query */ - function query($Query_String) { - /* No empty queries, please, since PHP4 chokes on them. */ - if ($Query_String == "") - /* The empty query string is passed on from the constructor, - * when calling the class without a query, e.g. in situations - * like these: '$db = new DB_Sql_Subclass;' - */ - return 0; - - if (!$this->connect()) { - return 0; /* we already complained in connect() about that. */ - }; - - # New query, discard previous result. - if ($this->Query_ID) { - $this->free(); - } - - if ($this->Debug) - printf("Debug: query = %s
    \n", $Query_String); - - $this->Query_ID = @mysql_query($Query_String,$this->Link_ID); - $this->Row = 0; - $this->Errno = mysql_errno(); - $this->Error = mysql_error(); - if (!$this->Query_ID) { - $this->halt("Invalid SQL: ".$Query_String); - } - - # Will return nada if it fails. That's fine. - return $this->Query_ID; - } - - /* public: walk result set */ - function next_record() { - if (!$this->Query_ID) { - $this->halt("next_record called with no query pending."); - return 0; - } - - $this->Record = @mysql_fetch_array($this->Query_ID); - $this->Row += 1; - $this->Errno = mysql_errno(); - $this->Error = mysql_error(); - - $stat = is_array($this->Record); - if (!$stat && $this->Auto_Free) { - $this->free(); - } - return $stat; - } - - /* public: position in result set */ - function seek($pos = 0) { - $status = @mysql_data_seek($this->Query_ID, $pos); - if ($status) - $this->Row = $pos; - else { - $this->halt("seek($pos) failed: result has ".$this->num_rows()." rows."); - - /* half assed attempt to save the day, - * but do not consider this documented or even - * desireable behaviour. - */ - @mysql_data_seek($this->Query_ID, $this->num_rows()); - $this->Row = $this->num_rows(); - return 0; - } - - return 1; - } - - /* public: table locking */ - function lock($table, $mode = "write") { - $query = "lock tables "; - if(is_array($table)) { - while(list($key,$value) = each($table)) { - // text keys are "read", "read local", "write", "low priority write" - if(is_int($key)) $key = $mode; - if(strpos($value, ",")) { - $query .= str_replace(",", " $key, ", $value) . " $key, "; - } else { - $query .= "$value $key, "; - } - } - $query = substr($query, 0, -2); - } elseif(strpos($table, ",")) { - $query .= str_replace(",", " $mode, ", $table) . " $mode"; - } else { - $query .= "$table $mode"; - } - if(!$this->query($query)) { - $this->halt("lock() failed."); - return false; - } - $this->locked = true; - return true; - } - - function unlock() { - - // set before unlock to avoid potential loop - $this->locked = false; - - if(!$this->query("unlock tables")) { - $this->halt("unlock() failed."); - return false; - } - return true; - } - - /* public: evaluate the result (size, width) */ - function affected_rows() { - return @mysql_affected_rows($this->Link_ID); - } - - function num_rows() { - return @mysql_num_rows($this->Query_ID); - } - - function num_fields() { - return @mysql_num_fields($this->Query_ID); - } - - /* public: shorthand notation */ - function nf() { - return $this->num_rows(); - } - - function np() { - print $this->num_rows(); - } - - function f($Name) { - if (isset($this->Record[$Name])) { - return $this->Record[$Name]; - } - } - - function p($Name) { - if (isset($this->Record[$Name])) { - print $this->Record[$Name]; - } - } - - /* public: sequence numbers */ - function nextid($seq_name) { - /* if no current lock, lock sequence table */ - if(!$this->locked) { - if($this->lock($this->Seq_Table)) { - $locked = true; - } else { - $this->halt("cannot lock ".$this->Seq_Table." - has it been created?"); - return 0; - } - } - - /* get sequence number and increment */ - $q = sprintf("select nextid from %s where seq_name = '%s'", - $this->Seq_Table, - $seq_name); - if(!$this->query($q)) { - $this->halt('query failed in nextid: '.$q); - return 0; - } - - /* No current value, make one */ - if(!$this->next_record()) { - $currentid = 0; - $q = sprintf("insert into %s values('%s', %s)", - $this->Seq_Table, - $seq_name, - $currentid); - if(!$this->query($q)) { - $this->halt('query failed in nextid: '.$q); - return 0; - } - } else { - $currentid = $this->f("nextid"); - } - $nextid = $currentid + 1; - $q = sprintf("update %s set nextid = '%s' where seq_name = '%s'", - $this->Seq_Table, - $nextid, - $seq_name); - if(!$this->query($q)) { - $this->halt('query failed in nextid: '.$q); - return 0; - } - - /* if nextid() locked the sequence table, unlock it */ - if($locked) { - $this->unlock(); - } - - return $nextid; - } - - /* public: return table metadata */ - function metadata($table = "", $full = false) { - $count = 0; - $id = 0; - $res = array(); - - /* - * Due to compatibility problems with Table we changed the behavior - * of metadata(); - * depending on $full, metadata returns the following values: - * - * - full is false (default): - * $result[]: - * [0]["table"] table name - * [0]["name"] field name - * [0]["type"] field type - * [0]["len"] field length - * [0]["flags"] field flags - * - * - full is true - * $result[]: - * ["num_fields"] number of metadata records - * [0]["table"] table name - * [0]["name"] field name - * [0]["type"] field type - * [0]["len"] field length - * [0]["flags"] field flags - * ["meta"][field name] index of field named "field name" - * This last one could be used if you have a field name, but no index. - * Test: if (isset($result['meta']['myfield'])) { ... - */ - - // if no $table specified, assume that we are working with a query - // result - if ($table) { - $this->connect(); - $id = @mysql_list_fields($this->Database, $table); - if (!$id) { - $this->halt("Metadata query failed."); - return false; - } - } else { - $id = $this->Query_ID; - if (!$id) { - $this->halt("No query specified."); - return false; - } - } - - $count = @mysql_num_fields($id); - - // made this IF due to performance (one if is faster than $count if's) - if (!$full) { - for ($i=0; $i<$count; $i++) { - $res[$i]["table"] = @mysql_field_table ($id, $i); - $res[$i]["name"] = @mysql_field_name ($id, $i); - $res[$i]["type"] = @mysql_field_type ($id, $i); - $res[$i]["len"] = @mysql_field_len ($id, $i); - $res[$i]["flags"] = @mysql_field_flags ($id, $i); - } - } else { // full - $res["num_fields"]= $count; - - for ($i=0; $i<$count; $i++) { - $res[$i]["table"] = @mysql_field_table ($id, $i); - $res[$i]["name"] = @mysql_field_name ($id, $i); - $res[$i]["type"] = @mysql_field_type ($id, $i); - $res[$i]["len"] = @mysql_field_len ($id, $i); - $res[$i]["flags"] = @mysql_field_flags ($id, $i); - $res["meta"][$res[$i]["name"]] = $i; - } - } - - // free the result only if we were called on a table - if ($table) { - @mysql_free_result($id); - } - return $res; - } - - /* public: find available table names */ - function table_names() { - $this->connect(); - $h = @mysql_query("show tables", $this->Link_ID); - $i = 0; - while ($info = @mysql_fetch_row($h)) { - $return[$i]["table_name"] = $info[0]; - $return[$i]["tablespace_name"] = $this->Database; - $return[$i]["database"] = $this->Database; - $i++; - } - - @mysql_free_result($h); - return $return; - } - - /* private: error handling */ - function halt($msg) { - $this->Error = @mysql_error($this->Link_ID); - $this->Errno = @mysql_errno($this->Link_ID); - - if ($this->locked) { - $this->unlock(); - } - - if ($this->Halt_On_Error == "no") - return; - - $this->haltmsg($msg); - - if ($this->Halt_On_Error != "report") - die("Session halted."); - } - - function haltmsg($msg) { - printf("

    Database error: %s
    \n", $msg); - printf("MySQL Error: %s (%s)

    \n", - $this->Errno, - $this->Error); - } -} -$_php_major_version = substr(phpversion(), 0, 1); -if((4 > $_php_major_version) or !class_exists("DB_Sql")) - { - class DB_Sql extends DB_MySQL - { - function DB_Sql($query = "") - { - $this->DB_MySQL($query); - } - } - } -unset($_php_major_version); -?> diff --git a/www/index.php b/www/index.php index 7f1f63426..07949637d 100644 --- a/www/index.php +++ b/www/index.php @@ -4,10 +4,9 @@ * Cette page sert toutes les requêtes du site */ require_once '../config/prepend.php'; -require_once 'index.fct.php'; require_once 'fwk.php'; -require_once 'default/_includes/mysql.php'; require_once 'maintenance/maintenance.php'; +require_once 'index.fct.php'; require_once 'index_auth.php'; require_once 'user/user.php'; diff --git a/www/index_annonces.php b/www/index_annonces.php index 3dbaf9f6a..2dceadeed 100644 --- a/www/index_annonces.php +++ b/www/index_annonces.php @@ -8,14 +8,13 @@ if (isset($_REQUEST['idan']) && $_REQUEST['idan']*1<>0 && $rcs=substr($_REQUEST['siret'],0,9); if (is_numeric($tmp[0])) $num=$tmp[0]; if (is_numeric($tmp[1])) $par=$tmp[1]; - $conid = mysql_pconnect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS); - if (!($conid === false)) { - if (mysql_select_db(MYSQL_DB, $conid) === false) - die('Base de données indisponible'); - } - $tabTmp=mysql_select('balo', 'Url_Annonce_Pdf, YEAR(Date_Parution) as Annee', - "Societe_Rcs='$rcs' AND Num_Affaire='$num' AND Num_Parution='$par'"); - $ann=$tabTmp[0]; + + $wdb = new WDB(); + $tabTmp = $wdb->select('balo', + 'Url_Annonce_Pdf, YEAR(Date_Parution) as Annee', + "Societe_Rcs='$rcs' AND Num_Affaire='$num' AND Num_Parution='$par'"); + + $ann = $tabTmp[0]; $file = PATH_DATA.'/jo/balo/'.$ann['Annee'].'/'.basename($ann['Url_Annonce_Pdf']); if (file_exists($file)) { header("Pragma: public"); diff --git a/www/pages/greffes.php b/www/pages/greffes.php index 8bc28f381..c52e5ed7e 100644 --- a/www/pages/greffes.php +++ b/www/pages/greffes.php @@ -1,49 +1,42 @@ log($_SESSION,'SESSION'); - $firephp->log($_SESSION,'SESSION'); +$idCommande=0; // Par défaut, l'identifiant de commande Infogreffe est à 0 - $idCommande=0; // Par défaut, l'identifiant de commande Infogreffe est à 0 +$siret = $_REQUEST['siret']; +$siren = substr($siret,0,9); +$idan = $_REQUEST['idan']; +$idEntreprise = $_REQUEST['idEntreprise']; +$source = $_REQUEST['source']; - $con = mysql_pconnect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS); - if (!($con === false)) { - if (mysql_select_db(MYSQL_DB, $con) === false) - echo (''); - } +$action = $_REQUEST['action']; +if ($action!='' && $action!='commande') die('Paramètres incorrects !'); - $siret = $_REQUEST['siret']; - $siren = substr($siret,0,9); - $idan = $_REQUEST['idan']; - $idEntreprise = $_REQUEST['idEntreprise']; - $source = $_REQUEST['source']; +$vecteurCommande=$_REQUEST['vecteur']; - $action = $_REQUEST['action']; - if ($action!='' && $action!='commande') die('Paramètres incorrects !'); - - $vecteurCommande=$_REQUEST['vecteur']; - - // - if ($vecteurCommande!='') - { - if ($vecteurCommande!='C' && $vecteurCommande!='T') die('Paramètres incorrects !'); - //Par défault - } else { - $vecteurCommande='T'; - } - $message=''; +// +if ($vecteurCommande!='') +{ + if ($vecteurCommande!='C' && $vecteurCommande!='T') die('Paramètres incorrects !'); +//Par défault +} else { + $vecteurCommande='T'; +} +$message=''; - require_once 'common/dates.php'; - require_once 'common/curl.php'; - require_once 'infogreffe/infogreffe.php'; - require_once 'user/user.php'; +require_once 'common/dates.php'; +require_once 'common/curl.php'; +require_once 'infogreffe/infogreffe.php'; +require_once 'user/user.php'; - //Elements de session - $tabInfo = $_SESSION['tabInfo']; - $login = strtolower($tabInfo['login']); - $raisonSociale = $tabInfo['entrep']['raisonSociale']; - isset($_REQUEST['rs'])? $raisonSociale = $_REQUEST['rs'] : ''; - $cj = $tabInfo['entrep']['fj']; - $dep = substr(''.$tabInfo['entrep']['codeCommune'],0,2); +//Elements de session +$tabInfo = $_SESSION['tabInfo']; +$login = strtolower($tabInfo['login']); +$raisonSociale = $tabInfo['entrep']['raisonSociale']; +isset($_REQUEST['rs'])? $raisonSociale = $_REQUEST['rs'] : ''; +$cj = $tabInfo['entrep']['fj']; +$dep = substr(''.$tabInfo['entrep']['codeCommune'],0,2); //Raison sociale inexacte if ($siren != $tabInfo['entrep']['siren']) @@ -225,7 +218,8 @@ fwrite($fp, date('Y/m/d H:i:s').";$siren;".$_REQUEST['email'].';'.$tabInfo['login'].';'.$tabInfo['email'].';'.$tabInfo['ip']."\n"); fclose($fp); $tabCommande = array( 'emailCommande' => $_REQUEST['email'] ); //On rentre l'adresse email - mysql_update('commandes', $tabCommande, "login='$login' AND siren='$siren'"); + $wdb = new WDB(); + $wdb->update('commandes', $tabCommande, "login='$login' AND siren='$siren'"); }else{ $message="ERREUR : Veuillez saisir une adresse email valide pour la commande de pièces"; } @@ -234,7 +228,10 @@ /** Si on est en commande de courrier, on génère une réf unique **/ if ($vecteurCommande=='C') { - $rep = mysql_select('commandes', ' idCommande, login, emailCommande, dateCommande', "siren=$siren AND refDocument='$option'"); + $wdb = new WDB(); + $rep = $wdb->select('commandes', + ' idCommande, login, emailCommande, dateCommande', + "siren=$siren AND refDocument='$option'"); if (count($rep)==0) { $dejaCommande = false; @@ -248,7 +245,7 @@ 'libDocument' => $_REQUEST['lib'], 'dateCommande' => date('YmdHis') ); - $idCommande = mysql_insert('commandes', $tabCommande); + $idCommande = $wdb->insert('commandes', $tabCommande); //noemail = true : on sait que l'email n'a pas ete saisie } else diff --git a/www/pages/greffes2.php b/www/pages/greffes2.php index 24fba83a5..b36c5a17b 100644 --- a/www/pages/greffes2.php +++ b/www/pages/greffes2.php @@ -1,5 +1,4 @@ '); -} - $siret = $_REQUEST['siret']; $siren = substr($siret,0,9); $idUser = $_SESSION['tabInfo']['id']; @@ -21,10 +14,13 @@ $libDocument = urldecode($_REQUEST['lib']); //On enregsitre les informations // idClient, login, siren, refDocument, libDocument, dateCommande +$wdb = new WDB(); +$rep = $wdb->select('commandes', + ' idCommande, login, emailCommande, dateCommande', + "siren=$siren AND refDocument='$refDocument'"); -$rep = mysql_select('commandes', ' idCommande, login, emailCommande, dateCommande', "siren=$siren AND refDocument='$refDocument'"); -if (count($rep)==0) -{ +if (count($rep)==0){ + $tabCommande = array( 'idUser' => $idUser, // emailCommande @@ -34,7 +30,7 @@ if (count($rep)==0) 'libDocument' => $libDocument, 'dateCommande' => date('YmdHis') ); - $idCommande = mysql_insert('commandes', $tabCommande); + $idCommande = $wdb->insert('commandes', $tabCommande); ?> Commande enregistré avec la référence : G '') - { -/*?> -'>Retour à la page précédente     Aller en bas
    -
    -"; - - switch($_REQUEST['option']) { - case 'ef': include ('visuEntrepriseEF.php'); break; - case 'dir': include ('visuEntrepriseDirigeants.php'); break; - case 'liens': include ('visuEntrepriseLiens.php'); break; - case 'balo': include ('visuEntrepriseBalo.php'); break; - case 'banques': include ('visuEntrepriseBanques.php'); break; - case 'bilans': include ('visuEntrepriseBilans.php'); break; - default : include ('visuEntrepriseInsee.php'); break; - } -} - } ?> \ No newline at end of file diff --git a/www/pages/visuEntrepriseInsee.php b/www/pages/visuEntrepriseInsee.php deleted file mode 100644 index 790aa1239..000000000 --- a/www/pages/visuEntrepriseInsee.php +++ /dev/null @@ -1,295 +0,0 @@ - - - - - - -
    '') echo ',
    '. $etab['insNOMET']; -?>
     
    - - - - - - - - -
    - - - -
     Identifiants
    - - - - - -
    SIREN de l'entreprise
    SIRET de l'établissement 
       
    - - - -
     Raison sociale & Coordonnées
    - - - - - -'') {?> - - - -'') {?> - - - - - - - - - - - - - - - - - - -'') {?> - - - -'') {?> - - - -'') {?> - - - - - - - - - - - - -'' && $etab['insMODEN']<>0) { ?> - - - -'' || $etab['insEAESEC2N']<>'' || $etab['insEAESEC3N']<>'' || $etab['insEAESEC4N']<>'') { ?> -'; -} ?> - - -'' && $etab['insMODET']<>0) { ?> - - - -'' || $etab['insEAESEC2T']<>'') { ?> -'; -} ?> - - - - - - - - - - - - -'' && $etab['insNATURE']<>'99') { ?> - - - - - - - - - - -
    Raison Sociale
    NOM de l'entreprise
    Enseigne
    NOM de l'établissement
    SIGLE
    Adresse'') echo $etab['insCADR']. '
    '; -echo $etab['insNUMVOIE'].' '.$tabINDREP[$etab['insINDREP']]. -' '.$tabTypeVoie[$etab['insTYPVOIE']].' '.$etab['insLIBVOIE']; -if ($etab['insDISTSP']<>'') echo '
    '.$etab['insDISTSP']; -?> -
    ''){ - echo '('.$etab['insARRONET'].')'; - if ($etab['insARRONET']==1) echo ' '.$etab['insARRONET'].' er'; - else echo ' '.$etab['insARRONET'].' ème'; -}*/ - $adresseGoogleMap=$etab['insNUMVOIE'].' '.$tabINDREP[$etab['insINDREP']].' '.$tabTypeVoie[$etab['insTYPVOIE']].' '.$etab['insLIBVOIE'].', '.$etab['insACHPOSTE']; - -?>
    Localisationplan  vue satellite
    Code voie (RIVOLI)
    Canton
    Zone d'emploi)
    Code INSEE de la commune
    Téléphone
    Fax
    Civilité
    Forme juridique -
    Création de l'entreprise0) { - $dateCre=$etab['insDCREN']; - $moisCre=(int)substr($etab['insDCREN'],0,2); - $anneeCre=(int)substr($etab['insDCREN'],2,4); - if ($moisCre>0 && $moisCre<13) - echo getLibelleMois($moisCre).' '; - if ($anneeCre>0) - echo $anneeCre; - else - echo 'Année de création inconnue'; -} - ?>
    Création de l'établissement0) { - $dateCre=$etab['insDCRET']; - $moisCre=(int)substr($etab['insDCRET'],0,2); - $anneeCre=(int)substr($etab['insDCRET'],2,4); - if ($moisCre>0 && $moisCre<13) - echo getLibelleMois($moisCre).' '; - if ($anneeCre>0) - echo $anneeCre; - else - echo 'Année de création inconnue'; -} - ?>
    Activité principale de l'entreprise -
      et plus particulièrement
    Autres activités de l'entreprise'') { - $tmp=mysql_select('tabNAF', 'libNaf700', "codNaf700='". $etab[$activite] ."'"); - $libActivite=$tmp[0]; - echo $etab[$activite].' - '. $libActivite[0] .'
    '; - } - } - echo 'Mises à jour lors de l\'enquête annuelle de '. $etab['insEAEANN'].'
    Activité de l'établissement -
      et plus particulièrement
    Autres activités de l'établissement'') { - $tmp=mysql_select('tabNAF', 'libNaf700', "codNaf700='". $etab[$activite] ."'"); - $libActivite=$tmp[0]; - echo $etab[$activite].' - '. $libActivite[0] .'
    '; - } - } - echo 'Mises à jour lors de l\'enquête annuelle de '. $etab['insEAEANT'].'
    Nombre d'établissements actifs de l'entreprise
    Statut,
    Chiffre d'affaire estimé0) {?> - dont  à l'export
    Effectif de l'entreprise'' && $etab['insEFENCENT']<100) - echo $tabEffectif[$etab['insTEFEN']]; -elseif ($etab['insEFENCENT']>100) - echo 'de '. $etab['insEFENCENT']. ' à '. 1*($etab['insEFENCENT'])+99 . ' salariés'; -else echo 'inconnu';?>
    Effectif de l'établissement'' && $etab['insEFETCENT']<100) - echo $tabEffectif[$etab['insTEFET']]; -elseif ($etab['insEFETCENT']>100) - echo 'de '. $etab['insEFETCENT']. ' à '. 1*($etab['insEFETCENT'])+99 . ' salariés'; -else echo 'inconnu';?>
    Nature de l'établissement
    Origine de création de l'établissement
    Singularité de l'établissement
    Saisonnalité de l'établissement
    - - - - -
    -

     Dirigeants

    -
    - -'') {?> - - -'' || substr($etab['insCJ'],0,1)=='1') {?> - - - -
    '') { - echo ', né(e) le '. dateT('Ymd', 'd/m/Y', $etab['SOEDRD_D']); - if ($etab['SOEDRL_N']<>'') - echo ' à '. $etab['SOEDRL_N']; -}elseif ($etab['SOEDRL_N']<>'') - echo ', né(e) à '. $etab['SOEDRL_N'];?> -
      -
    - - - - - -
    -

     Commentaires

    -
    - - -'' && $etab['insRPET']<>$etab['insREGIMP']) { ?> - - - - '') { ?> - - - -'') { - if ($etab['insMONOACT']==2 && $etab['insNBTOA']>1) { ?> - - - - - - '') { - if ($etab['insORDIN']==0) { ?> - - - - - - - - - - - -
    Cet est installé en région $etab['insRPEN']) { ?> contrairement à son siège sociale qui lui est situé en . - - - '') { ?> -
    Cet établissement est implanté à dont la population avoisine . 0 && $etab['insTU']<9 ) { echo $etab['insLIBCOM'].' est situé en '. $tabTU[$etab['insTU']]; }?>
    Cette entreprise est implanté principalement en région .
    L'ensemble des établissement de l'entreprise exerce la même activité économique.
    80% des effectifs de l'entreprise sont répartis dans des établissement exerçant la même activité.
    L'entreprise exerce de multiples activités dont aucune n'est prépondérante dans la répartition des effectifs.
    L'entreprise n'est pas prise en compte dans le dénombrement des entreprises et les analyses démographiques réalisées par l'INSEE.
    L'entreprise est prise en compte dans le dénombrement des entreprises et les analyses démographiques réalisées par l'INSEE.
    L'entreprise appartient au Répertoire des entreprises contrôlées majoritairement par l'état.
    a une activité saisonnière et cesse ses activités plus de 3 mois consécutifs.
    - -
    -
    \ No newline at end of file