Library Update

This commit is contained in:
Michael RICOIS 2015-06-10 09:32:03 +00:00
parent 7cf5fcc969
commit 19e032a49f
30 changed files with 5022 additions and 3862 deletions

View File

@ -0,0 +1,6 @@
<?php
class Metier_Common_Chiffre
{
}

View File

@ -0,0 +1,7 @@
<?php
class Metier_Common_Date
{
}

View File

@ -0,0 +1,6 @@
<?php
class Metier_Common_Debug
{
}

View File

@ -0,0 +1,7 @@
<?php
class Metier_Common_Ftp
{
}

View File

@ -0,0 +1,6 @@
<?php
class Metier_Common_Mail
{
}

View File

@ -0,0 +1,6 @@
<?php
class Metier_Common_Mysql
{
}

View File

@ -0,0 +1,7 @@
<?php
class Metier_Common_String
{
}

View File

@ -0,0 +1,7 @@
<?php
class Metier_Common_Utils
{
}

View File

@ -172,7 +172,7 @@ return array(
"DH" => "MAD",
"EUROS, CRÉATION L'AUTRE BRANCHE ACTIVITÉ" => "EUR",
"LEI ROUMAIN" => "RON",
"$HGK" => "HKD",
"HGK" => "HKD",
"EUROS, ÉTANT PRÉCISÉ QUE LE CÉDANT A CON" => "EUR",
"DZD" => "DZD",
"DON" => "VND",
@ -272,4 +272,5 @@ return array(
"EUROS CONCERNANT L'ACQUISITION UNE BRANC" => "EUR",
"E POUR" => "EUR",
"EUROS, FONDS ACQUIS SIS à LA RICHE (" => "EUR",
"EUROS, OPPOSITIONS PAR ACTE EXTRA JUDICI" => "EUR",
);

View File

@ -56,6 +56,13 @@ return array(
'Version' => 18,
'LienEtab' => 0,
),
'1111' => array(
'libEven' => "Ouverture Sauvegarde Accélérée",
'Bodacc_Code' => "BODA",
'Rubrique' => "procol",
'Version' => 19,
'LienEtab' => 0,
),
'1115' => array(
'libEven' => "Plan de Sauvegarde Financière Accélérée",
'Bodacc_Code' => "BODA",
@ -63,6 +70,20 @@ return array(
'Version' => 18,
'LienEtab' => 0,
),
'1116' => array(
'libEven' => "Plan de Sauvegarde Accélérée",
'Bodacc_Code' => "BODA",
'Rubrique' => "procol",
'Version' => 19,
'LienEtab' => 0,
),
'1118' => array(
'libEven' => "Clôture de sauvegarde accélérée",
'Bodacc_Code' => "BODA",
'Rubrique' => "procol",
'Version' => 19,
'LienEtab' => 0,
),
'1119' => array(
'libEven' => "Clôture de sauvegarde financière accélérée",
'Bodacc_Code' => "BODA",
@ -182,6 +203,27 @@ return array(
'Version' => 16,
'LienEtab' => 0,
),
'1217' => array(
'libEven' => "Redressement Judiciaire sur résolution du plan de sauvegarde",
'Bodacc_Code' => "BODA",
'Rubrique' => "procol",
'Version' => 18,
'LienEtab' => 0,
),
'1218' => array(
'libEven' => "Avis de dépôt de l'état des créances et du projet de répartition",
'Bodacc_Code' => "BODA",
'Rubrique' => "procol",
'Version' => 18,
'LienEtab' => 0,
),
'1219' => array(
'libEven' => "Avis aux salariés",
'Bodacc_Code' => "BODA",
'Rubrique' => "procol",
'Version' => 18,
'LienEtab' => 0,
),
'1300' => array(
'libEven' => "Conversion Redressement Judiciaire en Liquidation Judiciaire",
'Bodacc_Code' => "BODA",
@ -280,6 +322,13 @@ return array(
'Version' => 12,
'LienEtab' => 0,
),
'1314' => array(
'libEven' => "Ouverture Liquidation Judiciaire sur résolution du plan de sauvegarde",
'Bodacc_Code' => "BODA",
'Rubrique' => "procol",
'Version' => 18,
'LienEtab' => 0,
),
'1346' => array(
'libEven' => "Procédure d'insolvabilité (Règlement 1346/2000 du Conseil Européen)",
'Bodacc_Code' => "BODA",
@ -518,6 +567,20 @@ return array(
'Version' => 17,
'LienEtab' => 0,
),
'1463' => array(
'libEven' => "Modification du plan de sauvegarde",
'Bodacc_Code' => "BODA",
'Rubrique' => "procol",
'Version' => 19,
'LienEtab' => 0,
),
'1465' => array(
'libEven' => "Clôture de la procédure suite à l'homologation du plan",
'Bodacc_Code' => "BODA",
'Rubrique' => "procol",
'Version' => 19,
'LienEtab' => 0,
),
'1470' => array(
'libEven' => "Fin de mission d'administrateur judiciaire",
'Bodacc_Code' => "BODA",
@ -532,6 +595,13 @@ return array(
'Version' => 17,
'LienEtab' => 0,
),
'1474' => array(
'libEven' => "Modification d'intervenant(s)",
'Bodacc_Code' => "BODA",
'Rubrique' => "procol",
'Version' => 18,
'LienEtab' => 0,
),
'1475' => array(
'libEven' => "Modification de la mission d'un intervenant",
'Bodacc_Code' => "BODA",
@ -700,6 +770,13 @@ return array(
'Version' => 18,
'LienEtab' => 0,
),
'1522' => array(
'libEven' => "Clôture de la procédure par dissolution de l'union",
'Bodacc_Code' => "BODA",
'Rubrique' => "procol",
'Version' => 18,
'LienEtab' => 0,
),
'1525' => array(
'libEven' => "Appel du ministère public",
'Bodacc_Code' => "BODA",
@ -764,7 +841,7 @@ return array(
'LienEtab' => 0,
),
'1546' => array(
'libEven' => "Autre rétractation sur tierce opposition",
'libEven' => "Rétractation de jugement (sur tierce opposition)",
'Bodacc_Code' => "BODA",
'Rubrique' => "procol",
'Version' => 16,
@ -875,6 +952,13 @@ return array(
'Version' => 16,
'LienEtab' => 0,
),
'1800' => array(
'libEven' => "Suppression des mentions relatives à une procédure collective du K-Bis (Art. R123-135)",
'Bodacc_Code' => "BODA",
'Rubrique' => "procol",
'Version' => 18,
'LienEtab' => 0,
),
'1900' => array(
'libEven' => "Interdiction temporaire d'exercice de la profession de CAC",
'Bodacc_Code' => "BODA",
@ -1029,6 +1113,13 @@ return array(
'Version' => 16,
'LienEtab' => 0,
),
'2213' => array(
'libEven' => "Ouverture de dissolution anticipé",
'Bodacc_Code' => "BODB",
'Rubrique' => "mmd",
'Version' => 18,
'LienEtab' => 0,
),
'2300' => array(
'libEven' => "Changement d'adresse",
'Bodacc_Code' => "BODB",
@ -1387,28 +1478,28 @@ return array(
'LienEtab' => 0,
),
'2700' => array(
'libEven' => "Fusion/Absorption (entitée absorbante)",
'libEven' => "Fusion/Absorption (entité absorbante)",
'Bodacc_Code' => "BODB",
'Rubrique' => "mmd",
'Version' => 12,
'LienEtab' => 0,
),
'2701' => array(
'libEven' => "Fusion/Absorption (Entitée absorbante. Entité absorbée inconnue)",
'libEven' => "Fusion/Absorption (Entité absorbante. Entité absorbée inconnue)",
'Bodacc_Code' => "BODB",
'Rubrique' => "mmd",
'Version' => 12,
'LienEtab' => 0,
),
'2702' => array(
'libEven' => "Fusion/Absorption (Entitée absorbante. Entité absorbée mal SIRENEE)",
'libEven' => "Fusion/Absorption (Entitée absorbante. Entité absorbée mal identifiée)",
'Bodacc_Code' => "BODB",
'Rubrique' => "mmd",
'Version' => 12,
'LienEtab' => 0,
),
'2703' => array(
'libEven' => "Fusion/Absorption (Entitée absorbante. Entité absorbée non SIRENEE)",
'libEven' => "Fusion/Absorption (Entité absorbante. Entité absorbée non identifiée)",
'Bodacc_Code' => "BODB",
'Rubrique' => "mmd",
'Version' => 12,
@ -1519,6 +1610,20 @@ return array(
'Version' => 12,
'LienEtab' => 1,
),
'2810' => array(
'libEven' => "Propriétaire du fond en Location-gérance",
'Bodacc_Code' => "BODB",
'Rubrique' => "mmd",
'Version' => 18,
'LienEtab' => 1,
),
'2820' => array(
'libEven' => "Locataire du fond en Location-gérance",
'Bodacc_Code' => "BODB",
'Rubrique' => "mmd",
'Version' => 18,
'LienEtab' => 1,
),
'2840' => array(
'libEven' => "Location/Gérance",
'Bodacc_Code' => "BODB",
@ -2045,12 +2150,19 @@ return array(
'LienEtab' => 1,
),
'5600' => array(
'libEven' => "Entreprise « Précédent exploitant »",
'libEven' => "Entreprise Précédent exploitant",
'Bodacc_Code' => "BODA",
'Rubrique' => "ventes",
'Version' => 12,
'LienEtab' => 1,
),
'5610' => array(
'libEven' => "Entreprise Nouvel exploitant",
'Bodacc_Code' => "BODA",
'Rubrique' => "ventes",
'Version' => 18,
'LienEtab' => 1,
),
'5650' => array(
'libEven' => "Entreprise indemnisée",
'Bodacc_Code' => "BODA",
@ -2191,6 +2303,20 @@ return array(
'Version' => 12,
'LienEtab' => 0,
),
'7500' => array(
'libEven' => "Rectificatif d'annonce",
'Bodacc_Code' => "BODA",
'Rubrique' => "divers",
'Version' => 18,
'LienEtab' => 0,
),
'7501' => array(
'libEven' => "Annulation d'annonce",
'Bodacc_Code' => "BODA",
'Rubrique' => "divers",
'Version' => 18,
'LienEtab' => 0,
),
'8000' => array(
'libEven' => "Création d'association",
'Bodacc_Code' => "ASSO",
@ -2485,4 +2611,11 @@ return array(
'Version' => 16,
'LienEtab' => 0,
),
'1801' => array(
'libEven' => "Clôture de la procédure collective (mention faite au K-Bis, Art. R631-43)",
'Bodacc_Code' => "BODA",
'Rubrique' => "procol",
'Version' => 18,
'LienEtab' => 0,
),
);

View File

@ -1,6 +1,9 @@
<?php
return array(
'1' => "Directeur",
'2' => "Directeur Contentieux",
'3' => "Directeur Recouvrement",
'4' => "Directeur Crédit",
'5' => "Directeur Recherche et Développement",
'6' => "Directeur de la Qualité",
'7' => "Directeur d'Exploitation",
@ -17,6 +20,9 @@ return array(
'18' => "Directeur de la communication",
'19' => "Directeur Technique",
'31' => "Responsable",
'32' => "Responsable Contentieux",
'33' => "Responsable Recouvrement",
'34' => "Responsable Crédit",
'35' => "Responsable Recherche et Développement",
'36' => "Responsable de la Qualité",
'37' => "Responsable d'Exploitation",
@ -40,6 +46,8 @@ return array(
'63' => "Consultant",
'79' => "Assistant(e) de direction",
'80' => "Avocat",
'81' => "Commissaire-priseur",
'85' => "Agent commercial",
'90' => "Représentant du personnel",
'91' => "Représentant du Comité d'Entreprise",
'92' => "Scrutateur",
@ -52,6 +60,7 @@ return array(
'106' => "Administrateur membre engageant le GIE",
'107' => "Administrateur unique",
'108' => "Administrateur provisoire",
'109' => "Administrateur et Directeur",
'200' => "Associé",
'201' => "Associé commandité gérant",
'202' => "Associé commandité",
@ -65,11 +74,15 @@ return array(
'211' => "Associé indéfiniment responsable",
'212' => "Associé en nue propriété (avec usufruitier)",
'213' => "Associé unique",
'214' => "Co-Associé",
'215' => "Associé Commanditaire",
'250' => "Propriétaire",
'300' => "Commissaire aux comptes titulaire",
'301' => "Co-commissaire aux comptes suppléant",
'302' => "Co-commissaire aux comptes titulaire",
'303' => "Commissaire aux comptes suppléant",
'304' => "Commissaire aux comptes",
'305' => "Co-commissaire aux comptes",
'400' => "Co-gérant",
'401' => "Co-gérant associé Indéfiniment responsable",
'402' => "Co-gérant associé",
@ -132,6 +145,7 @@ return array(
'923' => "Gérant co-associé",
'924' => "Gérant unique",
'925' => "Premier Gérant",
'926' => "Gérant de fait",
'1000' => "Fondé de pouvoir",
'1001' => "Personne ayant pouvoir d'engager à titre habituel la société vis-à-vis des tiers",
'1002' => "Personne ayant pouvoir d'engager la société en France",
@ -140,6 +154,9 @@ return array(
'1005' => "Personne pouvant engager à titre habituel l'assujetti",
'1006' => "Personne",
'1050' => "Personne Physique",
'1070' => "Exploitant",
'1080' => "Fondateur",
'1081' => "Co-fondateur",
'1090' => "Gérant affaire personnelle",
'1100' => "Mandataire",
'1101' => "Mandataire ad hoc",
@ -154,6 +171,10 @@ return array(
'1207' => "Membre du conseil de surveillance",
'1208' => "Membre du directoire",
'1209' => "Membre du conseil exécutif",
'1210' => "Membre du conseil de gestion",
'1211' => "Membre du conseil d'administration",
'1230' => "Membre du Comité d'Orientation",
'1232' => "Membre du conseil de famille",
'1300' => "Président",
'1301' => "Président directeur général",
'1302' => "Président du conseil d'administration assumant la direction général",
@ -173,12 +194,17 @@ return array(
'1316' => "Président et associé unique",
'1317' => "Président directeur général et administrateur",
'1318' => "Président non associé",
'1320' => "Président d'honneur",
'1330' => "Président du Comité d'Orientation",
'1331' => "Président du comité de direction",
'1332' => "Président du Conseil de famille",
'1400' => "Représentant",
'1401' => "Représentant de société étrangère",
'1402' => "Représentant tant en France qu'à l'étranger",
'1403' => "Représentant à l'étranger",
'1404' => "Représentant légal en France",
'1405' => "Représentant légal",
'1406' => "Représentant permanent",
'1500' => "Responsable",
'1501' => "Co-responsable en France",
'1502' => "Responsable pour la France",
@ -203,7 +229,8 @@ return array(
'1803' => "Vice-président et administrateur privé",
'1804' => "Vice-président et administrateur",
'1805' => "Vice-président et membre du conseil de surveillance",
'1900' => "Liquidateur",
'1806' => "Vice-président du directoire",
'1900' => "Liquidateur (amiable)",
'1950' => "Greffier",
'2000' => "Maire",
'2001' => "Premier Adjoint",

View File

@ -1768,4 +1768,5 @@ return array(
'PAR19F' => array('nom'=>"JUGE DE PROXIMITE DE PARIS 19ème", 'siret'=>"17750111100369", 'dep'=>"75"),
'PAR20F' => array('nom'=>"JUGE DE PROXIMITE DE PARIS 20ème", 'siret'=>"17750111100427", 'dep'=>"75"),
'LILLEM' => array('nom'=>"TC LILLE METROPOLE", 'siret'=>"175901115", 'dep'=>"59"),
'MAMOUI' => array('nom'=>"TI MAMOUDZOU", 'siret'=>"130003395", 'dep'=>"976"),
);

View File

@ -278,4 +278,5 @@ return array(
9300 => "Fondation",
9900 => "Autre personne morale de droit privé",
9970 => "Groupement de coopération sanitaire à gestion privée",
6500 => "",
);

View File

@ -733,4 +733,11 @@ return array(
'9820Z' => "T9820",
'9900Z' => "U9900",
'0000Z' => "Z000",
'742C' => "742C",
'524C' => "524C",
'8111' => "8111",
'452A' => "452A",
'000Z' => "00Z",
'526D' => "526D",
'8121' => "8121",
);

View File

@ -1109,7 +1109,7 @@ return array(
'4391B' => "Travaux de couverture par éléments",
'4399A' => "Travaux d'étanchéification",
'4399B' => "Travaux de montage de structures métalliques",
'4399C' => "Travaux de maçonnerie générale et gros œuvre de bâtiment",
'4399C' => "Travaux de maçonnerie générale et gros oeuvre de bâtiment",
'4399D' => "Autres travaux spécialisés de construction",
'4399E' => "Location avec opérateur de matériel de construction",
'4511Z' => "Commerce de voitures et de véhicules automobiles légers",
@ -1139,7 +1139,7 @@ return array(
'4632A' => "Commerce de gros (commerce interentreprises) de viandes de boucherie",
'4632B' => "Commerce de gros (commerce interentreprises) de produits à base de viande",
'4632C' => "Commerce de gros (commerce interentreprises) de volailles et gibier",
'4633Z' => "Commerce de gros (commerce interentreprises) de produits laitiers, œufs, huiles et matières grasses comestibles",
'4633Z' => "Commerce de gros (commerce interentreprises) de produits laitiers, oeufs, huiles et matières grasses comestibles",
'4634Z' => "Commerce de gros (commerce interentreprises) de boissons",
'4635Z' => "Commerce de gros (commerce interentreprises) de produits à base de tabac",
'4636Z' => "Commerce de gros (commerce interentreprises) de sucre, chocolat et confiserie",
@ -1361,8 +1361,8 @@ return array(
'7734Z' => "Location et location-bail de matériels de transport par eau",
'7735Z' => "Location et location-bail de matériels de transport aérien",
'7739Z' => "Location et location-bail d'autres machines, équipements et biens matériels nca",
'7740Z' => "Location-bail de propriété intellectuelle et de produits similaires, à l'exception des œuvres soumises à copyright",
'7810Z' => "Activités des agences de placement de main-d'œuvre",
'7740Z' => "Location-bail de propriété intellectuelle et de produits similaires, à l'exception des oeuvres soumises à copyright",
'7810Z' => "Activités des agences de placement de main-d'oeuvre",
'7820Z' => "Activités des agences de travail temporaire",
'7830Z' => "Autre mise à disposition de ressources humaines",
'7911Z' => "Activités des agences de voyage",
@ -1477,4 +1477,11 @@ return array(
'9820Z' => "Activités indifférenciées des ménages en tant que producteurs de services pour usage propre",
'9900Z' => "Activités des organisations et organismes extraterritoriaux",
'0000Z' => "En instance de chiffrement",
'742C' => "",
'524C' => "",
'8111' => "",
'452A' => "",
'000Z' => "",
'526D' => "",
'8121' => "",
);

File diff suppressed because it is too large Load Diff

View File

@ -29,5 +29,9 @@ return array(
57 => 1119,
58 => 1545,
59 => 1506,
60 => 1111,
61 => 1116,
62 => 1118,
63 => 1115,
64 => 1645,
);

View File

@ -5,11 +5,11 @@ class MBourse
{
protected $siren = false;
protected $iDb;
public function __construct($siren=0, $db = null)
{
$this->siren = $siren;
if ( $db === null ) {
$this->iDb = new WDB();
} else {
@ -174,6 +174,7 @@ class MBourse
$tabRet['coursMax']=$tabTmp['coursMax'];
$timer['infosBoursieres-derniersCours']=microtime(true);
}
return $tabRet;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -484,7 +484,7 @@ function format($matches)
global $Rs, $Rsp, $Rsp2, $Rsp3, $Rsp4;
global $Revol, $Revolp, $Revolp2, $Revolp3;
global $Ra, $Rap, $Rdiff;
global $regR, $regRs, $Y, $Yaff, $PROJEC, $PROJECTAUX, $PROJECCOEFF;
global $regR, $regRs, $Y, $Yaff, $PROJEC, $PROJECTAUX, $PROJECCOEF;
global $tabFormulesRatios, $tabRegX;
$strRetour='$'.$matches[1];
@ -503,30 +503,7 @@ function format($matches)
}
return formatRatio('', $valeur/$tmpAnnees, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']));
} elseif (preg_match('/\{GRAPH\((.*)\)\}/Ui', $strRetour, $matches2)) {
//sendMail('production@scores-decisions.com', 'ylenaour@scores-decisions.com', "Indiscore sur $siren : Trace Graph", $strRetour);
return $matches[1];
} elseif (preg_match("/PROJEC\((R.*),(.*)\)/Ui", $strRetour, $matches2)) {
if (preg_match('/Rs/', $matches2[2])) {
$valeur = $regRs[6];
} else {
$valeur = $regR[6];
}
switch(strtoupper($matches2[1]))
{
//case 'PROJECCOEF': return formatRatio('', PROJECCOEF($valeur, $matches2[2]), strtoupper($tabFormulesRatios[6]['unite'])); break;
case 'PROJEC':
require_once 'Metier/Scores/classMProjection.php';
$projec = new Projection();
$projec->tabRegX = $tabRegX;
$result = $projec->calc($valeur, $matches2[2]);
$Y = $projec->getY();
$Yaff = $projec->getYaff();
$PROJECTAUX = $projec->getProjecTaux();
$PROECCOEFF = $projec->getProjecCoeff();
return formatRatio('', $result, strtoupper($tabFormulesRatios[6]['unite']));
break;
//case 'PROJECTAUX': return formatRatio('', PROJECTAUX($valeur, $matches2[2]), strtoupper($tabFormulesRatios[6]['unite'])); break;
}
} elseif (preg_match('/\$\{(\+|!|)(Rp4|Rp3|Rp2|Rp|Rs|Rsp|Rap|Ra|Rdiff|Revolp2|Revolp|Revol|R|regR)\[(\d+)\]\}/Ui', $strRetour, $matches2)) {
$tmpRatio=$matches2[2];
$tmpRatioId=$matches2[3]*1;
@ -581,18 +558,23 @@ function format($matches)
return $strRetour.' '.$strUnite;
}
/**
*
* @param unknown $valeur
* @param unknown $nbAnnees
*/
function PROJEC($valeur, $nbAnnees)
{
global $tabRegX, $Y, $Yaff, $PROECCOEFF, $PROJECTAUX;
global $tabRegX, $Y, $Yaff, $PROJECCOEF, $PROJECTAUX;
require_once 'Metier/scores/classMProjection.php';
$projec = new Projection();
$projec->tabRegX = $tabRegX;
$result = $projec->calc($valeur, $nbAnnees);
if ( $result !== false ) {
$Y = $projec->getY();
$Y = $projec->getY(); //@todo : ?????
$Yaff = $projec->getYaff();
$PROJECTAUX = $projec->getProjecTaux();
$PROECCOEFF = $projec->getProjecCoeff();
$PROJECCOEF = $projec->getProjecCoeff();
}
}
@ -944,7 +926,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
if (strtoupper(substr($tabIdentite['AutreId'],0,1))=='W') $WALDEC=$tabIdentite['AutreId'];
else $WALDEC='';
// AGE en mois
if ($tabIdentite['DateCreaEt']>0 && $tabIdentite['DateCreaEt']<$tabIdentite['DateCreaEn'])
$dateCrea=$tabIdentite['DateCreaEt'];
@ -959,82 +941,99 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
$DCREN_AA=substr($dateCrea,0,4);
$AGE=$classWdate->nbMoisEntre($dateCrea, date('Ymd'));
$tabBilan = $tabBil = array();
/**
* Bilan - Liste des bilans
*/
// --- Liste des bilans
$tabBilan = $tabBil = $tabRegX = array();
$mBil = new MBilans($siren, $iDb);
$tabBilans = $mBil->listeBilans($accesDist);
$NBBILAN = count($tabBilans);
if ($NBBILAN > 0)
{
/**
* Postes des bilans
*/
foreach ($tabBilans as $millesime => $item)
{
if(in_array($item['typeBilan'], array('S', 'N')))
{
if ($NBBILAN > 0) {
$BILAN = $BILANp = $BILANp2 = $BILANp3 = $BILANp4 = 0;
// --- Postes des bilans
$i = 0;
foreach ($tabBilans as $millesime => $item) {
if ($i > 4) {
break;
}
if ( $item['typeBilan'] == 'N' ) {
$tabBilan[] = $mBil->getBilan(substr($millesime,-10), substr($millesime,0,1), '');
$i++;
} elseif ( $item['typeBilan'] == 'S' ) {
$tabN = $mBil->getBilan(substr($millesime,-10), substr($millesime,0,1), '');
$tabS = $mBil->bilanSimplifie2Normal($tabN);
$tabBilan[] = array_merge($tabN, $tabS);
$i++;
}
$tabRegX[] = $item['millesime'];
}
// Elements provenant des bilans
$EFFBILAN=$tabBilan[0]['YP'];
$nm=$nbMoisBilCumul=$tabBilan[0]['DUREE_MOIS'];
$nmp=$tabBilan[0]['DUREE_MOIS_PRE'];
$BILANDATE=$tabBilan[0]['DATE_CLOTURE'];
$BILANDATEp=$tabBilan[0]['DATE_CLOTURE_PRE'];
if ($BILANDATEp==0) $BILANDATEp=$tabBilan[1]['DATE_CLOTURE'];
$BILAN=$BILANp=$BILANp2=$BILANp3=$BILANp4=0;
$BILANANNEE=substr($BILANDATE,0,4)*1;
$BILANANNEEp=substr($BILANDATEp,0,4)*1;
if ($BILANANNEEp>0) {
$BILANp=1;
$nbMoisBilDate=$classWdate->nbMoisEntre($BILANDATEp, $BILANDATE);
$nbMoisBilCumul+=$nmp;
// --- Bilan le plus récent disponible
if (isset($tabBilan[0])) {
$EFFBILAN = $tabBilan[0]['YP'];
$nm = $nbMoisBilCumul = $tabBilan[0]['DUREE_MOIS'];
$BILANDATE = $tabBilan[0]['DATE_CLOTURE'];
$BILANDATEp = $tabBilan[0]['DATE_CLOTURE_PRE'];
if ($BILANDATEp == 0 && isset($tabBilan[1])) {
$BILANDATEp = $tabBilan[1]['DATE_CLOTURE'];
$BILANANNEEp = substr($BILANDATEp,0,4)*1;
}
$BILANANNEE = substr($BILANDATE,0,4)*1;
$nmp = $tabBilan[0]['DUREE_MOIS_PRE'];
if ($BILANANNEEp > 0) {
$BILANp = 1;
$nbMoisBilDate = $classWdate->nbMoisEntre($BILANDATEp, $BILANDATE);
$nbMoisBilCumul += $nmp;
}
}
$BILANDATEp2 = $tabBilan[2]['DATE_CLOTURE'];
$BILANANNEEp2 = substr($BILANDATEp2,0,4)*1;
$nmp2=$tabBilan[2]['DUREE_MOIS'];
if ($BILANANNEEp2>0) {
$BILANp2=1;
$nbMoisBilDate=$classWdate->nbMoisEntre($BILANDATEp2, $BILANDATE);
$nbMoisBilCumul+=$nmp2;
// --- Elements des 5 bilans les plus récent
if (isset($tabBilan[2])) {
$BILANDATEp2 = $tabBilan[2]['DATE_CLOTURE'];
$BILANANNEEp2 = substr($BILANDATEp2,0,4)*1;
$nmp2=$tabBilan[2]['DUREE_MOIS'];
if ($BILANANNEEp2 > 0) {
$BILANp2 = 1;
$nbMoisBilDate = $classWdate->nbMoisEntre($BILANDATEp2, $BILANDATE);
$nbMoisBilCumul += $nmp2;
}
}
$BILANDATEp3 = $tabBilan[3]['DATE_CLOTURE'];
$BILANANNEEp3=substr($BILANDATEp3,0,4)*1;
$nmp3=$tabBilan[3]['DUREE_MOIS'];
if ($BILANANNEEp3>0) {
$BILANp3=1;
$nbMoisBilDate=$classWdate->nbMoisEntre($BILANDATEp3, $BILANDATE);
$nbMoisBilCumul+=$nmp3;
if (isset($tabBilan[3])) {
$BILANDATEp3 = $tabBilan[3]['DATE_CLOTURE'];
$BILANANNEEp3 = substr($BILANDATEp3,0,4)*1;
$nmp3 = $tabBilan[3]['DUREE_MOIS'];
if ($BILANANNEEp3 > 0) {
$BILANp3 = 1;
$nbMoisBilDate = $classWdate->nbMoisEntre($BILANDATEp3, $BILANDATE);
$nbMoisBilCumul += $nmp3;
}
}
$BILANDATEp4 =$tabBilan[4]['DATE_CLOTURE'];
$BILANANNEEp4=substr($BILANDATEp4,0,4)*1;
$nmp4=$tabBilan[4]['DUREE_MOIS'];
if ($BILANANNEEp4>0) {
$BILANp4=1;
$nbMoisBilDate=$classWdate->nbMoisEntre($BILANDATEp4, $BILANDATE);
//$nbMoisBilCumul+=$nmp4;
if (isset($tabBilan[4])) {
$BILANDATEp4 = $tabBilan[4]['DATE_CLOTURE'];
$BILANANNEEp4 = substr($BILANDATEp4,0,4)*1;
$nmp4=$tabBilan[4]['DUREE_MOIS'];
if ($BILANANNEEp4 > 0) {
$BILANp4 = 1;
$nbMoisBilDate = $classWdate->nbMoisEntre($BILANDATEp4, $BILANDATE);
//$nbMoisBilCumul+=$nmp4;
}
}
// Liste des années de bilans ultérieurs
$BILANANNEE1=$BILANANNEE+1;
$BILANANNEE2=$BILANANNEE+2;
$BILANANNEE3=$BILANANNEE+3;
$BILANANNEE4=$BILANANNEE+4;
$BILANANNEE5=$BILANANNEE+5;
/**
* Calcul des ratios
*/
$tabRatios = calculRatios($tabBilans, $tabIdentite, $accesDist);
$BILANANNEE1 = $BILANANNEE + 1;
$BILANANNEE2 = $BILANANNEE + 2;
$BILANANNEE3 = $BILANANNEE + 3;
$BILANANNEE4 = $BILANANNEE + 4;
$BILANANNEE5 = $BILANANNEE + 5;
// --- Calcul des ratios
$mRatios = new MRatios();
$mRatios->setTrancheEffectif($efftr);
$tabRatios = $mRatios->calcul($tabBilan);
}
$timer['ratios']=microtime(true);
@ -1042,63 +1041,89 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
$tabAnnees = array();
// Tableau d'infos sur les bilans
$i2=0;
if (count($tabRatios)>0)
{
foreach ($tabRatios as $i=>$Rtmp)
{
if (substr($tabBilan[$i]['DATE_CLOTURE'],0,4)>1900){
$tabAnnees[$i]=substr($tabBilan[$i]['DATE_CLOTURE'],0,4);
if (count($tabRatios)>0) {
foreach ($tabRatios as $i => $Ritem) {
if (substr($tabBilan[$i]['DATE_CLOTURE'],0,4) > 1900){
$tabAnnees[$i] = substr($tabBilan[$i]['DATE_CLOTURE'], 0, 4);
}
// Utilisation d'un index texte à cause du webservice
foreach ($Rtmp as $Ridx => $Rmont) {
if ( ($tabBilan[$i]['CONSOLIDE']=='S' && isset($tabRatios[$i+1]) && ($tabBilan[$i+1]['CONSOLIDE']=='S' || ($tabBilan[$i+1]['CONSOLIDE']=='N' && $tabBilan[$i+1]['DATE_CLOTURE']<>$tabBilan[$i]['DATE_CLOTURE'])))
|| ($tabBilan[$i]['CONSOLIDE']=='N' && isset($tabRatios[$i+1]) && ($tabBilan[$i+1]['CONSOLIDE']=='N'||($tabBilan[$i+1]['CONSOLIDE']=='S' && $tabBilan[$i+1]['DATE_CLOTURE']<>$tabBilan[$i]['DATE_CLOTURE']))) ) {
foreach ($Ritem as $Ridx => $Rmont) {
if ( ($tabBilan[$i]['CONSOLIDE']=='S' && isset($tabRatios[$i+1]) && ($tabBilan[$i+1]['CONSOLIDE']=='S'
|| ($tabBilan[$i+1]['CONSOLIDE']=='N' && $tabBilan[$i+1]['DATE_CLOTURE']!=$tabBilan[$i]['DATE_CLOTURE'])))
|| ($tabBilan[$i]['CONSOLIDE']=='N' && isset($tabRatios[$i+1]) && ($tabBilan[$i+1]['CONSOLIDE']=='N'
|| ($tabBilan[$i+1]['CONSOLIDE']=='S' && $tabBilan[$i+1]['DATE_CLOTURE']!=$tabBilan[$i]['DATE_CLOTURE']))) ) {
$Rmont=(($tabRatios[$i][$Ridx]-$tabRatios[$i+1][$Ridx])*100)/abs($tabRatios[$i+1][$Ridx]);
$Rdiffmont=$tabRatios[$i][$Ridx]-$tabRatios[$i+1][$Ridx];
$Rmont = (($tabRatios[$i][$Ridx]-$tabRatios[$i+1][$Ridx])*100)/abs($tabRatios[$i+1][$Ridx]);
$Rdiffmont = $tabRatios[$i][$Ridx]-$tabRatios[$i+1][$Ridx];
} elseif ( ($tabBilan[$i]['CONSOLIDE']=='S'&&isset($tabRatios[$i+1])&&($tabBilan[$i+2]['CONSOLIDE']=='S'
|| ($tabBilan[$i+2]['CONSOLIDE']=='N'&&$tabBilan[$i+2]['DATE_CLOTURE']!=$tabBilan[$i]['DATE_CLOTURE'])))
|| ($tabBilan[$i]['CONSOLIDE']=='N'&&isset($tabRatios[$i+1])&&($tabBilan[$i+2]['CONSOLIDE']=='N'
|| ($tabBilan[$i+2]['CONSOLIDE']=='S'&&$tabBilan[$i+2]['DATE_CLOTURE']!=$tabBilan[$i]['DATE_CLOTURE']))) ) {
$Rmont = (($tabRatios[$i][$Ridx]-$tabRatios[$i+2][$Ridx])*100)/abs($tabRatios[$i+2][$Ridx]);
$Rdiffmont = $tabRatios[$i][$Ridx]-$tabRatios[$i+1][$Ridx];
} elseif ( ($tabBilan[$i]['CONSOLIDE']=='S'&&isset($tabRatios[$i+1])&&($tabBilan[$i+2]['CONSOLIDE']=='S'||($tabBilan[$i+2]['CONSOLIDE']=='N'&&$tabBilan[$i+2]['DATE_CLOTURE']<>$tabBilan[$i]['DATE_CLOTURE'])))
|| ($tabBilan[$i]['CONSOLIDE']=='N'&&isset($tabRatios[$i+1])&&($tabBilan[$i+2]['CONSOLIDE']=='N'||($tabBilan[$i+2]['CONSOLIDE']=='S'&&$tabBilan[$i+2]['DATE_CLOTURE']<>$tabBilan[$i]['DATE_CLOTURE']))) ) {
$Rmont=(($tabRatios[$i][$Ridx]-$tabRatios[$i+2][$Ridx])*100)/abs($tabRatios[$i+2][$Ridx]);
$Rdiffmont=$tabRatios[$i][$Ridx]-$tabRatios[$i+1][$Ridx];
} else {
$Rmont='NS';
$Rdiffmont='NS';
$Rmont = 'NS';
$Rdiffmont = 'NS';
}
$tabRatiosEvol[$i2][$Ridx]=$Rmont;
$tabRatiosDiff[$i2][$Ridx]=$Rdiffmont;
$tabRatiosEvol[$i2][$Ridx] = $Rmont;
$tabRatiosDiff[$i2][$Ridx] = $Rdiffmont;
}
$tabRatiosNew[$i2]=$tabRatios[$i];
$tabRatiosNew[$i2] = $tabRatios[$i];
if ($tabBilan[$i]['CONSOLIDE']!='C') $i2++;
}
$R = $tabRatiosNew[0];
$Rp = $tabRatiosNew[1];
$Rp2= $tabRatiosNew[2]; // Ratios précédents N-2
$Rp3= $tabRatiosNew[3]; // Ratios précédents N-2
$Rp4= $tabRatiosNew[4]; // Ratios précédents N-4
$Rdiff = $tabRatiosDiff[0];
$Revol = $tabRatiosEvol[0];
$Revolp = $tabRatiosEvol[1];
$Revolp2 = $tabRatiosEvol[2];
$Revolp3 = $tabRatiosEvol[3];
}
$timer['anbilans']=microtime(true);
$R=$tabRatiosNew[0];
$Rp=$tabRatiosNew[1];
$Rp2=$tabRatiosNew[2]; // Ratios précédents N-2
$Rp3=$tabRatiosNew[3]; // Ratios précédents N-2
$Rp4=$tabRatiosNew[4]; // Ratios précédents N-4
// Régression : Ratios
$iMax = count($tabRegX);
foreach ($tabFormules as $i2 => $Rtmp) {
for ( $i = 0 ; $i <= $iMax ; $i++ ) {
if ( isset($tabRatios[$i][$Rtmp['id']]) ) {
$regR[$Rtmp['id']][]=$tabRatios[$i][$Rtmp['id']];
} else {
if ( array_key_exists($i, $tabRegX) ) {
//unset($tabRegX[$i]);
}
}
if (isset($tabRatiosSecteurs[$i][$Rtmp['id']])) {
$regRs[$Rtmp['id']][]=$tabRatiosSecteurs[$i][$Rtmp['id']];
}
}
if ( is_array($regR) && array_key_exists($Rtmp['id'], $regR) ) {
$regR[$Rtmp['id']] = array_reverse($regR[$Rtmp['id']]);
}
$Rdiff=$tabRatiosDiff[0];
if ( is_array($regRs) && array_key_exists($Rtmp['id'], $regRs) ) {
$regRs[$Rtmp['id']] = array_reverse($regRs[$Rtmp['id']]);
}
}
// On renverse les tableaux 2008, 2007, 2006... en 2006, 2007, 2008
$tabRegX = array_reverse($tabRegX);
$Revol=$tabRatiosEvol[0];
$Revolp=$tabRatiosEvol[1];
$Revolp2=$tabRatiosEvol[2];
$Revolp3=$tabRatiosEvol[3];
// Régression linéaire : tableau des années - @todo : Delete global
global $tabRegX; // Tableau des années de millesime de bilans
global $Y, $Yaff; // Tableau des années en paramètres + $nbAnnees Projetées
global $PROJECTAUX; // Taux de projection de n à n+$nbAnnees
global $PROJECCOEF;
$tabRegX = array();
foreach ($tabBilans as $k => $tabTmp){
$tabRegX[] = $tabTmp['millesime'];
}
$iMax = count($tabRegX);
$EFFECTIF=$R[24];
if ($EFFECTIF*1==0 && $efftr>0) $EFFECTIF=$efftr;
@ -1124,7 +1149,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
"1 $strNaf $strAnnees ORDER BY annee DESC, id ASC",
INDISCORE_DEBUG, MYSQL_ASSOC);
$anneePre=$tabTmp[0]['annee'];
$anneePre = $tabTmp[0]['annee'];
$iAn=0;
foreach ($tabTmp as $tabTmp2) {
if ($anneePre<>$tabTmp2['annee']){ $iAn++; }
@ -1199,34 +1224,10 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
$timer['ratiosecteur']=microtime(true);
}
// Régression : Ratios
foreach ($tabFormules as $i2 => $Rtmp)
{
for ( $i = 0 ; $i <= $iMax ; $i++ ) {
if ( isset($tabRatios[$i][$Rtmp['id']]) ) {
$regR[$Rtmp['id']][]=$tabRatios[$i][$Rtmp['id']];
} else {
if ( array_key_exists($i, $tabRegX) ) {
//unset($tabRegX[$i]);
}
}
if (isset($tabRatiosSecteurs[$i][$Rtmp['id']])) {
$regRs[$Rtmp['id']][]=$tabRatiosSecteurs[$i][$Rtmp['id']];
}
}
if ( is_array($regR) && array_key_exists($Rtmp['id'], $regR) ) {
$regR[$Rtmp['id']] = array_reverse($regR[$Rtmp['id']]);
}
if ( is_array($regRs) && array_key_exists($Rtmp['id'], $regRs) ) {
$regRs[$Rtmp['id']] = array_reverse($regRs[$Rtmp['id']]);
}
}
// On renverse les tableaux 2008, 2007, 2006... en 2006, 2007, 2008
$tabRegX = array_reverse($tabRegX);
$timer['regression']=microtime(true);
/** Détection fine de l'état de fermeture éventuel à l'INSEE **/
$tabTmp = $iDb->select('insee.insee_even', 'insEVE, insDATEVE',
"insSIREN=$siren AND insEVE IN ('400','410','420','425','MPF','MNP') ORDER BY insDATEVE DESC",
@ -1994,7 +1995,9 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
$tabBilansA = $mBilA->listeBilans(false,2);
$nbBilansA = count($tabBilansA);
if ($nbBilansA > 0) {
$tabRatiosA = calculRatios($tabBilansA, $tabIdentiteA, $accesDist);
$mRatiosA = new MRatios();
$mRatiosA->setTrancheEffectif($tabIdentiteA['EffEnTr']);
$tabRatiosA = $mRatiosA->calcul($tabBilansA);
$SITUACT=$tabRatiosA[0][19];
$Ra=$tabRatiosA[0];
$Rap=$tabRatiosA[1];
@ -2292,7 +2295,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
} else {
$PPNONDIFF=false;
}
/** Entreprise en Zone Prioritaire ? **/
$ZONEPRI=false;
$ZONEPRIZUS=$ZONEPRIAFR=$ZONEPRICUCS=$ZONEPRIZFU=$ZONEPRIZRR=$ZONEPRIZRU='';
@ -2348,7 +2351,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
$DIR2_FONC=$dir['Titre'];
$DIR2_TYPE='PP';
}
$activeRechercheDir = true;
if ($activeRechercheDir){
$tabDir = $iInsee->rechercheDir($dir['Nom'], $dir['Prenom'], '', $dir['NaissDate'], '', 0, 200, 200);
@ -2374,19 +2377,19 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
}
}
}
// Nombre d'entreprises maximum dirigé par un des dirigeants
if ($nbFctDir>$NBDIRLIENS) $NBDIRLIENS=$nbFctDir;
// Nombre de SCI maximum dirigé par un des dirigeants (inclus dans NBDIRLIENS)
if ($nbFctDirSci>$NBDIRSCI) $NBDIRSCI=$nbFctDirSci;
// Nombre de SCI maximum dirigé par un des dirigeants à l'adresse (inclus dans les autres NBDIR...)
if ($nbFctDirSciAdr>$NBDIRSCIADR) $NBDIRSCIADR=$nbFctDirSciAdr;
//@sendMail('production@scores-decisions.com', 'ylenaour@scores-decisions.com', "Indiscore sur $siren : Dirigeant $DIR_NB", print_r($tabDir, true));
}
switch ($dir['Cinf']) {
case 11:
case 12: // Interdiction de gérer ou FP en cours
@ -2398,7 +2401,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
if ($SCORECONF>50) $SCORECONF=50;
$SCOREDIRI=30;
if ($noteSolvabilite>35) $noteSolvabilite=35;
}
$ANNONCEINTERDIT++;
$ANNONCEINTERDITDATE=$classWdate->dateT('d/m/Y','Y-m-d', $dir['DateFct']);
@ -3250,7 +3253,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
} else {
$EFFECTIF_POPU = null;
}
// On filtre les ventes sur les entit<69>s similaires en terme de CA et effectif
$filtreCAEff="";
if ($tabIdentite['TrancheCA']*1==0) {
@ -3258,13 +3261,13 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
} else {
$filtreCAEff.=" AND v.tca=".$tabIdentite['TrancheCA'].' ';
}
if ($tabIdentite['EffEnTr']*1==0) {
$filtreCAEff.=" AND (v.teffEn=0 OR v.teffEn IS NULL) ";
} else {
$filtreCAEff.=" AND v.teffEn=".$tabIdentite['EffEnTr'].' ';
}
/** Ventes par villes, départements et France **/
// Attention, arrondissements pour Paris, Lyon & Marseille
//if ($codeCommuneInsee>=75000 && $codeCommuneInsee<76000)
@ -3338,7 +3341,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
*/
// Locaux
require_once 'Metier/partenaires/classMCadastre.php';
$iCadastre=new MCadastre($iDb);
$iCadastre = new MCadastre($iDb);
$tabTmp=$iCadastre->getLocaux($siren);
if(count($tabTmp)>0 ) {
foreach ($tabTmp as $iTmp=>$cad) {
@ -3349,7 +3352,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
}
}
// Parcelles
$tabTmp=$iCadastre->getParcelles($siren);
$tabTmp = $iCadastre->getParcelles($siren);
foreach ($tabTmp as $iTmp=>$cad) {
$CADTER_NB_TOT++;
if ($cad['parcelDroit']=='P') $CADTER_NB_PROP++;
@ -3509,9 +3512,6 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
$strCommentaire=strtr(preg_replace_callback('/(\{.*\})/U', 'format', $commentaires), array('"'=>'\''));
//echo "<b>$idx</b>";
//eval('echo "'.$strCommentaire.'";');
//echo '<br/><br/>';
// Gestion de la balise <Dxx> signifiant un espacement obligatoire de xx
if (preg_match('/\<D(\d+)\>/Ui', $strCommentaire, $matches)){
$strCommentaire=str_repeat('_', $matches[1]).preg_match('/\<D(\d+)\>/', '', $strCommentaire);
@ -3559,12 +3559,9 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
$tabCommentairesATrier[$idx]=$strCommentaire;
$idxPre=$idx;
}
// sendMail('production@scores-decisions.com', 'ylenaour@scores-decisions.com', "Indiscore sur $siren : Trace1.$numC = $idx", $commentaires);
}
}
//sendMail('production@scores-decisions.com', 'ylenaour@scores-decisions.com', "Indiscore sur $siren : Trace10", 'ici');
//echo '<hr/>';
$tabComment=array();
$tableau=false;
@ -3647,7 +3644,9 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
'CA_Y='.print_r($CA_Y,true).EOL.EOL.
'RCAI_COEF='.$RCAI_COEF.EOL.
'RCAI_Y='.print_r($RCAI_Y,true).EOL.
"PROJECCOEF=$PROJECCOEF".EOL.
"PROJECTAUX=$PROJECTAUX".EOL.
"Y=".print_r($Y,true).EOL.
"Yaff=".print_r($Yaff,true).EOL.
"tabRegX=".print_r($tabRegX,true).EOL.
print_r($tabComment, true).EOL.
@ -3928,7 +3927,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
'adresseDomPre' => $entrep['adresseDom'],
'nbModifs' => $nbModifs,
);
//Sauvegarde et Historisation du score
if ( $actionHisto == 'insert' )
{

View File

@ -0,0 +1,87 @@
<?php
/**
* Miscellaneous functions to clean string.
*/
class Scores_Locale_String
{
/**
* Clean up a string value.
*
* Resulting string contains only alphanumerics and separators.
*
* @param $string
* A string to clean.
* @param $clean_slash
* Whether to clean slashes from the given string.
* @return
* The cleaned string.
*/
public static function cleanstring($string)
{
$transliterate = TRUE;
$reduce_ascii = FALSE;
$output = $string;
// Remove accents and transliterate
if ($transliterate) {
static $i18n_loaded = false;
static $translations = array();
if (!$i18n_loaded) {
$path = realpath(dirname(__FILE__));
if (is_file($path .'/i18n-ascii.txt')) {
$translations = parse_ini_file($path .'/String/i18n-ascii.txt');
}
$i18n_loaded = true;
}
$output = strtr($output, $translations);
}
// Reduce to the subset of ASCII96 letters and numbers
if ($reduce_ascii) {
$pattern = '/[^a-zA-Z0-9\/]+/ ';
$output = preg_replace($pattern, $separator, $output);
}
return $output;
}
public static function cleanutf8($string)
{
$transliterate = TRUE;
$output = $string;
// Remove accents and transliterate
if ($transliterate) {
static $i18n_loaded = false;
static $translations = array();
if (!$i18n_loaded) {
$path = realpath(dirname(__FILE__));
if (is_file($path .'/i18n-ascii.txt')) {
$translations = parse_ini_file($path .'/String/i18n-ascii.txt');
}
$i18n_loaded = true;
}
$output = strtr($output, $translations);
}
return $output;
}
// Fixes the encoding to uf8
public static function fixEncoding($in_str)
{
$cur_encoding = mb_detect_encoding($in_str) ;
if($cur_encoding == "UTF-8" && mb_check_encoding($in_str,"UTF-8"))
return $in_str;
else
return utf8_encode($in_str);
} // fixEncoding
public static function cleanstring_deep($value)
{
$value = is_array($value) ?
array_map('self::cleanstring_deep', $value) :
cleanstring($value);
return $value;
}
}

View File

@ -0,0 +1,564 @@
; global transliteration
[default]
À = "A"
Á = "A"
 = "A"
à = "A"
Ä = "Ae"
Å = "A"
Æ = "A"
Ā = "A"
Ą = "A"
Ă = "A"
Ç = "C"
Ć = "C"
Č = "C"
Ĉ = "C"
Ċ = "C"
Ď = "D"
Đ = "D"
È = "E"
É = "E"
Ê = "E"
Ë = "E"
Ē = "E"
Ę = "E"
Ě = "E"
Ĕ = "E"
Ė = "E"
Ĝ = "G"
Ğ = "G"
Ġ = "G"
Ģ = "G"
Ĥ = "H"
Ħ = "H"
Ì = "I"
Í = "I"
Î = "I"
Ï = "I"
Ī = "I"
Ĩ = "I"
Ĭ = "I"
Į = "I"
İ = "I"
IJ = "IJ"
Ĵ = "J"
Ķ = "K"
Ľ = "K"
Ĺ = "K"
Ļ = "K"
Ŀ = "K"
Ł = "L"
Ñ = "N"
Ń = "N"
Ň = "N"
Ņ = "N"
Ŋ = "N"
Ò = "O"
Ó = "O"
Ô = "O"
Õ = "O"
Ö = "Oe"
Ø = "O"
Ō = "O"
Ő = "O"
Ŏ = "O"
Œ = "OE"
Ŕ = "R"
Ř = "R"
Ŗ = "R"
Ś = "S"
Ş = "S"
Ŝ = "S"
Ș = "S"
Š = "S"
Ť = "T"
Ţ = "T"
Ŧ = "T"
Ț = "T"
Ù = "U"
Ú = "U"
Û = "U"
Ü = "Ue"
Ū = "U"
Ů = "U"
Ű = "U"
Ŭ = "U"
Ũ = "U"
Ų = "U"
Ŵ = "W"
Ŷ = "Y"
Ÿ = "Y"
Ý = "Y"
Ź = "Z"
Ż = "Z"
Ž = "Z"
à = "a"
á = "a"
â = "a"
ã = "a"
ä = "ae"
ā = "a"
ą = "a"
ă = "a"
å = "a"
æ = "ae"
ç = "c"
ć = "c"
č = "c"
ĉ = "c"
ċ = "c"
ď = "d"
đ = "d"
è = "e"
é = "e"
ê = "e"
ë = "e"
ē = "e"
ę = "e"
ě = "e"
ĕ = "e"
ė = "e"
ƒ = "f"
ĝ = "g"
ğ = "g"
ġ = "g"
ģ = "g"
ĥ = "h"
ħ = "h"
ì = "i"
í = "i"
î = "i"
ï = "i"
ī = "i"
ĩ = "i"
ĭ = "i"
į = "i"
ı = "i"
ij = "ij"
ĵ = "j"
ķ = "k"
ĸ = "k"
ł = "l"
ľ = "l"
ĺ = "l"
ļ = "l"
ŀ = "l"
ñ = "n"
ń = "n"
ň = "n"
ņ = "n"
ʼn = "n"
ŋ = "n"
ò = "o"
ó = "o"
ô = "o"
õ = "o"
ö = "oe"
ø = "o"
ō = "o"
ő = "o"
ŏ = "o"
œ = "oe"
ŕ = "r"
ř = "r"
ŗ = "r"
ś = "s"
š = "s"
ş = "s"
ť = "t"
ţ = "t"
ù = "u"
ú = "u"
û = "u"
ü = "ue"
ū = "u"
ů = "u"
ű = "u"
ŭ = "u"
ũ = "u"
ų = "u"
ŵ = "w"
ÿ = "y"
ý = "y"
ŷ = "y"
ż = "z"
ź = "z"
ž = "z"
ß = "ss"
ſ = "ss"
Α = "A"
Ά = "A"
Ἀ = "A"
Ἁ = "A"
Ἂ = "A"
Ἃ = "A"
Ἄ = "A"
Ἅ = "A"
Ἆ = "A"
Ἇ = "A"
ᾈ = "A"
ᾉ = "A"
ᾊ = "A"
ᾋ = "A"
ᾌ = "A"
ᾍ = "A"
ᾎ = "A"
ᾏ = "A"
Ᾰ = "A"
Ᾱ = "A"
Ὰ = "A"
Ά = "A"
ᾼ = "A"
Β = "B"
Γ = "G"
Δ = "D"
Ε = "E"
Έ = "E"
Ἐ = "E"
Ἑ = "E"
Ἒ = "E"
Ἓ = "E"
Ἔ = "E"
Ἕ = "E"
Έ = "E"
Ὲ = "E"
Ζ = "Z"
Η = "I"
Ή = "I"
Ἠ = "I"
Ἡ = "I"
Ἢ = "I"
Ἣ = "I"
Ἤ = "I"
Ἥ = "I"
Ἦ = "I"
Ἧ = "I"
ᾘ = "I"
ᾙ = "I"
ᾚ = "I"
ᾛ = "I"
ᾜ = "I"
ᾝ = "I"
ᾞ = "I"
ᾟ = "I"
Ὴ = "I"
Ή = "I"
ῌ = "I"
Θ = "TH"
Ι = "I"
Ί = "I"
Ϊ = "I"
Ἰ = "I"
Ἱ = "I"
Ἲ = "I"
Ἳ = "I"
Ἴ = "I"
Ἵ = "I"
Ἶ = "I"
Ἷ = "I"
Ῐ = "I"
Ῑ = "I"
Ὶ = "I"
Ί = "I"
Κ = "K"
Λ = "L"
Μ = "M"
Ν = "N"
Ξ = "KS"
Ο = "O"
Ό = "O"
Ὀ = "O"
Ὁ = "O"
Ὂ = "O"
Ὃ = "O"
Ὄ = "O"
Ὅ = "O"
Ὸ = "O"
Ό = "O"
Π = "P"
Ρ = "R"
Ῥ = "R"
Σ = "S"
Τ = "T"
Υ = "Y"
Ύ = "Y"
Ϋ = "Y"
Ὑ = "Y"
Ὓ = "Y"
Ὕ = "Y"
Ὗ = "Y"
Ῠ = "Y"
Ῡ = "Y"
Ὺ = "Y"
Ύ = "Y"
Φ = "F"
Χ = "X"
Ψ = "PS"
Ω = "O"
Ώ = "O"
Ὠ = "O"
Ὡ = "O"
Ὢ = "O"
Ὣ = "O"
Ὤ = "O"
Ὥ = "O"
Ὦ = "O"
Ὧ = "O"
ᾨ = "O"
ᾩ = "O"
ᾪ = "O"
ᾫ = "O"
ᾬ = "O"
ᾭ = "O"
ᾮ = "O"
ᾯ = "O"
Ὼ = "O"
Ώ = "O"
ῼ = "O"
α = "a"
ά = "a"
ἀ = "a"
ἁ = "a"
ἂ = "a"
ἃ = "a"
ἄ = "a"
ἅ = "a"
ἆ = "a"
ἇ = "a"
ᾀ = "a"
ᾁ = "a"
ᾂ = "a"
ᾃ = "a"
ᾄ = "a"
ᾅ = "a"
ᾆ = "a"
ᾇ = "a"
ὰ = "a"
ά = "a"
ᾰ = "a"
ᾱ = "a"
ᾲ = "a"
ᾳ = "a"
ᾴ = "a"
ᾶ = "a"
ᾷ = "a"
β = "b"
γ = "g"
δ = "d"
ε = "e"
έ = "e"
ἐ = "e"
ἑ = "e"
ἒ = "e"
ἓ = "e"
ἔ = "e"
ἕ = "e"
ὲ = "e"
έ = "e"
ζ = "z"
η = "i"
ή = "i"
ἠ = "i"
ἡ = "i"
ἢ = "i"
ἣ = "i"
ἤ = "i"
ἥ = "i"
ἦ = "i"
ἧ = "i"
ᾐ = "i"
ᾑ = "i"
ᾒ = "i"
ᾓ = "i"
ᾔ = "i"
ᾕ = "i"
ᾖ = "i"
ᾗ = "i"
ὴ = "i"
ή = "i"
ῂ = "i"
ῃ = "i"
ῄ = "i"
ῆ = "i"
ῇ = "i"
θ = "th"
ι = "i"
ί = "i"
ϊ = "i"
ΐ = "i"
ἰ = "i"
ἱ = "i"
ἲ = "i"
ἳ = "i"
ἴ = "i"
ἵ = "i"
ἶ = "i"
ἷ = "i"
ὶ = "i"
ί = "i"
ῐ = "i"
ῑ = "i"
ῒ = "i"
ΐ = "i"
ῖ = "i"
ῗ = "i"
κ = "k"
λ = "l"
μ = "m"
ν = "n"
ξ = "ks"
ο = "o"
ό = "o"
ὀ = "o"
ὁ = "o"
ὂ = "o"
ὃ = "o"
ὄ = "o"
ὅ = "o"
ὸ = "o"
ό = "o"
π = "p"
ρ = "r"
ῤ = "r"
ῥ = "r"
σ = "s"
ς = "s"
τ = "t"
υ = "y"
ύ = "y"
ϋ = "y"
ΰ = "y"
ὐ = "y"
ὑ = "y"
ὒ = "y"
ὓ = "y"
ὔ = "y"
ὕ = "y"
ὖ = "y"
ὗ = "y"
ὺ = "y"
ύ = "y"
ῠ = "y"
ῡ = "y"
ῢ = "y"
ΰ = "y"
ῦ = "y"
ῧ = "y"
φ = "f"
χ = "x"
ψ = "ps"
ω = "o"
ώ = "o"
ὠ = "o"
ὡ = "o"
ὢ = "o"
ὣ = "o"
ὤ = "o"
ὥ = "o"
ὦ = "o"
ὧ = "o"
ᾠ = "o"
ᾡ = "o"
ᾢ = "o"
ᾣ = "o"
ᾤ = "o"
ᾥ = "o"
ᾦ = "o"
ᾧ = "o"
ὼ = "o"
ώ = "o"
ῲ = "o"
ῳ = "o"
ῴ = "o"
ῶ = "o"
ῷ = "o"
¨ = ""
΅ = ""
᾿ = ""
= ""
῍ = ""
῝ = ""
῎ = ""
῞ = ""
῏ = ""
῟ = ""
= ""
῁ = ""
΄ = ""
΅ = ""
= ""
῭ = ""
ͺ = ""
= ""
А = "A"
Б = "B"
В = "V"
Г = "G"
Д = "D"
Е = "E"
Ё = "E"
Ж = "ZH"
З = "Z"
И = "I"
Й = "I"
К = "K"
Л = "L"
М = "M"
Н = "N"
О = "O"
П = "P"
Р = "R"
С = "S"
Т = "T"
У = "U"
Ф = "F"
Х = "KH"
Ц = "TS"
Ч = "CH"
Ш = "SH"
Щ = "SHCH"
Ы = "Y"
Э = "E"
Ю = "YU"
Я = "YA"
а = "A"
б = "B"
в = "V"
г = "G"
д = "D"
е = "E"
ё = "E"
ж = "ZH"
з = "Z"
и = "I"
й = "I"
к = "K"
л = "L"
м = "M"
н = "N"
о = "O"
п = "P"
р = "R"
с = "S"
т = "T"
у = "U"
ф = "F"
х = "KH"
ц = "TS"
ч = "CH"
ш = "SH"
щ = "SHCH"
ы = "Y"
э = "E"
ю = "YU"
я = "YA"
Ъ = ""
ъ = ""
Ь = ""
ь = ""
ð = "d"
Ð = "D"
þ = "th"
Þ = "TH"

View File

@ -0,0 +1,2 @@
[default]
№ = "N°"

View File

@ -1,3 +0,0 @@
<?php
include_once(FWK_PATH.'mail/htmlMimeMail5.php');
?>

View File

@ -34,7 +34,7 @@ class WDB
{
$this->errorCode = 0;
$this->errorMsg = '';
$fields = implode(array_keys($toAdd), ',');
foreach (array_values($toAdd) as $key=>$array_values)
$tmp[$key]=checkaddslashes($array_values);
@ -81,7 +81,7 @@ class WDB
{
$this->errorCode = 0;
$this->errorMsg = '';
if ($low_priority) {
$query='UPDATE LOW_PRIORITY '.$table.' SET ';
} else {
@ -131,11 +131,11 @@ class WDB
{
$this->errorCode = 0;
$this->errorMsg = '';
if ($low_priority)
$query='DELETE LOW_PRIORITY QUICK FROM `'.$table.'` WHERE '.$where.' LIMIT 1;';
$query='DELETE LOW_PRIORITY QUICK FROM '.$table.' WHERE '.$where.' LIMIT 1;';
else
$query='DELETE FROM `'.$table.'` WHERE '.$where.' LIMIT 1;';
$query='DELETE FROM '.$table.' WHERE '.$where.' LIMIT 1;';
if ($debug) $tdeb=microtime_float();
@ -171,7 +171,7 @@ class WDB
{
$this->errorCode = 0;
$this->errorMsg = '';
$query="SELECT $fields FROM $table WHERE $where;";
if ($debug) $tdeb=microtime_float();
@ -241,7 +241,12 @@ class WDB
} else {
$duree = 'N/D';
}
file_put_contents(LOG_PATH . '/mysql.log', date('Y-m-d H:i:s') ." - ".$query." - ".$this->errorCode.":".$this->errorMsg." - ".$duree."\n", FILE_APPEND);
if ($this->errorCode == 0) {
$msg = date('Y-m-d H:i:s') ." - DEBUG - ".$this->errorCode.":".$this->errorMsg." - ".$query." - ".$duree;
} else {
$msg = date('Y-m-d H:i:s') ." - ERROR - ".$this->errorCode.":".$this->errorMsg." - ".$query." - ".$duree;
}
file_put_contents(LOG_PATH . '/mysql.log', $msg . "\n", FILE_APPEND);
}
/**
@ -251,7 +256,7 @@ class WDB
{
$this->errorCode = 0;
$this->errorMsg = '';
try {
$stmt = $this->db->query($query);
$this->result = $stmt;
@ -304,30 +309,28 @@ class WDB
if (!$fp) return false;
$res = $this->query($query);
$nbLignes = mysql_num_rows($res);
while ($ligne=$this->fetch(MYSQL_ASSOC)) {
$nbLignes = count($res);
for($i=0; $i<$nbLignes; $i++) {
$ligne = $res[$i];
//Header
if ($i==0) {
$nbCols = count($ligne);
$fields = array();
$header = array();
foreach ($ligne as $libCol=>$col) {
foreach ($ligne as $libCol => $col) {
$header[] = $libCol;
$fields[] = $col;
}
fputcsv($fp, $header, $sep, '"');
fputcsv($fp, $fields, $sep, '"');
}
//Content
else {
$fields = array();
foreach ($ligne as $libCol=>$col) {
$fields[] = $col;
}
fputcsv($fp, $fields, $sep, '"');
}
$i++;
$fields = array();
foreach ($ligne as $libCol => $col) {
$fields[] = $col;
}
fputcsv($fp, $fields, $sep, '"');
}
fclose($fp);
return $nbLignes;
}

View File

@ -34,7 +34,7 @@ class WDB
{
$this->errorCode = 0;
$this->errorMsg = '';
$fields = implode(array_keys($toAdd), ',');
foreach (array_values($toAdd) as $key=>$array_values)
$tmp[$key]=checkaddslashes($array_values);
@ -81,7 +81,7 @@ class WDB
{
$this->errorCode = 0;
$this->errorMsg = '';
if ($low_priority) {
$query='UPDATE LOW_PRIORITY '.$table.' SET ';
} else {
@ -131,11 +131,11 @@ class WDB
{
$this->errorCode = 0;
$this->errorMsg = '';
if ($low_priority)
$query='DELETE LOW_PRIORITY QUICK FROM `'.$table.'` WHERE '.$where.' LIMIT 1;';
$query='DELETE LOW_PRIORITY QUICK FROM '.$table.' WHERE '.$where.' LIMIT 1;';
else
$query='DELETE FROM `'.$table.'` WHERE '.$where.' LIMIT 1;';
$query='DELETE FROM '.$table.' WHERE '.$where.' LIMIT 1;';
if ($debug) $tdeb=microtime_float();
@ -171,7 +171,7 @@ class WDB
{
$this->errorCode = 0;
$this->errorMsg = '';
$query="SELECT $fields FROM $table WHERE $where;";
if ($debug) $tdeb=microtime_float();
@ -241,7 +241,12 @@ class WDB
} else {
$duree = 'N/D';
}
file_put_contents(LOG_PATH . '/mysql.log', date('Y-m-d H:i:s') ." - ".$query." - ".$this->errorCode.":".$this->errorMsg." - ".$duree."\n", FILE_APPEND);
if ($this->errorCode == 0) {
$msg = date('Y-m-d H:i:s') ." - DEBUG - ".$this->errorCode.":".$this->errorMsg." - ".$query." - ".$duree;
} else {
$msg = date('Y-m-d H:i:s') ." - ERROR - ".$this->errorCode.":".$this->errorMsg." - ".$query." - ".$duree;
}
file_put_contents(LOG_PATH . '/mysql.log', $msg . "\n", FILE_APPEND);
}
/**
@ -251,7 +256,7 @@ class WDB
{
$this->errorCode = 0;
$this->errorMsg = '';
try {
$stmt = $this->db->query($query);
$this->result = $stmt;
@ -304,30 +309,28 @@ class WDB
if (!$fp) return false;
$res = $this->query($query);
$nbLignes = mysql_num_rows($res);
while ($ligne=$this->fetch(MYSQL_ASSOC)) {
$nbLignes = count($res);
for($i=0; $i<$nbLignes; $i++) {
$ligne = $res[$i];
//Header
if ($i==0) {
$nbCols = count($ligne);
$fields = array();
$header = array();
foreach ($ligne as $libCol=>$col) {
foreach ($ligne as $libCol => $col) {
$header[] = $libCol;
$fields[] = $col;
}
fputcsv($fp, $header, $sep, '"');
fputcsv($fp, $fields, $sep, '"');
}
//Content
else {
$fields = array();
foreach ($ligne as $libCol=>$col) {
$fields[] = $col;
}
fputcsv($fp, $fields, $sep, '"');
}
$i++;
$fields = array();
foreach ($ligne as $libCol => $col) {
$fields[] = $col;
}
fputcsv($fp, $fields, $sep, '"');
}
fclose($fp);
return $nbLignes;
}

View File

@ -1,215 +0,0 @@
<?php
/*
Atom and RSS Extractor and Displayer
(c) 2007 Scriptol.com - Licence Mozilla 1.1.
commonlib.php
*/
class atomRss {
public $codeErreurHttp=0;
private $Common_Content = array();
function RSS_Tags($item, $type)
{
$y = array();
$y["title"] = $item->getElementsByTagName("title")->item(0)->firstChild->data;
$y["link"] = $item->getElementsByTagName("link")->item(0)->firstChild->data;
$y["description"] = $item->getElementsByTagName("description")->item(0)->firstChild->data;
$tnl = $item->getElementsByTagName("pubDate");
if($tnl->length == 0)
{
$tnl = $item->getElementsByTagName("lastBuildDate");
}
if($tnl->length != 0)
{
$tnl =$tnl->item(0)->firstChild->data;
}
else
$tnl = false;
$y["updated"] = $tnl;
$y["type"] = $type;
array_push($this->Common_Content, $y);
}
function RSS_Channel($channel)
{
$items = $channel->getElementsByTagName("item");
// Processing channel
$this->RSS_Tags($channel, 0); // get description of channel, type 0
// Processing articles
foreach($items as $item)
{
$this->RSS_Tags($item, 1); // get description of article, type 1
}
}
function RSS_Retrieve($url)
{
$doc = new DOMDocument();
$ret = $doc->load($url);
if ($ret===false) {
$page=getUrl($url,'','','',false,'','',3);
$this->codeErreurHtml=$page['code'];
if ($this->codeErreurHttp==302) {
$url=$page['header']['Location'];
$ret = $doc->load($url);
}
}
$channels = $doc->getElementsByTagName("channel");
$this->Common_Content = array();
foreach($channels as $channel)
{
$this->RSS_Channel($channel);
}
return ( count($this->Common_Content) > 0);
}
function Atom_Tags($item)
{
$y = array();
$y["title"] = $item->getElementsByTagName("title")->item(0)->firstChild->data;
$y["link"] = $item->getElementsByTagName("link")->item(0)->getAttribute("href");
$y["description"] = $item->getElementsByTagName("summary")->item(0)->firstChild->data;
$y["updated"] = $item->getElementsByTagName("updated")->item(0)->firstChild->data;
$y["type"] = 1;
array_push($this->Common_Content, $y);
}
function Atom_Feed($doc)
{
$entries = $doc->getElementsByTagName("entry");
if($entries->length == 0) return false;
// Processing feed
$y = array();
$y["title"] = $doc->getElementsByTagName("title")->item(0)->firstChild->data;
$y["link"] = $doc->getElementsByTagName("link")->item(0)->getAttribute("href");
$y["description"] = $doc->getElementsByTagName("subtitle")->item(0)->firstChild->data;
$y["updated"] = $doc->getElementsByTagName("updated")->item(0)->firstChild->data;
$y["type"] = 0;
array_push($this->Common_Content, $y);
// Processing articles
foreach($entries as $entry)
{
$this->Atom_Tags($entry); // get description of article, type 1
}
return true;
}
function Atom_Retrieve($url)
{
$doc = new DOMDocument();
$doc->load($url);
$this->Common_Content = array();
return $this->Atom_Feed($doc);
}
function loadRss($url, $size=200, $chanopt=true, $descopt=true, $dateopt=true)
{
$opened = false;
$page = "";
if($this->Atom_Retrieve($url) === false)
{
if($this->RSS_Retrieve($url) === false)
{
return false;
}
}
if($size > 0)
{
$size += 1; // add one for the channel
$recents = array_slice($this->Common_Content, 0, $size);
}
//$tabFlux=array();
return $recents;
/*
foreach($recents as $article)
{
$type = $article["type"];
if($type == 0)
{
if($chanopt != true) continue;
if($opened == true)
{
$page .="</ul>\n";
$opened = false;
}
//$page .="<b>";
}
else
{
if($opened == false && $chanopt == true)
{
$page .= "<ul>\n";
$opened = true;
}
}
$title = $article["title"];
$link = $article["link"];
$page .= "<".$Common_Style."><a href=\"$link\">$title</a>";
if($descopt != false)
{
$description = $article["description"];
if($description != false)
{
$page .= "<br>$description";
}
}
if($dateopt != false)
{
$updated = $article["updated"];
if($updated != false)
{
$page .= "<br /><font $Common_Date_Font>$updated</font>";
}
}
$page .= "</".$Common_Style.">\n";
/*
if($type == 0)
{
$page .="<br />";
}
*
}
if($opened == true)
{
$page .="</ul>\n";
}
return $page."\n";
*/
}
}
?>

View File

@ -1,111 +0,0 @@
<?php
/*
XML Parser Class
by Eric Rosebrock
http://www.phpfreaks.com
Class originated from: kris@h3x.com AT: http://www.devdump.com/phpxml.php
Usage:
<?php
include 'clsParseXML.php';
$xmlparse = &new ParseXML;
$xml = $xmlparse->GetXMLTree('/path/to/xmlfile.xml');
echo "<pre>";
print_r($xml);
echo "</pre>";
?>
The path to the XML file may be a local file or a URL.
Returns the elements of the XML file into an array with
it's subelements as keys and subarrays.
*/
class ParseXML{
function GetChildren($vals, &$i) {
$children = array(); // Contains node data
if (isset($vals[$i]['value'])){
$children['VALUE'] = $vals[$i]['value'];
}
while (++$i < count($vals)){
switch ($vals[$i]['type']){
case 'cdata':
if (isset($children['VALUE'])){
$children['VALUE'] .= $vals[$i]['value'];
} else {
$children['VALUE'] = $vals[$i]['value'];
}
break;
case 'complete':
if (isset($vals[$i]['attributes'])) {
$children[$vals[$i]['tag']][]['ATTRIBUTES'] = $vals[$i]['attributes'];
$index = count($children[$vals[$i]['tag']])-1;
if (isset($vals[$i]['value'])){
$children[$vals[$i]['tag']][$index]['VALUE'] = $vals[$i]['value'];
} else {
$children[$vals[$i]['tag']][$index]['VALUE'] = '';
}
} else {
if (isset($vals[$i]['value'])){
$children[$vals[$i]['tag']][]['VALUE'] = $vals[$i]['value'];
} else {
$children[$vals[$i]['tag']][]['VALUE'] = '';
}
}
break;
case 'open':
if (isset($vals[$i]['attributes'])) {
$children[$vals[$i]['tag']][]['ATTRIBUTES'] = $vals[$i]['attributes'];
$index = count($children[$vals[$i]['tag']])-1;
$children[$vals[$i]['tag']][$index] = array_merge($children[$vals[$i]['tag']][$index],$this->GetChildren($vals, $i));
} else {
$children[$vals[$i]['tag']][] = $this->GetChildren($vals, $i);
}
break;
case 'close':
return $children;
}
}
}
function GetXMLTree($xmlloc){
if (file_exists($xmlloc)){
$data = implode('', file($xmlloc));
} else {
$fp = fopen($xmlloc,'r');
while(!feof($fp)){
$data = $data . fread($fp, 1024);
}
fclose($fp);
}
$parser = xml_parser_create('ISO-8859-1');
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($parser, $data, $vals, $index);
xml_parser_free($parser);
$tree = array();
$i = 0;
if (isset($vals[$i]['attributes'])) {
$tree[$vals[$i]['tag']][]['ATTRIBUTES'] = $vals[$i]['attributes'];
$index = count($tree[$vals[$i]['tag']])-1;
$tree[$vals[$i]['tag']][$index] = array_merge($tree[$vals[$i]['tag']][$index], $this->GetChildren($vals, $i));
} else {
$tree[$vals[$i]['tag']][] = $this->GetChildren($vals, $i);
}
return $tree;
}
}

View File

@ -1218,6 +1218,7 @@ function annoncesData($siren, $nic, $values = false)
$tabDeja = array();
$tabTmp = explode(',', $values);
$iInsee = new MInsee($iDb);
$iInsee->AnnoncesLegalesVisu = true;
$tabEven = $iInsee->getAnnoncesLegales($siren, 0, $tabTmp);
foreach ($tabTmp as $even){
foreach ($tabEven as $tabAnn){
@ -1815,6 +1816,7 @@ function annoncetxtMultiple($siren, $nic, $values = false)
$tabTmp = explode(',', $values);
}
$iInsee = new MInsee($iDb);
$iInsee->AnnoncesLegalesVisu = true;
$response = $iInsee->getAnnoncesLegales($siren, 0, $tabTmp, false, true);
foreach ($response as $tabAnn){
foreach ($tabAnn['evenements'] as $codEve) {