Library Update
This commit is contained in:
parent
50065e7903
commit
c6b6d63c77
@ -487,19 +487,30 @@ class Metier_Bodacc_MBodacc
|
||||
'Liquidateurs?'=>1900,
|
||||
);
|
||||
|
||||
/**
|
||||
* PDO Connection with Doctrine
|
||||
* @var \Doctrine\DBAL\Connection
|
||||
*/
|
||||
protected $conn;
|
||||
|
||||
protected $iDb;
|
||||
|
||||
public function __construct($db = null)
|
||||
/**
|
||||
* Bodacc
|
||||
* @param \Doctrine\DBAL\Connection $conn
|
||||
*/
|
||||
public function __construct($conn = null)
|
||||
{
|
||||
if ( $db === null ) {
|
||||
$this->iDb = new Metier_Util_Db();
|
||||
} else {
|
||||
$this->iDb = $db;
|
||||
if ($conn === null) {
|
||||
$this->conn = Zend_Registry::get('doctrine');
|
||||
}
|
||||
else {
|
||||
$this->conn = $conn;
|
||||
}
|
||||
|
||||
/** Charge toute la table des tribunaux pour ne pas lancer systématiquement des requètes sur le serveur MySQL
|
||||
** lors des intégrations de Bodacc
|
||||
**/
|
||||
/* Charge toute la table des tribunaux pour ne pas lancer systématiquement des
|
||||
* requètes sur le serveur MySQL lors des intégrations de Bodacc
|
||||
*/
|
||||
$this->tabTribunaux = $this->getTabTribunaux();
|
||||
$this->tabFctDir = $this->getTabFctDir();
|
||||
$this->tabEvenements = $this->getTabEvenements();
|
||||
@ -535,16 +546,28 @@ class Metier_Bodacc_MBodacc
|
||||
$cache = dirname(__FILE__) . '/../Table/BodaccTribunaux.php';
|
||||
if ( file_exists($cache) ) {
|
||||
return include $cache;
|
||||
} else {
|
||||
$rep=$this->iDb->select('jo.tribunaux', 'triCode, triNom, triCP, triSiret', "triCode IS NOT NULL");
|
||||
$tabTribunaux=array();
|
||||
foreach($rep as $k=>$trib) {
|
||||
$dep=substr($trib['triCP'],0,2)*1;
|
||||
if ($dep==97 || $dep==98) $dep=substr($trib['triCP'],0,3)*1;
|
||||
$tabTmp=array($trib['triCode']=>array('nom'=>$trib['triNom'],'siret'=>$trib['triSiret'],'dep'=>$dep));
|
||||
$tabTribunaux=array_merge($tabTribunaux, $tabTmp);
|
||||
}
|
||||
return $tabTribunaux;
|
||||
else {
|
||||
$tribunaux = array();
|
||||
|
||||
$sql = "SELECT triCode, triNom, triCP, triSiret FROM jo.tribunaux WHERE triCode IS NOT NULL";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount()) {
|
||||
while ($t = $stmt->fetch(\PDO::FETCH_OBJ)) {
|
||||
$dep = intval(substr($t->triCP, 0, 2));
|
||||
if ($dep == 97 || $dep == 98) {
|
||||
$dep = intval(substr($t->triCP, 0, 3));
|
||||
}
|
||||
$tribunaux[$t->triCode] = array(
|
||||
'nom' => $t->triNom,
|
||||
'siret' => $t->triSiret,
|
||||
'dep' => $dep
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $tribunaux;
|
||||
}
|
||||
}
|
||||
|
||||
@ -557,13 +580,20 @@ class Metier_Bodacc_MBodacc
|
||||
$cache = dirname(__FILE__) . '/../Table/FctDir.php';
|
||||
if ( file_exists($cache) ) {
|
||||
return include $cache;
|
||||
} else {
|
||||
$rep=$this->iDb->select('jo.bodacc_fonctions', 'codeFct, libelle', '1');
|
||||
$tabRet=array();
|
||||
foreach($rep as $tabFct)
|
||||
$tabRet[$tabFct['codeFct']*1]=$tabFct['libelle'];
|
||||
}
|
||||
else {
|
||||
$result = array();
|
||||
|
||||
return $tabRet;
|
||||
$sql = "SELECT codeFct, libelle FROM jo.bodacc_fonctions";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount()) {
|
||||
while ($row = $stmt->fetch(\PDO::FETCH_OBJ)) {
|
||||
$result[intval($row->codeFct)] = $row->libelle;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -584,22 +614,24 @@ class Metier_Bodacc_MBodacc
|
||||
*/
|
||||
public function getTribunauxParCommune($codeInseeCommune)
|
||||
{
|
||||
$tabTribunaux = array();
|
||||
$result = array();
|
||||
|
||||
$rep = $this->iDb->select('jo.tribunaux t, jo.tribunauxInsee i',
|
||||
't.triId, t.triIdSup, i.CodeInsee, t.triCode, t.triType, t.triNom, t.triCP, LPAD(t.triTel,10,0) AS triTel,
|
||||
LPAD(t.triFax,10,0) AS triFax, t.triWeb, t.triMail, t.triSiret, t.triAdrNum, t.triAdrIndRep,
|
||||
t.triAdrTypeVoie, t.triAdrVoie, t.triAdrComp, t.triVille, t.triStatut, t.triDateCessation, t.triCommentaire,
|
||||
t.triNumGreffe',
|
||||
"i.CodeInsee='$codeInseeCommune' AND i.triId=t.triId ORDER BY t.triNumGreffe DESC, t.triId ASC",
|
||||
false, MYSQL_ASSOC);
|
||||
if (count($rep) > 0) {
|
||||
foreach($rep as $k => $trib) {
|
||||
$tabTribunaux[] = $trib;
|
||||
}
|
||||
$sql = "SELECT t.triId, t.triIdSup, i.CodeInsee, t.triCode, t.triType, t.triNom,
|
||||
t.triCP, LPAD(t.triTel,10,0) AS triTel, LPAD(t.triFax,10,0) AS triFax, t.triWeb,
|
||||
t.triMail, t.triSiret, t.triAdrNum, t.triAdrIndRep, t.triAdrTypeVoie, t.triAdrVoie,
|
||||
t.triAdrComp, t.triVille, t.triStatut, t.triDateCessation, t.triCommentaire,
|
||||
t.triNumGreffe
|
||||
FROM jo.tribunaux t, jo.tribunauxInsee i
|
||||
WHERE i.CodeInsee= :inseeCode AND i.triId=t.triId
|
||||
ORDER BY t.triNumGreffe DESC, t.triId ASC";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('inseeCode', $codeInseeCommune);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount()) {
|
||||
$result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
return $tabTribunaux;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -609,30 +641,28 @@ class Metier_Bodacc_MBodacc
|
||||
*/
|
||||
public function getTribunauxParDep($dep)
|
||||
{
|
||||
$tabTribunaux = array();
|
||||
$result = array();
|
||||
|
||||
$fields = 't.triId, t.triIdSup, t.triCode, t.triType, t.triNom, t.triCP, LPAD(t.triTel,10,0) AS triTel,
|
||||
LPAD(t.triFax,10,0) AS triFax, t.triWeb, t.triMail, t.triSiret, t.triAdrNum, t.triAdrIndRep,
|
||||
t.triAdrTypeVoie, t.triAdrVoie, t.triAdrComp, t.triVille, t.triStatut, t.triDateCessation, t.triCommentaire,
|
||||
t.triNumGreffe';
|
||||
$sql = "SELECT t.triId, t.triIdSup, t.triCode, t.triType, t.triNom, t.triCP,
|
||||
LPAD(t.triTel,10,0) AS triTel, LPAD(t.triFax,10,0) AS triFax, t.triWeb, t.triMail,
|
||||
t.triSiret, t.triAdrNum, t.triAdrIndRep, t.triAdrTypeVoie, t.triAdrVoie, t.triAdrComp,
|
||||
t.triVille, t.triStatut, t.triDateCessation, t.triCommentaire, t.triNumGreffe
|
||||
FROM jo.tribunaux t WHERE t.triCP BETWEEN :dep1 AND :dep2 ORDER BY t.triType ASC";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
if ($dep < 96) {
|
||||
$stmt->bindValue('dep1', $dep.'000');
|
||||
$stmt->bindValue('dep2', $dep.'999');
|
||||
}
|
||||
else {
|
||||
$stmt->bindValue('dep1', $dep.'00');
|
||||
$stmt->bindValue('dep2', $dep.'99');
|
||||
}
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount()) {
|
||||
$result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
if ( $dep<96 ) {
|
||||
$rep = $this->iDb->select(
|
||||
'jo.tribunaux t', $fields,
|
||||
"t.triCP BETWEEN '".$dep."000' AND '".$dep."999' ORDER BY t.triType ASC", false, MYSQL_ASSOC
|
||||
);
|
||||
} else {
|
||||
$rep = $this->iDb->select(
|
||||
'jo.tribunaux t', $fields,
|
||||
"t.triCP BETWEEN '".$dep."00' AND '".$dep."99' ORDER BY t.triType ASC", false, MYSQL_ASSOC
|
||||
);
|
||||
}
|
||||
if ( count($rep)>0 ) {
|
||||
foreach($rep as $k=>$trib) {
|
||||
$tabTribunaux[]=$trib;
|
||||
}
|
||||
}
|
||||
return $tabTribunaux;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -641,12 +671,19 @@ class Metier_Bodacc_MBodacc
|
||||
*/
|
||||
public function getTribunalIdCA($codeTribunal)
|
||||
{
|
||||
$rep = $this->iDb->select('jo.tribunaux', 'triIdSup', "triCode='$codeTribunal'");
|
||||
return $rep[0][0];
|
||||
$sql = "SELECT triIdSup FROM jo.tribunaux WHERE triCode = :code";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('code', $codeTribunal);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount()) {
|
||||
return $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Liste des tribunaux
|
||||
*/
|
||||
public function getListeTribunaux()
|
||||
{
|
||||
@ -662,19 +699,26 @@ class Metier_Bodacc_MBodacc
|
||||
$cache = dirname(__FILE__) . '/../Table/Evenements.php';
|
||||
if ( file_exists($cache) ) {
|
||||
return include $cache;
|
||||
} else {
|
||||
$rep = $this->iDb->select('jo.tabEvenements', 'codEven, libEven, Bodacc_Code, Rubrique, version, lienEtab', '1', false, MYSQL_ASSOC);
|
||||
$tabRet = array();
|
||||
foreach($rep as $k => $even) {
|
||||
$tabRet[$even['codEven']] = array(
|
||||
'libEven' => $even['libEven'],
|
||||
'Bodacc_Code' => $even['Bodacc_Code'],
|
||||
'Rubrique' => $even['Rubrique'],
|
||||
'Version' => $even['version'],
|
||||
'LienEtab' => $even['lienEtab'],
|
||||
}
|
||||
else {
|
||||
$result = array();
|
||||
|
||||
$sql = "SELECT codEven, libEven, Bodacc_Code, Rubrique, version, lienEtab FROM jo.tabEvenements";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount()) {
|
||||
while ($row = $stmt->fetch(\PDO::FETCH_OBJ)) {
|
||||
$result[$row->codEven] = array(
|
||||
'libEven' => $row->libEven,
|
||||
'Bodacc_Code' => $row->Bodacc_Code,
|
||||
'Rubrique' => $row->Rubrique,
|
||||
'Version' => $row->version,
|
||||
'LienEtab' => $row->lienEtab,
|
||||
);
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -687,14 +731,20 @@ class Metier_Bodacc_MBodacc
|
||||
$cache = dirname(__FILE__) . '/../Table/Devises.php';
|
||||
if ( file_exists($cache) ) {
|
||||
return include $cache;
|
||||
} else {
|
||||
$rep = $this->iDb->select('jo.bodacc_devises', 'libDeviseBodacc, devIso', '1', false, MYSQL_ASSOC);
|
||||
$tabDevises = array();
|
||||
foreach($rep as $k => $trib) {
|
||||
$tabTmp = array($trib['libDeviseBodacc'] => $trib['devIso']);
|
||||
$tabDevises = array_merge($tabDevises, $tabTmp);
|
||||
}
|
||||
return $tabDevises;
|
||||
else {
|
||||
$result = array();
|
||||
|
||||
$sql = "SELECT libDeviseBodacc, devIso FROM jo.bodacc_devises";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount()) {
|
||||
while ($row = $stmt->fetch(\PDO::FETCH_OBJ)) {
|
||||
$result[$row->libDeviseBodacc] = $row->devIso;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -781,24 +831,29 @@ class Metier_Bodacc_MBodacc
|
||||
if ($dep != 0 && ($tribunal['dep'])*1 == $dep ) {
|
||||
if ( str_replace('TGIcc', 'TGI', strtr($tribunal['nom'],array('-'=>' ',' DE LA REUNION'=>''))) == $libelleDuTribunal ) {
|
||||
return $code;
|
||||
} elseif ( str_replace('TIcc', 'TI', strtr($tribunal['nom'],array('-'=>' ',' DE LA REUNION'=>''))) == $libelleDuTribunal ) {
|
||||
}
|
||||
elseif ( str_replace('TIcc', 'TI', strtr($tribunal['nom'],array('-'=>' ',' DE LA REUNION'=>''))) == $libelleDuTribunal ) {
|
||||
return $code;
|
||||
} elseif (preg_match('/^PREFECTURE/i',$libelleDuTribunal) && preg_match('/^PREFECTURE/i',$tribunal['nom'])) {
|
||||
}
|
||||
elseif (preg_match('/^PREFECTURE/i',$libelleDuTribunal) && preg_match('/^PREFECTURE/i',$tribunal['nom'])) {
|
||||
return $code;
|
||||
} elseif (preg_match('/^SOUS.PREFECTURE/i',$libelleDuTribunal) && preg_match('/^SOUS.PREFECTURE/i',$tribunal['nom'])) {
|
||||
}
|
||||
elseif (preg_match('/^SOUS.PREFECTURE/i',$libelleDuTribunal) && preg_match('/^SOUS.PREFECTURE/i',$tribunal['nom'])) {
|
||||
$sprefEnBase = trim(preg_replace('/^SOUS.PREFECTURE (DE|DU|D\')/i','',$tribunal['nom']));
|
||||
$sprefParam = trim(strtr(strtr(preg_replace('/^SOUS.PREFECTURE/i','',$libelleDuTribunal), array(
|
||||
'SAINT '=>'ST ', 'SAINTE '=>'STE ', 'BASSIN ARCACHON'=>'ARCACHON', ' (DRÔME)'=>'')),'ÀÂÈÎÔ','AAEIO'));
|
||||
if($sprefEnBase == $sprefParam) {
|
||||
return $code;
|
||||
}
|
||||
} elseif ($dep == 13 && $tribunal['nom'] == 'TGI TARASCON' && $libelleDuTribunal == 'TGI TARASCON SUR RHONE') {
|
||||
}
|
||||
elseif ($dep == 13 && $tribunal['nom'] == 'TGI TARASCON' && $libelleDuTribunal == 'TGI TARASCON SUR RHONE') {
|
||||
return $code;
|
||||
}
|
||||
elseif ($dep==13 && $tribunal['nom']=='TC TARASCON' && $libelleDuTribunal == 'TC TARASCON SUR RHONE') {
|
||||
return $code;
|
||||
}
|
||||
} elseif ( $dep==0 && str_replace('TGIcc', 'TGI', strtr($tribunal['nom'],array('-'=>' ',' DE LA REUNION'=>''))) == $libelleDuTribunal ) {
|
||||
}
|
||||
elseif ( $dep==0 && str_replace('TGIcc', 'TGI', strtr($tribunal['nom'],array('-'=>' ',' DE LA REUNION'=>''))) == $libelleDuTribunal ) {
|
||||
return $code;
|
||||
}
|
||||
elseif ( $dep==978 && str_replace('TGIcc', 'TGI', strtr($tribunal['nom'],array('-'=>' ',' DE LA REUNION'=>''))) == $libelleDuTribunal ) {
|
||||
@ -812,12 +867,15 @@ class Metier_Bodacc_MBodacc
|
||||
}
|
||||
elseif ( $dep==975 && $libelleDuTribunal=='TGI SAINT PIERRE') {
|
||||
return $code;
|
||||
} elseif ( $dep==70 && $libelleDuTribunal=='TC VESOUL') {
|
||||
}
|
||||
elseif ( $dep==70 && $libelleDuTribunal=='TC VESOUL') {
|
||||
return $code;
|
||||
} elseif ( ($dep==95 || $dep==975)
|
||||
}
|
||||
elseif ( ($dep==95 || $dep==975)
|
||||
&& ($libelleDuTribunal=='TRIBUNAL PREMIERE INSTANCE SAINT PIERRE ET MIQUELON' || $libelleDuTribunal=='TPI SAINT PIERRE ET MIQUELON') ) {
|
||||
return $code;
|
||||
} elseif ( ($dep==971 || $dep==985 || $dep==976)
|
||||
}
|
||||
elseif ( ($dep==971 || $dep==985 || $dep==976)
|
||||
&& ($libelleDuTribunal=='TRIBUNAL PREMIERE INSTANCE MAMOUDZOU' || $libelleDuTribunal=='TPI MAMOUDZOU') ) {
|
||||
return $code;
|
||||
}
|
||||
@ -851,11 +909,15 @@ class Metier_Bodacc_MBodacc
|
||||
*/
|
||||
public function getEvenement($codeEven)
|
||||
{
|
||||
$code = ((int)$codeEven)*1;
|
||||
$code = intval($codeEven);
|
||||
if ($code == 0) {
|
||||
return false;
|
||||
}
|
||||
return @$this->tabEvenements[$code]['libEven'];
|
||||
if (array_key_exists($code, $this->tabEvenements)) {
|
||||
return $this->tabEvenements[$code]['libEven'];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -865,11 +927,15 @@ class Metier_Bodacc_MBodacc
|
||||
*/
|
||||
public function getVersionEvenement($codeEven)
|
||||
{
|
||||
$code = ((int)$codeEven)*1;
|
||||
$code = intval($codeEven);
|
||||
if ($code == 0) {
|
||||
return false;
|
||||
}
|
||||
return @$this->tabEvenements[$code]['Version'];
|
||||
if (array_key_exists($code, $this->tabEvenements)) {
|
||||
return $this->tabEvenements[$code]['Version'];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -879,11 +945,15 @@ class Metier_Bodacc_MBodacc
|
||||
*/
|
||||
public function getChapitreEvenement($codeEven)
|
||||
{
|
||||
$code = ((int)$codeEven)*1;
|
||||
$code = intval($codeEven);
|
||||
if ($code == 0) {
|
||||
return false;
|
||||
}
|
||||
return @$this->tabEvenements[$code]['Rubrique'];
|
||||
if (array_key_exists($code, $this->tabEvenements)) {
|
||||
return $this->tabEvenements[$code]['Rubrique'];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -893,9 +963,15 @@ class Metier_Bodacc_MBodacc
|
||||
*/
|
||||
public function getEditionEvenement($codeEven)
|
||||
{
|
||||
$code=$codeEven*1;
|
||||
if ($code==0) return false;
|
||||
return @$this->tabEvenements[$code]['Bodacc_Code'];
|
||||
$code = intval($codeEven);
|
||||
if ($code == 0) {
|
||||
return false;
|
||||
}
|
||||
if (array_key_exists($code, $this->tabEvenements)) {
|
||||
return $this->tabEvenements[$code]['Bodacc_Code'];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -905,11 +981,15 @@ class Metier_Bodacc_MBodacc
|
||||
*/
|
||||
public function isEvenementEtab($codeEven)
|
||||
{
|
||||
$code = $codeEven*1;
|
||||
$code = intval($codeEven);
|
||||
if ($code == 0) {
|
||||
return false;
|
||||
}
|
||||
return @$this->tabEvenements[$code]['LienEtab'];
|
||||
if (array_key_exists($code, $this->tabEvenements)) {
|
||||
return $this->tabEvenements[$code]['LienEtab'];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -940,16 +1020,18 @@ class Metier_Bodacc_MBodacc
|
||||
*/
|
||||
public function addDeviseBodacc($strDevise, $deviseIso)
|
||||
{
|
||||
if (!$this->iDb->insert('jo.bodacc_devises', array(
|
||||
$result = $this->conn->insert('jo.bodacc_devices', array(
|
||||
'libDeviseBodacc' => $strDevise,
|
||||
'devIso' => $deviseIso,
|
||||
'dateInsert' => date('YmdHis')),true)) {
|
||||
return false;
|
||||
'dateInsert' => date('YmdHis')
|
||||
));
|
||||
|
||||
if ($result) {
|
||||
$this->tabDevises = $this->getTabDevises();
|
||||
return true;
|
||||
}
|
||||
|
||||
// On réinitialise le tableau des devises du Bodacc
|
||||
$this->tabDevises=$this->getTabDevises();
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -984,94 +1066,111 @@ class Metier_Bodacc_MBodacc
|
||||
return intval($code);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $strAdministration
|
||||
* @return array
|
||||
*/
|
||||
public function getDirigeants($strAdministration)
|
||||
{
|
||||
$tabRet=array();
|
||||
$strFonctions=$this->regExFonction;
|
||||
$tabNoms=array();
|
||||
if (is_array($strAdministration))
|
||||
$strAdministration=implode('. ', $strAdministration);
|
||||
$strAdministration=trim($strAdministration);
|
||||
$strAdministration=str_ireplace('Nom d\'usage :', 'Nom d\'usage =', trim($strAdministration));
|
||||
if ($strAdministration=='') return $tabRet;
|
||||
$tabAdministration=explode(':', $strAdministration);
|
||||
//file_put_contents('coucou.log',print_r($tabAdministration, 1), FILE_APPEND);
|
||||
$tabFonctions=$tabNoms=$tabCodeFct=$tabOldFct=array();
|
||||
$tabRet = array();
|
||||
$strFonctions = $this->regExFonction;
|
||||
$tabNoms = array();
|
||||
if (is_array($strAdministration)) {
|
||||
$strAdministration = implode('. ', $strAdministration);
|
||||
}
|
||||
$strAdministration = trim($strAdministration);
|
||||
$strAdministration = str_ireplace('Nom d\'usage :', 'Nom d\'usage =', trim($strAdministration));
|
||||
if ($strAdministration == '') {
|
||||
return $tabRet;
|
||||
}
|
||||
$tabAdministration = explode(':', $strAdministration);
|
||||
$tabFonctions = $tabNoms = $tabCodeFct = $tabOldFct = array();
|
||||
|
||||
/**
|
||||
* On boucle sur chaque ligne qui doit contenir NOM PRENOM suivi de la fonction de la ligne suivante
|
||||
* La première ligne ne contient pas de NOM PRENOM car il s'agit de la 1ère ligne
|
||||
*/
|
||||
foreach ($tabAdministration as $i=>$ligne) {
|
||||
|
||||
/** On recherche la fonction et son code fonction de la ligne */
|
||||
foreach ($this->tabDirigeants as $fonction=>$numFct) {
|
||||
|
||||
//file_put_contents('coucou.log','Fonction : '.$fonction, FILE_APPEND);
|
||||
//@todo : provisoire table bdd en utf8
|
||||
foreach ($tabAdministration as $i => $ligne) {
|
||||
// On recherche la fonction et son code fonction de la ligne
|
||||
foreach ($this->tabDirigeants as $fonction => $numFct) {
|
||||
if (preg_match("/(.*)$fonction(.*)$/iu", $ligne, $matches)) {
|
||||
//file_put_contents('coucou.log',"Matched \n", FILE_APPEND);
|
||||
$tabCodeFct[$i]=$numFct;
|
||||
$tabFonctions[$i]=@preg_replace("/($strFonctions)/i", '', $tabAdministration[$i+1]);
|
||||
if(@preg_match("/(partant|ancien|suppression|cha.g|d.part|d.mis(si|is)on|r.vocation)/iu", $tabAdministration[$i+1]))
|
||||
$tabOldFct[$i]=1;
|
||||
else
|
||||
$tabOldFct[$i]=0;
|
||||
$tabFonctions[$i] = '';
|
||||
$tabCodeFct[$i] = $numFct;
|
||||
$tabOldFct[$i] = 0;
|
||||
if (array_key_exists($i+1, $tabAdministration)) {
|
||||
$tabFonctions[$i] = preg_replace("/($strFonctions)/i", '', $tabAdministration[$i+1]);
|
||||
if(preg_match("/(partant|ancien|suppression|cha.g|d.part|d.mis(si|is)on|r.vocation)/iu", $tabAdministration[$i+1])) {
|
||||
$tabOldFct[$i] = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
//file_put_contents('coucou.log',"\n", FILE_APPEND);
|
||||
}
|
||||
} //file_put_contents('coucou.log',print_r($tabFonctions, 1), FILE_APPEND);
|
||||
/** On boucle sur chaque fonction trouvée et on extrait les noms, prénoms **/
|
||||
foreach ($tabFonctions as $i=>$ligne) {//$ligne
|
||||
$numFonction=$tabCodeFct[$i];
|
||||
$oldFonction=$tabOldFct[$i];
|
||||
$ligne=trim($ligne);
|
||||
/** Chaque Noms pour une même focntion doit être séparée par " et " ou ";" */
|
||||
$strNoms=str_replace(' et ', ';', $ligne);
|
||||
$tabNoms=explode(';', $strNoms);
|
||||
$raisonSociale=$nom=$prenom=$usage='';
|
||||
}
|
||||
|
||||
// On boucle sur chaque fonction trouvée et on extrait les noms, prénoms
|
||||
foreach ($tabFonctions as $i => $ligne) {
|
||||
$numFonction = $tabCodeFct[$i];
|
||||
$oldFonction = $tabOldFct[$i];
|
||||
$ligne = trim($ligne);
|
||||
// Chaque Noms pour une même fonction doit être séparée par " et " ou ";" */
|
||||
$strNoms = str_replace(' et ', ';', $ligne);
|
||||
$tabNoms = explode(';', $strNoms);
|
||||
$raisonSociale = $nom = $prenom = $usage = '';
|
||||
foreach ($tabNoms as $noms) {
|
||||
// Cas type NOM (prenom) (Nom usage : XXXX)
|
||||
if (preg_match("/^(.*)\((.*)\).*\((.*)\)/i", $noms, $matches)) {
|
||||
//Cas type NOM (prenom) (Nom usage : XXXX)
|
||||
$nom=trim(str_replace(':', '', $matches[1]));
|
||||
$nom = trim(str_replace(':', '', $matches[1]));
|
||||
if (preg_match("/(.*)repr.sent.e?(.*)/iu", $nom, $matches2)) {
|
||||
$raisonSociale=$matches2[1];
|
||||
$nom=trim(str_replace('par ', '', $matches2[2]));
|
||||
$raisonSociale = $matches2[1];
|
||||
$nom = trim(str_replace('par ', '', $matches2[2]));
|
||||
}
|
||||
$prenom=trim(str_replace('par ', '', $matches[2]));
|
||||
$usage=trim(str_ireplace('Nom d\'usage =', '', $matches[3]));
|
||||
} elseif (preg_match("/^(.*)\((.*)\)/iu", $noms, $matches)) {
|
||||
$nom=trim(str_replace(':', '', $matches[1]));
|
||||
$prenom = trim(str_replace('par ', '', $matches[2]));
|
||||
$usage = trim(str_ireplace('Nom d\'usage =', '', $matches[3]));
|
||||
}
|
||||
elseif (preg_match("/^(.*)\((.*)\)/iu", $noms, $matches)) {
|
||||
$nom = trim(str_replace(':', '', $matches[1]));
|
||||
if (preg_match("/(.*)repr.sent.e?(.*)/iu", $nom, $matches2)) {
|
||||
$raisonSociale=$matches2[1];
|
||||
$nom=trim(str_replace('par ', '', $matches2[2]));
|
||||
$raisonSociale = $matches2[1];
|
||||
$nom = trim(str_replace('par ', '', $matches2[2]));
|
||||
}
|
||||
$prenom=trim($matches[2]);
|
||||
$usage='';
|
||||
//Cas type NOM (prenom)
|
||||
} elseif (preg_match("/^(.*)/i", $noms, $matches)) {
|
||||
$tabNomPrenom=$this->getNomPrenomGenre(trim(str_replace(':', '', $matches[1])));
|
||||
$nom=$tabNomPrenom['Nom'];
|
||||
$prenom=$tabNomPrenom['Prenoms'];
|
||||
$usage='';
|
||||
} else
|
||||
die("Cas non gérée pour cette structure de noms : '$noms'");
|
||||
/** @todo Il manque le cas de repr par pour le STE ??? **/
|
||||
$prenom = trim($matches[2]);
|
||||
$usage = '';
|
||||
}
|
||||
// Cas type NOM (prenom)
|
||||
elseif (preg_match("/^(.*)/i", $noms, $matches)) {
|
||||
$tabNomPrenom = $this->getNomPrenomGenre(trim(str_replace(':', '', $matches[1])));
|
||||
$nom = $tabNomPrenom['Nom'];
|
||||
$prenom = $tabNomPrenom['Prenoms'];
|
||||
$usage = '';
|
||||
}
|
||||
// Cas non gérée
|
||||
else {
|
||||
//die("Cas non gérée pour cette structure de noms : '$noms'");
|
||||
}
|
||||
// @todo Il manque le cas de repr par pour le STE ???
|
||||
if (preg_match('/(en fonction le)|(modification le)/Ui', $nom)) {
|
||||
echo "Je remplace le nom du dirigeant BODACC '$nom' par ";
|
||||
$nom=preg_replace('/\s+en fonction le.*$/','', $nom);
|
||||
$nom=preg_replace('/\s+modification le.*$/','', $nom);
|
||||
echo "'$nom'".PHP_EOL;
|
||||
//echo "Je remplace le nom du dirigeant BODACC '$nom' par ";
|
||||
$nom = preg_replace('/\s+en fonction le.*$/','', $nom);
|
||||
$nom = preg_replace('/\s+modification le.*$/','', $nom);
|
||||
//echo "'$nom'".PHP_EOL;
|
||||
}
|
||||
$tabRet[]=array('fonction'=>$numFonction, 'rs'=>trim(str_replace(',','',$raisonSociale)), 'nom'=>$nom, 'prenom'=>$prenom, 'nomUsage'=>$usage, 'depart'=>$oldFonction);
|
||||
$tabRet[] = array(
|
||||
'fonction' => $numFonction,
|
||||
'rs' => trim(str_replace(',','',$raisonSociale)),
|
||||
'nom' => $nom,
|
||||
'prenom' => $prenom,
|
||||
'nomUsage' => $usage,
|
||||
'depart' => $oldFonction
|
||||
);
|
||||
}
|
||||
}
|
||||
//print_r($tabRet);
|
||||
//$saisie = fgets(STDIN);
|
||||
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
@ -1084,12 +1183,20 @@ class Metier_Bodacc_MBodacc
|
||||
{
|
||||
$noms = $prenoms = $genre = '';
|
||||
$tabMots = preg_split('/( +|\.+)/', $strNomPrenom);
|
||||
foreach ($tabMots as $i=>$prenom) {
|
||||
$tabPrenoms = $this->iDb->select('npaipp.pp_prenoms', 'prenom, genre, mixte, nbTot',
|
||||
"prenom='".addslashes($prenom)."' AND nbTot>100 ORDER BY nbTot DESC",
|
||||
false, MYSQL_ASSOC);
|
||||
if (count($tabPrenoms) > 0) {
|
||||
$tabPrenom = $tabPrenoms[0];
|
||||
foreach ($tabMots as $i => $prenom) {
|
||||
if (strlen(trim($prenom)) == 0 || strlen(trim($prenom, " '*-/")) <= 1) {
|
||||
$noms.= $prenom.' ';
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
$stmt = $this->conn->query("SELECT prenom, genre, mixte, nbTot FROM npaipp.pp_prenoms
|
||||
WHERE prenom='".addslashes($prenom)."' AND nbTot>100 ORDER BY nbTot DESC");
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
continue;
|
||||
}
|
||||
if ($stmt->rowCount()) {
|
||||
$tabPrenom = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
// C'est plutôt le nom de famille au début de la chaîne
|
||||
if ($i == 0) {
|
||||
$noms.= $prenom.' ';
|
||||
@ -1124,25 +1231,31 @@ class Metier_Bodacc_MBodacc
|
||||
*/
|
||||
public function getNumPageAnnonce($bodaccCode, $annee, $num)
|
||||
{
|
||||
$tabRet = array();
|
||||
$bodacc = $this->iDb->select('jo.bodacc',
|
||||
'Bodacc_Code, Bodacc_Annee_Parution, Bodacc_Num, Num_Annonce, Tribunal_Dept, Tribunal_Code, Rubrique_Bodacc, length(annonce) as Long',
|
||||
"Bodacc_Code='$bodaccCode' AND Bodacc_Annee_Parution=$annee AND Bodacc_Num=$num");
|
||||
$result = array();
|
||||
|
||||
foreach ($bodacc as $k=>$ann) {
|
||||
$tabRet[$k] = array(
|
||||
'BodaccCode' => $ann['Bodacc_Code'],
|
||||
'AnneeParution' => $ann['Bodacc_Annee_Parution'],
|
||||
'BodaccNum' => $ann['Bodacc_Num'],
|
||||
'NumAnnonce' => $ann['Num_Annonce'],
|
||||
'Departement' => $ann['Tribunal_Dept'],
|
||||
'Tribunal' => $ann['Tribunal_Code'],
|
||||
'Rubrique' => $ann['Rubrique_Bodacc'],
|
||||
'nbCar' => $ann['Long'],
|
||||
$sql = "SELECT Bodacc_Code, Bodacc_Annee_Parution, Bodacc_Num, Num_Annonce, Tribunal_Dept, Tribunal_Code, Rubrique_Bodacc, length(annonce) as Long
|
||||
FROM jo.bodacc WHERE Bodacc_Code=:code AND Bodacc_Annee_Parution=:annee AND Bodacc_Num=:num";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('code', $bodaccCode);
|
||||
$stmt->bindValue('annee', $annee);
|
||||
$stmt->bindValue('num', $num);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount()) {
|
||||
while ($row = $stmt->fetch(\PDO::FETCH_OBJ)) {
|
||||
$result[] = array(
|
||||
'BodaccCode' => $ann->Bodacc_Code,
|
||||
'AnneeParution' => $ann->Bodacc_Annee_Parution,
|
||||
'BodaccNum' => $ann->Bodacc_Num,
|
||||
'NumAnnonce' => $ann->Num_Annonce,
|
||||
'Departement' => $ann->Tribunal_Dept,
|
||||
'Tribunal' => $ann->Tribunal_Code,
|
||||
'Rubrique' => $ann->Rubrique_Bodacc,
|
||||
'nbCar' => $ann->Long,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $tabRet;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1164,125 +1277,134 @@ class Metier_Bodacc_MBodacc
|
||||
case 'METZG': // Le mercredi
|
||||
case 'MULHOG': // Le mercredi
|
||||
$droitLocal=true;
|
||||
if ($jourJug==3) {
|
||||
if ($jourJug == 3) {
|
||||
echo date('Y/m/d - H:i:s') ." - Droit local : Audiences civiles du mercredi !".PHP_EOL;
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 'THIONG': // Le jeudi à 9h
|
||||
$droitLocal=true;
|
||||
if ($jourJug==4) {
|
||||
$droitLocal = true;
|
||||
if ($jourJug == 4) {
|
||||
echo date('Y/m/d - H:i:s') ." - Droit local : Audiences civiles du jeudi !".PHP_EOL;
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 'SARREG': // Les 1er, 2ème et 4ème mardi
|
||||
$droitLocal=true;
|
||||
$droitLocal = true;
|
||||
if ($jourJug==2 && $jjJug<15 && $jjJug>21) {
|
||||
echo date('Y/m/d - H:i:s') ." - Droit local : Audiences civiles du mardi !".PHP_EOL;
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 'STRASG': // ?
|
||||
$droitLocal=true;
|
||||
$droitLocal = true;
|
||||
//echo date('Y/m/d - H:i:s') ." - Droit local : Audiences civiles de Strasbourg !".PHP_EOL;
|
||||
return 0;
|
||||
break;
|
||||
case 'SAVERG': // Le mardi et 2ème, 3ème et 4ème vendredi
|
||||
$droitLocal=true;
|
||||
if ($jourJug==2 || ($jourJug==5 && $jjJug>7)) {
|
||||
$droitLocal = true;
|
||||
if ($jourJug == 2 || ($jourJug == 5 && $jjJug > 7)) {
|
||||
echo date('Y/m/d - H:i:s') ." - Droit local : Audiences civiles du vendredi !".PHP_EOL;
|
||||
return 1;
|
||||
}
|
||||
case 'COLMAG': // ?
|
||||
$droitLocal=true;
|
||||
$droitLocal = true;
|
||||
//echo date('Y/m/d - H:i:s') ." - Droit local : Audiences civiles de Colmar !".PHP_EOL;
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($droitLocal && preg_match("/insolvabilit.{0,3}notoire/iu", $texteAnnonce))
|
||||
if ($droitLocal && preg_match("/insolvabilit.{0,3}notoire/iu", $texteAnnonce)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getJALparDep($dep)
|
||||
{
|
||||
$tabRet = array();
|
||||
$rep = $this->iDb->select('jo.tabJAL',
|
||||
'id, dep, nomJal, siteWeb, email, adresse, cp, ville, tel, fax, parution, aboAnnuel, infos',
|
||||
"dep=$dep", false, MYSQL_ASSOC);
|
||||
foreach($rep as $k => $jal) {
|
||||
$tabRet[] = $jal;
|
||||
$result = array();
|
||||
|
||||
$sql = "SELECT id, dep, nomJal, siteWeb, email, adresse, cp, ville, tel, fax, parution, aboAnnuel, infos
|
||||
FROM jo.tabJAL WHERE dep = :dep";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('dep', $dep);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount()) {
|
||||
$result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
return $tabRet;
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getListeJalCollecte()
|
||||
{
|
||||
$tabRet = array();
|
||||
$rep = $this->iDb->select('jo.tabJAL', 'id, nomJal', 'sedDateAbo<>0 GROUP BY nomJal ORDER BY nomJal ASC', false, MYSQL_ASSOC);
|
||||
foreach($rep as $k => $jal) {
|
||||
$tabRet['_'.$jal['id']] = $jal['nomJal'];
|
||||
$result = array();
|
||||
|
||||
$sql = "SELECT id, nomJal FROM jo.tabJAL WHERE sedDateAbo!=0 GROUP BY nomJal ORDER BY nomJal ASC";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('dep', $dep);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount()) {
|
||||
while($row = $stmt->fetch(\PDO::FETCH_OBJ)) {
|
||||
$result['_'.$row->id] = $row->nomJal;
|
||||
}
|
||||
}
|
||||
|
||||
return $tabRet;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recherche de l'activité réelle
|
||||
* @param string $siren
|
||||
* @param string $fj
|
||||
* @return string
|
||||
*/
|
||||
public function getActiviteReelle($siren, $fj)
|
||||
{
|
||||
$strEvenVtLg = " AND Rubrique<>'ventes' AND typeEven NOT LIKE '%2700%' AND typeEven NOT LIKE '%2701%' AND typeEven NOT LIKE '%2702%' AND typeEven NOT LIKE '%2703%' AND typeEven NOT LIKE '%2710%' AND typeEven NOT LIKE '%2720%' AND typeEven NOT LIKE '%2721%' AND typeEven NOT LIKE '%2725%' AND typeEven NOT LIKE '%2730%' AND typeEven NOT LIKE '%2740%' AND typeEven NOT LIKE '%2750%' AND typeEven NOT LIKE '%2800%' AND typeEven NOT LIKE '%2840%' AND typeEven NOT LIKE '%2850%' AND typeEven NOT LIKE '%2851%' AND typeEven NOT LIKE '%2860%' AND typeEven NOT LIKE '%2870%' AND typeEven NOT LIKE '%2875%' AND typeEven NOT LIKE '%2880%' AND typeEven NOT LIKE '%2881%' AND typeEven NOT LIKE '%2885%' AND typeEven NOT LIKE '%2890%' AND typeEven NOT LIKE '%2891%' AND typeEven NOT LIKE '%2892%' ";
|
||||
/** Recherche de l'activité réelle **/
|
||||
$bodacc = $this->iDb->select('jo.bodacc_detail', 'Activite',
|
||||
"siren=$siren AND Activite<>'' AND Activite NOT LIKE 'non precis%' $strEvenVtLg ORDER BY Bodacc_Date_Parution DESC LIMIT 0,1", false, MYSQL_ASSOC);
|
||||
$annCap = @$bodacc[0];
|
||||
$strEvenVtLg = " AND Rubrique!='ventes' AND typeEven NOT LIKE '%2700%' AND typeEven NOT LIKE '%2701%' AND typeEven NOT LIKE '%2702%' AND typeEven NOT LIKE '%2703%' AND typeEven NOT LIKE '%2710%' AND typeEven NOT LIKE '%2720%' AND typeEven NOT LIKE '%2721%' AND typeEven NOT LIKE '%2725%' AND typeEven NOT LIKE '%2730%' AND typeEven NOT LIKE '%2740%' AND typeEven NOT LIKE '%2750%' AND typeEven NOT LIKE '%2800%' AND typeEven NOT LIKE '%2840%' AND typeEven NOT LIKE '%2850%' AND typeEven NOT LIKE '%2851%' AND typeEven NOT LIKE '%2860%' AND typeEven NOT LIKE '%2870%' AND typeEven NOT LIKE '%2875%' AND typeEven NOT LIKE '%2880%' AND typeEven NOT LIKE '%2881%' AND typeEven NOT LIKE '%2885%' AND typeEven NOT LIKE '%2890%' AND typeEven NOT LIKE '%2891%' AND typeEven NOT LIKE '%2892%' ";
|
||||
$sql = "SELECT Activite FROM jo.bodacc_detail WHERE siren=:siren AND Activite<>'' AND Activite NOT LIKE 'non precis%' $strEvenVtLg ORDER BY Bodacc_Date_Parution DESC LIMIT 0,1";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('siren', $siren);
|
||||
$stmt->execute();
|
||||
$annCap = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
if ($fj < 7000 || $fj > 7999) {
|
||||
$tabRet['Activite'] = trim($annCap['Activite']);
|
||||
$activite = trim($annCap['Activite']);
|
||||
}
|
||||
|
||||
if ($tabRet['Activite'] == '' && trim($tab['activite']) != '') {
|
||||
$tabRet['Activite'] =trim($tab['activite']);
|
||||
}
|
||||
elseif ($tabRet['Activite'] == '' && ($fj > 90 && $fj < 94 || $fj > 9000 && $fj < 9400) ) {
|
||||
$siretMin = (''.$siren.'00000')*1;
|
||||
$siretMax = (''.$siren.'99999')*1;
|
||||
$bodacc = $this->iDb->select('jo.asso', 'Assoc_Web, Assoc_Mail, Assoc_Objet, Assoc_NObjet',
|
||||
"siren=$siren AND (Assoc_Objet<>'' OR Assoc_NObjet<>'') ORDER BY Date_Parution DESC LIMIT 0,1", false, MYSQL_ASSOC);
|
||||
$annCap = @$bodacc[0];
|
||||
$tabRet['Activite'] = trim($annCap['Assoc_NObjet']);
|
||||
if ($tabRet['Activite'] == '') {
|
||||
$tabRet['Activite'] = trim($annCap['Assoc_Objet']);
|
||||
}
|
||||
if ($tabRet['Web']=='') {
|
||||
$tabRet['Web'] = trim($annCap['Assoc_Web']);
|
||||
}
|
||||
if ($tabRet['Mail']=='') {
|
||||
$tabRet['Mail'] = trim($annCap['Assoc_Mail']);
|
||||
if ($activite == '' && ($fj > 90 && $fj < 94 || $fj > 9000 && $fj < 9400) ) {
|
||||
$sql = "SELECT Assoc_Objet, Assoc_NObjet FROM jo.asso WHERE siren=:siren AND (Assoc_Objet!='' OR Assoc_NObjet!='') ORDER BY Date_Parution DESC LIMIT 0,1";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('siren', $siren);
|
||||
$stmt->execute();
|
||||
$annCap = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
$activite = trim($annCap['Assoc_NObjet']);
|
||||
if ($activite == '') {
|
||||
$activite = trim($annCap['Assoc_Objet']);
|
||||
}
|
||||
}
|
||||
elseif ($tabRet['Activite'] == '' && ($fj < 7000 || $fj > 7999)) {
|
||||
$bodaccHisto = $this->iDb->select('historiques.entrep e, historiques.texte x',
|
||||
'e.ANBASE, e.NOBOD, e.CODTRI, e.JAL, e.DATE, e.CODEVE, e.SSCODE, e.DEPT, e.NOANN, e.ROLE, e.SIREN, e.E1GSIR, e.E1GNIC, x.annonceNum, x.annonceTxt',
|
||||
"e.E1GSIR=$siren AND e.ANBASE=x.annonceNum AND e.DATE BETWEEN 19890101 AND 20041231 AND x.annonceTxt LIKE '%ctivit%' GROUP BY e.ANBASE ORDER BY e.DATE DESC", false, MYSQL_ASSOC);
|
||||
if (count($bodaccHisto) > 0) {
|
||||
foreach ($bodaccHisto as $idx => $ann) {
|
||||
if ($tabCodeTri != '' && $tabCodeTri != @$ann['CODTRI']) {
|
||||
$tabCodeTri = @$ann['CODTRI'];
|
||||
}
|
||||
if ( ($ann['CODEVE'] < 20) || ($ann['CODEVE'] >= 30 && $ann['CODEVE'] < 42)
|
||||
|| ($ann['CODEVE'] >= 51 && $ann['CODEVE'] < 80) ) {
|
||||
elseif ($activite == '' && ($fj < 7000 || $fj > 7999)) {
|
||||
$sql = "SELECT e.ANBASE, e.NOBOD, e.CODTRI, e.JAL, e.DATE, e.CODEVE, e.SSCODE, e.DEPT, e.NOANN, e.ROLE, e.SIREN, e.E1GSIR, e.E1GNIC, x.annonceNum, x.annonceTxt
|
||||
FROM historiques.entrep e, historiques.texte x
|
||||
WHERE e.E1GSIR=:siren AND e.ANBASE=x.annonceNum AND e.DATE BETWEEN 19890101 AND 20041231 AND x.annonceTxt LIKE '%ctivit%'
|
||||
GROUP BY e.ANBASE ORDER BY e.DATE DESC";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('siren', $siren);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount()) {
|
||||
while ($ann = $stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
if ( ($ann['CODEVE'] < 20) || ($ann['CODEVE'] >= 30 && $ann['CODEVE'] < 42) || ($ann['CODEVE'] >= 51 && $ann['CODEVE'] < 80) ) {
|
||||
if (preg_match('/(.*)Activit(?:e|é)(?:.|)\:(.*)(?:Adresse(?:.*|)|Commentaires?|Administration|Etablissement principal|Date d\'effet|Date.de.d.but d.activit.|Capital|Nom commercial)(?:.|)\:/Uisu', $ann['annonceTxt'], $matches))
|
||||
if (strpos(substr($matches[1],-20),'cess') === false && strpos(substr($matches[1],-20),'date') === false) {
|
||||
$tabRet['Activite'] = $matches[2];
|
||||
$activite = $matches[2];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $tabRet['Activite'];
|
||||
|
||||
return $activite;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,11 +54,11 @@ class Metier_Defaillance_Detect
|
||||
protected $PlanDateEnd;
|
||||
protected $PlanPeriod = 120;
|
||||
|
||||
protected $ListEvenProcol = array(50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 1100,1101,1102,1110,1111,1115,1116,1118,1119,1120,1200,1201,1202,1203,1204,1205,1206,1207,1208,1209,1210,1211,1212,1214,1215,1216,1217,1218,1219,1300,1301,1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1346,1400,1401,1402,1403,1404,1405,1406,1407,1408,1409,1410,1411,1412,1413,1414,1415,1416,1417,1418,1419,1420,1421,1423,1425,1430,1431,1435,1436,1440,1445,1450,1455,1460,1463,1465,1470,1472,1474,1475,1480,1490,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1517,1518,1519,1520,1521,1522,1525,1530,1535,1540,1541,1542,1543,1544,1545,1546,1580,1600,1601,1602,1603,1604,1605,1610,1611,1620,1640,1645,1650,1700,1800,1801,1900,1901,1999);
|
||||
protected $ListEvenProcol = array();
|
||||
protected $ListEvenProcolDelete = array();
|
||||
protected $ListEvenAbsorption = array(2720, 2721);
|
||||
protected $ListEvenRadiation = array(40, 41, 42, 2202, 2203, 2204, 2210, 2211, 2212, 6000, 6001, 6002, 6003, 6004, 6005, 6100, 6200, 6300, 6400, 6500, 6600, 6700, 8090);
|
||||
protected $ListEvenDissolution = array(2202, 2203, 2204, 2210, 2211, 2212);
|
||||
protected $ListEvenAbsorption = array();
|
||||
protected $ListEvenRadiation = array();
|
||||
protected $ListEvenDissolution = array();
|
||||
|
||||
protected $ProcolMaxYear = 12;
|
||||
|
||||
@ -87,6 +87,18 @@ class Metier_Defaillance_Detect
|
||||
// Définir la date du jour
|
||||
$this->DateToday = date('Ymd');
|
||||
|
||||
// Liste des événements au départ d'une procol
|
||||
$this->ListEvenProcol = include __DIR__ . '/EvenProcol.php';
|
||||
|
||||
// Liste des événements d'absorption
|
||||
$this->ListEvenAbsorption = include __DIR__ . '/EvenAbsorption.php';
|
||||
|
||||
// Liste des événements de radiation
|
||||
$this->ListEvenRadiation = include __DIR__ . '/EvenRadiation.php';
|
||||
|
||||
// Liste des événements de dissolution
|
||||
$this->ListEvenDissolution = include __DIR__ . '/EvenDissolution.php';
|
||||
|
||||
// Définir la liste des évenéments de la rubrique procol avec le paramètre d'effacement
|
||||
$this->ListEvenProcolDelete = include __DIR__ . '/ProcolDelete.php';
|
||||
}
|
||||
|
@ -92,9 +92,7 @@ return array(
|
||||
'value' => 'CONTINUE',
|
||||
'params' => array(
|
||||
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'PL'),
|
||||
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => array(
|
||||
// @todo : appel de jugement
|
||||
)),
|
||||
array( 'var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 4),
|
||||
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'PA'),
|
||||
),
|
||||
),
|
||||
@ -124,7 +122,6 @@ return array(
|
||||
'value' => 'CONTINUE',
|
||||
'params' => array(
|
||||
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
|
||||
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenProcol'),
|
||||
array( 'var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 1),
|
||||
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
|
||||
),
|
||||
@ -135,7 +132,6 @@ return array(
|
||||
'value' => 'CONTINUE',
|
||||
'params' => array(
|
||||
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
|
||||
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenProcol'),
|
||||
array( 'var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 2),
|
||||
array( 'var' => 'FJ', 'op' => 'MIN', 'value' => 1000),
|
||||
array( 'var' => 'FJ', 'op' => 'MAX', 'value' => 1999),
|
||||
@ -147,7 +143,6 @@ return array(
|
||||
'value' => 'CONTINUE',
|
||||
'params' => array(
|
||||
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
|
||||
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenProcol'),
|
||||
array( 'var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 2),
|
||||
array( 'var' => 'InseeActif', 'op' => 'EGAL', 'value' => 1),
|
||||
array( 'var' => 'FJ', 'op' => 'MAX', 'value' => 9000),
|
||||
@ -161,7 +156,6 @@ return array(
|
||||
'value' => 'CONTINUE',
|
||||
'params' => array(
|
||||
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
|
||||
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenProcol'),
|
||||
array( 'var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 3),
|
||||
array( 'var' => 'RcsActif', 'op' => 'EGAL', 'value' => 1),
|
||||
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
|
||||
@ -173,7 +167,6 @@ return array(
|
||||
'value' => 'CONTINUE',
|
||||
'params' => array(
|
||||
array( 'var' => 'Situation', 'op' => 'EGAL', 'value' => 'P'),
|
||||
array( 'var' => 'Even', 'op' => 'EGAL', 'value' => 'ListEvenProcol'),
|
||||
array( 'var' => 'EvenDelete', 'op' => 'EGAL', 'value' => 4),
|
||||
array( 'var' => 'Situation', 'op' => 'SET', 'value' => 'PA'),
|
||||
),
|
||||
|
5
library/Metier/Defaillance/EvenAbsorption.php
Normal file
5
library/Metier/Defaillance/EvenAbsorption.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
2720, //Fusion/Absorption (entitée absorbée)
|
||||
2721, //Fusion/Absorption (entitée absorbée non identifiée)
|
||||
);
|
9
library/Metier/Defaillance/EvenDissolution.php
Normal file
9
library/Metier/Defaillance/EvenDissolution.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
return array(
|
||||
2202, //Dissolution
|
||||
2203, //Dissolution de la société
|
||||
2204, //Cessation d'activité avec dissolution
|
||||
2210, //Déclaration de dissolution par l'associé unique.
|
||||
2211, //Clôture de la liquidation
|
||||
2212, //Liquidation amiable
|
||||
);
|
174
library/Metier/Defaillance/EvenProcol.php
Normal file
174
library/Metier/Defaillance/EvenProcol.php
Normal file
@ -0,0 +1,174 @@
|
||||
<?php
|
||||
return array(
|
||||
50,
|
||||
51,
|
||||
52,
|
||||
53,
|
||||
54,
|
||||
55,
|
||||
56,
|
||||
57,
|
||||
58,
|
||||
59,
|
||||
60,
|
||||
61,
|
||||
62,
|
||||
63,
|
||||
64,
|
||||
65,
|
||||
66,
|
||||
67,
|
||||
68,
|
||||
69,
|
||||
70,
|
||||
71,
|
||||
72,
|
||||
73,
|
||||
74,
|
||||
75,
|
||||
76,
|
||||
77,
|
||||
78,
|
||||
79,
|
||||
1100, //Ouverture sauvegarde
|
||||
1101, //Jugement arrêtant plan de sauvegarde
|
||||
1102, //Réforme de Redressement Judiciaire en Sauvegarde
|
||||
1110, //Ouverture Sauvegarde Financière Accélérée
|
||||
1111, //Ouverture Sauvegarde Accélérée
|
||||
1115, //Plan de Sauvegarde Financière Accélérée
|
||||
1116, //Plan de Sauvegarde Accélérée
|
||||
1118, //Clôture de sauvegarde accélérée
|
||||
1119, //Clôture de sauvegarde financière accélérée
|
||||
1120, //Exécution du plan de sauvegarde
|
||||
1200, //Redressement Judiciaire
|
||||
1201, //Conversion sauvegarde en Redressement Judiciaire
|
||||
1202, //Renouvellement de la période d'observation
|
||||
1203, //Avis de dépôt de l'état de collocation
|
||||
1204, //Avis de dépôt de l'état des créances
|
||||
1205, //Avis de dépôt de l'état des créances complémentaires nées après jugement d'ouverture
|
||||
1206, //Avis de dépôt de l'état des créances nées après jugement d'ouverture
|
||||
1207, //Règlements amiables
|
||||
1208, //Avis de dépôt du projet de répartition
|
||||
1209, //Règlement judiciaire
|
||||
1210, //Production de titres et créances
|
||||
1211, //Redressement Judiciaire par extension au(x) gérant(s)
|
||||
1212, //Réforme de Liquidation Judiciaire en Redressement Judiciaire
|
||||
1214, //Avis de dépôt de l'état des créances (Loi de 1985)
|
||||
1215, //Jugement de désignation des organes de la procédure
|
||||
1216, //Autre avis de dépôt
|
||||
1217, //Redressement Judiciaire sur résolution du plan de sauvegarde
|
||||
1218, //Avis de dépôt de l'état des créances et du projet de répartition
|
||||
1219, //Avis aux salariés
|
||||
1300, //Conversion Redressement Judiciaire en Liquidation Judiciaire
|
||||
1301, //Ouverture Liquidation Judiciaire
|
||||
1302, //Ouverture Liquidation Judiciaire Simplifiée
|
||||
1303, //Ouverture Liquidation Judiciaire sur résolution du plan
|
||||
1304, //Réouverture Liquidation Judiciaire
|
||||
1305, //Liquidation Judiciaire
|
||||
1306, //Liquidation Judiciaire simplifiée
|
||||
1307, //Conversion sauvegarde en Liquidation Judiciaire
|
||||
1308, //Fin du régime de Liquidation Judiciaire Simplifiée
|
||||
1309, //Conversion Liquidation Judiciaire en Liquidation Judiciaire Simplifiée
|
||||
1310, //Procédure d'insolvabilité européenne
|
||||
1311, //Liquidation Judiciaire par extension au(x) gérant(s)
|
||||
1312, //Liquidation Judiciaire avec continuation d'exploitation
|
||||
1313, //Liquidation Judiciaire sans remise des accessoires
|
||||
1314, //Ouverture Liquidation Judiciaire sur résolution du plan de sauvegarde
|
||||
1346, //Procédure d'insolvabilité (Règlement 1346/2000 du Conseil Européen)
|
||||
1400, //Nomination d'un administrateur judiciaire
|
||||
1401, //Nomination d'un mandataire judiciaire
|
||||
1402, //Nomination d'un représentant des créanciers
|
||||
1403, //Nominnation/Remplacement de commissaire à l'exécution du plan
|
||||
1404, //Prolongement de la mission du commissaire à l'exécution du plan
|
||||
1405, //Nomination d'un juge commissaire
|
||||
1406, //Changement de SYNDIC
|
||||
1407, //Modification de plan
|
||||
1408, //Modification du plan de cession
|
||||
1409, //Modification du plan de continuation
|
||||
1410, //Suite de jugement/règlement/liquidation
|
||||
1411, //Arrêt du plan de cession
|
||||
1412, //Arrêt du plan de cession partielle
|
||||
1413, //Arrêt du plan de continuation
|
||||
1414, //Arrêt du plan de redressement
|
||||
1415, //Prolongement du plan cession
|
||||
1416, //Jugement constatant la bonne exécution du plan
|
||||
1417, //Jugement d'extension de liquidation judiciaire
|
||||
1418, //Jugement d'extension d'une procédure de redressement judiciaire
|
||||
1419, //Jugement d'extension d'une procédure de sauvegarde
|
||||
1420, //Nomination d'un liquidateur judiciaire
|
||||
1421, //Jugement prorogeant le plan de redressement
|
||||
1423, //Entreprise / Fond de commerce en faillite à céder
|
||||
1425, //Plan de cession avec location gérance
|
||||
1430, //Jugement autorisant la poursuite d'activité
|
||||
1431, //Jugement de cessation partielle d'activité
|
||||
1435, //Suspension de l'exécution provisoire
|
||||
1436, //Suspension provisoire des poursuites
|
||||
1440, //Jugement accordant un délai pour déposer la liste des créances
|
||||
1445, //Concordat
|
||||
1450, //Jugement modifiant la date de cessation des paiements
|
||||
1455, //Jugement arrêtant le plan d'apurement du passif
|
||||
1460, //Homologation du plan
|
||||
1463, //Modification du plan de sauvegarde
|
||||
1465, //Clôture de la procédure suite à l'homologation du plan
|
||||
1470, //Fin de mission d'administrateur judiciaire
|
||||
1472, //Fin de mission du commissaire à l'exécution du plan
|
||||
1474, //Modification d'intervenant(s)
|
||||
1475, //Modification de la mission d'un intervenant
|
||||
1480, //Jugement ordonnant la jonction des procédures
|
||||
1490, //Confusion des patrimoines de sociétés
|
||||
1500, //Clôture de la procédure
|
||||
1501, //Clôture de la procédure après cession totale
|
||||
1502, //Clôture de la procédure pour extinction du passif
|
||||
1503, //Clôture de la procédure pour insuffisance d'actif
|
||||
1504, //Clôture sauvegarde pour absence de projet de plan
|
||||
1505, //Appel de jugement
|
||||
1506, //Infirmation Jugement
|
||||
1507, //Extrait d'arrêt de la cour d'appel
|
||||
1508, //Extinction du plan de sauvegarde
|
||||
1509, //Extinction du plan de redressement
|
||||
1510, //Rejet du plan
|
||||
1511, //Résolution du plan de cession
|
||||
1512, //Résolution du plan de continuation
|
||||
1513, //Résolution du plan de sauvegarde
|
||||
1514, //Clôture de la procédure de sauvegarde
|
||||
1515, //Arrêt divers
|
||||
1517, //Rectification d'une erreur matérielle
|
||||
1518, //Infirmation Interdiction de gérer/Faillite Personnelle
|
||||
1519, //Infirmation de jugement d'extension de liquidation judiciaire
|
||||
1520, //Ordonnance
|
||||
1521, //Délocalisation de la procédure vers un autre Tribunal
|
||||
1522, //Clôture de la procédure par dissolution de l'union
|
||||
1525, //Appel du ministère public
|
||||
1530, //Jugement constatant l'impécuniosité de la procédure de liquidation
|
||||
1535, //Jugement modifiant le délai imparti pour la clôture des opérations de liquidation
|
||||
1540, //Ordonnance statuant sur les contestations du projet de répartition
|
||||
1541, //Rétractation de prononcé de liquidation judiciaire sur tierce opposition
|
||||
1542, //Rétractation de jugement d'ouverture d'une procédure de sauvegarde sur tierce opposition
|
||||
1543, //Rétractation de jugement d'ouverture d'une procédure de redressement judiciaire sur tierce opposition
|
||||
1544, //Rétractation de jugement d'ouverture d'une procédure de liquidation judiciaire sur tierce opposition
|
||||
1545, //Rétractation de jugement d'ouverture sur tierce opposition
|
||||
1546, //Rétractation de jugement (sur tierce opposition)
|
||||
1580, //Jugement prononçant la continuation de l'activité par apurement du passif
|
||||
1600, //Faillite personnelle
|
||||
1601, //Interdiction de gérer
|
||||
1602, //Jugement de réhabilitation
|
||||
1603, //Liquidation de biens
|
||||
1604, //Banqueroute
|
||||
1605, //Jugement autorisant la reprise des poursuites individuelles
|
||||
1610, //Faillite personnelle (Loi de 1985)
|
||||
1611, //Interdiction de gérer (Loi de 1985)
|
||||
1620, //Jugement condamnant le dirigeant en comblement du passif
|
||||
1640, //Rétablissement Professionnel
|
||||
1645, //Clôture du Rétablissement Professionnel
|
||||
1650, //Rétablissement Personnel
|
||||
1700, //Décision soumise à publicité
|
||||
1800, //Suppression des mentions relatives à une procédure collective du K-Bis (Art. R123-135)
|
||||
1801, //Clôture de la procédure collective (mention faite au K-Bis, Art. R631-43)
|
||||
1900, //Interdiction temporaire d'exercice de la profession de CAC
|
||||
1901, //Radiation de la liste des CAC
|
||||
1999, //Autre procédure collective
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
26
library/Metier/Defaillance/EvenRadiation.php
Normal file
26
library/Metier/Defaillance/EvenRadiation.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
return array(
|
||||
40,
|
||||
41,
|
||||
42,
|
||||
2202, //Dissolution
|
||||
2203, //Dissolution de la société
|
||||
2204, //Cessation d'activité avec dissolution
|
||||
2210, //Déclaration de dissolution par l'associé unique.
|
||||
2211, //Clôture de la liquidation
|
||||
2212, //Liquidation amiable
|
||||
6000, //Radiation pour cause de clôture de la liquidation (amiable/simplifié/général)
|
||||
6001, //Radiation pour cause de clôture de la liquidation amiable
|
||||
6002, //Radiation pour cause de clôture de la liquidation judiciaire pour insuffisance d'actif
|
||||
6003, //Radiation pour cause de clôture de la liquidation judiciaire
|
||||
6004, //Radiation pour cause de clôture de la liquidation judiciaire simplifié
|
||||
6005, //Radiation pour clôture du plan de cession
|
||||
6100, //Radiation pour cause de décès
|
||||
6200, //Radiation pour cause de mention d'office
|
||||
6300, //Radiation pour cause de non-exercice
|
||||
6400, //Radiation pour cause de transfert
|
||||
6500, //Radiation pour cause de jugement de clôture du plan de cession
|
||||
6600, //Radiation d'un établissement
|
||||
6700, //Radiation
|
||||
8090, //Dissolution d'association
|
||||
);
|
@ -1,46 +1,46 @@
|
||||
<?php
|
||||
return array(
|
||||
1005 => 1,
|
||||
1010 => 1,
|
||||
1050 => 1,
|
||||
1055 => 1,
|
||||
1110 => 1,
|
||||
1111 => 1,
|
||||
1115 => 1,
|
||||
1116 => 1,
|
||||
1118 => 1,
|
||||
1119 => 1,
|
||||
1120 => 1,
|
||||
1203 => 1,
|
||||
1207 => 1,
|
||||
1416 => 1,
|
||||
1435 => 1,
|
||||
1436 => 1,
|
||||
1500 => 2,
|
||||
1501 => 2,
|
||||
1502 => 1,
|
||||
1503 => 2,
|
||||
1504 => 2,
|
||||
1505 => 1,
|
||||
1506 => 1,
|
||||
1507 => 4,
|
||||
1514 => 1,
|
||||
1515 => 1,
|
||||
1517 => 1,
|
||||
1520 => 1,
|
||||
1522 => 1,
|
||||
1525 => 4,
|
||||
1541 => 1,
|
||||
1542 => 1,
|
||||
1543 => 1,
|
||||
1544 => 1,
|
||||
1545 => 1,
|
||||
1550 => 1,
|
||||
1645 => 1,
|
||||
1650 => 1,
|
||||
1700 => 1,
|
||||
1800 => 1,
|
||||
1801 => 1,
|
||||
1900 => 1,
|
||||
1901 => 1,
|
||||
1005 => 1, //Vente aux enchères suite à saisie
|
||||
1010 => 1, //Déclaration de cessation de paiement
|
||||
1050 => 1, //Homologation de la conciliation
|
||||
1055 => 1, //Résolution de la conciliation
|
||||
1110 => 1, //Ouverture Sauvegarde Financière Accélérée
|
||||
1111 => 1, //Ouverture Sauvegarde Accélérée
|
||||
1115 => 1, //Plan de Sauvegarde Financière Accélérée
|
||||
1116 => 1, //Plan de Sauvegarde Accélérée
|
||||
1118 => 1, //Clôture de sauvegarde accélérée
|
||||
1119 => 1, //Clôture de sauvegarde financière accélérée
|
||||
1120 => 1, //Exécution du plan de sauvegarde
|
||||
1203 => 1, //Avis de dépôt de l'état de collocation
|
||||
1207 => 1, //Règlements amiables
|
||||
1416 => 1, //Jugement constatant la bonne exécution du plan
|
||||
1435 => 1, //Suspension de l'exécution provisoire
|
||||
1436 => 1, //Suspension provisoire des poursuites
|
||||
1500 => 2, //Clôture de la procédure
|
||||
1501 => 2, //Clôture de la procédure après cession totale
|
||||
1502 => 1, //Clôture de la procédure pour extinction du passif
|
||||
1503 => 2, //Clôture de la procédure pour insuffisance d'actif
|
||||
1504 => 2, //Clôture sauvegarde pour absence de projet de plan
|
||||
1505 => 1, //Appel de jugement
|
||||
1506 => 1, //Infirmation Jugement
|
||||
1507 => 4, //Extrait d'arrêt de la cour d'appel
|
||||
1514 => 1, //Clôture de la procédure de sauvegarde
|
||||
1515 => 1, //Arrêt divers
|
||||
1517 => 1, //Rectification d'une erreur matérielle
|
||||
1520 => 1, //Ordonnance
|
||||
1522 => 1, //Clôture de la procédure par dissolution de l'union
|
||||
1525 => 4, //Appel du ministère public
|
||||
1541 => 1, //Rétractation de prononcé de liquidation judiciaire sur tierce opposition
|
||||
1542 => 1, //Rétractation de jugement d'ouverture d'une procédure de sauvegarde sur tierce opposition
|
||||
1543 => 1, //Rétractation de jugement d'ouverture d'une procédure de redressement judiciaire sur tierce opposition
|
||||
1544 => 1, //Rétractation de jugement d'ouverture d'une procédure de liquidation judiciaire sur tierce opposition
|
||||
1545 => 1, //Rétractation de jugement d'ouverture sur tierce opposition
|
||||
1550 => 1, //Jugement d'homologation de l'accord
|
||||
1645 => 1, //Clôture du Rétablissement Professionnel
|
||||
1650 => 1, //Rétablissement Personnel
|
||||
1700 => 1, //Décision soumise à publicité
|
||||
1800 => 1, //Suppression des mentions relatives à une procédure collective du K-Bis (Art. R123-135)
|
||||
1801 => 1, //Clôture de la procédure collective (mention faite au K-Bis, Art. R631-43)
|
||||
1900 => 1, //Interdiction temporaire d'exercice de la profession de CAC
|
||||
1901 => 1, //Radiation de la liste des CAC
|
||||
);
|
||||
|
@ -10,31 +10,39 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
const INT = 1000;
|
||||
|
||||
/**
|
||||
* Db Adapter
|
||||
* @var Zend_Db_Adapter_Abstract
|
||||
* PDO Connection with Doctrine
|
||||
* @var \Doctrine\DBAL\Connection
|
||||
*/
|
||||
public $db;
|
||||
protected $conn;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $siren
|
||||
* Infogreffe : Document Bilan
|
||||
* @param \Doctrine\DBAL\Connection $conn
|
||||
*/
|
||||
public function __construct($siren, $db = null)
|
||||
public function __construct($conn = null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//Set type
|
||||
$this->type_document = 'AC';
|
||||
|
||||
//Set Siren
|
||||
$this->siren = $siren;
|
||||
|
||||
//Get defaut database adapter
|
||||
if ($db === null) {
|
||||
$this->db = Zend_Db_Table_Abstract::getDefaultAdapter();
|
||||
} else {
|
||||
$this->db = $db;
|
||||
// Set Database
|
||||
if ($conn === null) {
|
||||
$this->conn = Zend_Registry::get('doctrine');
|
||||
}
|
||||
else {
|
||||
$this->conn = $conn;
|
||||
}
|
||||
|
||||
// Set type
|
||||
$this->type_document = 'AC';
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini le SIREN
|
||||
* @param string $siren
|
||||
* @return void
|
||||
*/
|
||||
public function setSiren($siren)
|
||||
{
|
||||
$this->siren = $siren;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -46,9 +54,7 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
$this->mode_diffusion = 'XL';
|
||||
$this->reference_client = 'list-' . $this->siren;
|
||||
|
||||
$actesM = new Application_Model_JoGreffesActes($this->db);
|
||||
|
||||
//Requete WebService
|
||||
// Requete WebService
|
||||
$actesXML = null;
|
||||
if ( $onlyDb === false ) {
|
||||
//Infogreffe webservice
|
||||
@ -62,18 +68,18 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
//echo $e->getMessage();
|
||||
}
|
||||
if ( $requestOk === true ) {
|
||||
// Set All line state to 0
|
||||
try {
|
||||
$actesM->update(array('actif' => 0), 'siren='.$this->siren);
|
||||
} catch(Zend_Db_Exception $e) {
|
||||
|
||||
$this->conn->update('jo.greffes_actes',
|
||||
array('actif' => 0), array('siren' => $this->siren));
|
||||
}
|
||||
catch(\Doctrine\DBAL\DBALException $e) {}
|
||||
$actesXML = $this->formatList($xml);
|
||||
}
|
||||
}
|
||||
|
||||
//Lecture de la base de données
|
||||
$sql = $actesM->select()
|
||||
->from($actesM, array(
|
||||
// Lecture de la base de données
|
||||
$columns = array(
|
||||
'siren',
|
||||
'numRC',
|
||||
'LPAD(numGreffe,4,0) AS numGreffe',
|
||||
@ -89,18 +95,23 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
'nbpages_acte',
|
||||
'decision_nature',
|
||||
'decision_libelle',
|
||||
'mode_diffusion'
|
||||
))
|
||||
->where('siren=?', $this->siren)
|
||||
->where('actif=1')
|
||||
->order('date_depot DESC')
|
||||
->order('num_depot DESC')
|
||||
->order('num_acte ASC')
|
||||
->order('date_acte DESC');
|
||||
$rows = $actesM->fetchAll($sql);
|
||||
'mode_diffusion',
|
||||
);
|
||||
try {
|
||||
$qb = $this->conn->createQueryBuilder();
|
||||
$qb->select($columns)->from('jo.greffes_actes')
|
||||
->where('siren=:siren')->setParameter('siren', $this->siren)->andWhere('actif=1')
|
||||
->orderBy('date_depot', 'DESC')->orderBy('num_depot', 'DESC')
|
||||
->orderBy('num_acte', 'ASC')->orderBy('date_acte', 'DESC');
|
||||
$stmt = $qb->execute();
|
||||
}
|
||||
catch(\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception(__METHOD__ . ': ' . $e->getMessage());
|
||||
}
|
||||
|
||||
$actes = array();
|
||||
if ( count($rows)>0 ) {
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$rows = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
foreach ( $rows as $row ) {
|
||||
$item = new stdClass();
|
||||
$item->File = $row->pdfLink;
|
||||
@ -141,7 +152,7 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo : En cours
|
||||
* Commande Téléchargement
|
||||
* @param string $depotDate
|
||||
* @param int $depotNum
|
||||
* @param string $acteType
|
||||
@ -154,11 +165,8 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
*/
|
||||
public function getCommandeT($depotDate, $depotNum, $acteType, $acteDate, $acteNum, $orderId = null)
|
||||
{
|
||||
//Lire dans la base de données
|
||||
$actesM = new Application_Model_JoGreffesActes($this->db);
|
||||
|
||||
$sql = $actesM->select()
|
||||
->from($actesM, array(
|
||||
// Lire dans la base de données
|
||||
$columns = array(
|
||||
'siren',
|
||||
'numRC',
|
||||
'LPAD(numGreffe,4,0) AS numGreffe',
|
||||
@ -168,19 +176,23 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
'date_acte',
|
||||
'LPAD(num_acte,2,0) AS num_acte',
|
||||
'type_acte',
|
||||
))
|
||||
->where('siren=?', $this->siren)
|
||||
->where('num_depot=?', $depotNum)
|
||||
->where('date_depot=?', $depotDate)
|
||||
->where('num_acte=?', $acteNum)
|
||||
->where('date_acte=?', $acteDate)
|
||||
->where('type_acte=?', $acteType);
|
||||
);
|
||||
$qb = $this->conn->createQueryBuilder();
|
||||
$qb->select($columns)->from('jo.greffes_actes')
|
||||
->where('siren=:siren')->setParameter('siren', $this->siren)
|
||||
->andWhere('num_depot=:depotNum')->setParameter('depotNum', $depotNum)
|
||||
->andWhere('date_depot=:depotDate')->setParameter('depotDate', $depotDate)
|
||||
->andWhere('num_acte=:acteNum')->setParameter('acteNum', $acteNum)
|
||||
->andWhere('date_acte=:acteDate')->setParameter('acteDate', $acteDate)
|
||||
->andWhere('type_acte=:acteType')->setParameter('acteType', $acteType);
|
||||
$stmt = $qb->execute();
|
||||
|
||||
$row = $actesM->fetchRow($sql);
|
||||
if ( null === $row ) {
|
||||
if ( $stmt->rowCount() == 0 ) {
|
||||
throw new Exception('Not exist');
|
||||
}
|
||||
|
||||
$row = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
|
||||
$this->mode_diffusion = 'T';
|
||||
$this->reference_client = 'T'.date('YmdHis');
|
||||
$this->greffe = $row->numGreffe;
|
||||
@ -206,25 +218,25 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
mkdir($this->config->storage->path . '/' . $dir, 0777, true);
|
||||
}
|
||||
|
||||
//Set filename
|
||||
// Set filename
|
||||
$filename = $dir . '/' . $this->getFileName($date, $num, $type, $options);
|
||||
|
||||
if ( $row->pdfLink != '' ) {
|
||||
|
||||
//Set the filename
|
||||
// Set the filename
|
||||
$filename = $dir . '/' . $row->pdfLink;
|
||||
|
||||
//Check if filename exist
|
||||
// Check if filename exist
|
||||
if ( !file_exists($this->config->storage->path . '/' . $filename) ) {
|
||||
throw new Exception('File not found', self::INT);
|
||||
}
|
||||
|
||||
} elseif ( file_exists($this->config->storage->path . '/' . $filename) ) {
|
||||
|
||||
//Analyser le fichier - Nombre de page et taille
|
||||
// Analyser le fichier - Nombre de page et taille
|
||||
$infos = $this->pdfInfos($this->config->storage->path . '/' . $filename);
|
||||
|
||||
//Enregistrer les infos du fichier dans la base de données
|
||||
// Enregistrer les infos du fichier dans la base de données
|
||||
if (false !== $infos) {
|
||||
$this->dbSetFile(basename($filename), $infos['size'], $infos['pages'], $infos['version']);
|
||||
} else {
|
||||
@ -246,20 +258,19 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
}
|
||||
|
||||
if ( $orderId !== null ) {
|
||||
$commandeM = new Application_Model_Sdv1GreffeCommandesAc();
|
||||
$commandeM->update(array(
|
||||
'cmdUrl'=> $url,
|
||||
'dateCommande' => date('YmdHis'),
|
||||
), 'id='.$orderId);
|
||||
$this->conn->update('sdv1.greffe_commandes_ac', array(
|
||||
'cmdUrl' => $url,
|
||||
'dateCommande' => date('YmdHis')),
|
||||
array('id' => $orderId));
|
||||
}
|
||||
|
||||
//Récupérer le fichier
|
||||
// Récupérer le fichier
|
||||
$getfile = $this->download($url, $filename);
|
||||
|
||||
//Analyser le fichier - Nombre de page et taille
|
||||
// Analyser le fichier - Nombre de page et taille
|
||||
$infos = $this->pdfInfos($getfile);
|
||||
|
||||
//Enregistrer les infos du fichier dans la base de données
|
||||
// Enregistrer les infos du fichier dans la base de données
|
||||
if (false !== $infos) {
|
||||
$this->dbSetFile(basename($filename), $infos['size'], $infos['pages'], $infos['version']);
|
||||
} else {
|
||||
@ -271,22 +282,20 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown $depotDate
|
||||
* @param unknown $depotNum
|
||||
* @param unknown $acteType
|
||||
* @param unknown $acteDate
|
||||
* @param unknown $acteNum
|
||||
* Commande courrier
|
||||
* @param string $depotDate
|
||||
* @param int $depotNum
|
||||
* @param string $acteType
|
||||
* @param string $acteDate
|
||||
* @param int $acteNum
|
||||
* @param string $reference
|
||||
* @throws Exception
|
||||
* @return boolean
|
||||
*/
|
||||
public function getCommandeC($depotDate, $depotNum, $acteType, $acteDate, $acteNum, $reference = '')
|
||||
{
|
||||
//Lire dans la base de données
|
||||
$actesM = new Application_Model_JoGreffesActes();
|
||||
$sql = $actesM->select()
|
||||
->from($actesM, array(
|
||||
// Lire dans la base de données
|
||||
$columns = array(
|
||||
'siren',
|
||||
'numRC',
|
||||
'LPAD(numGreffe,4,0) AS numGreffe',
|
||||
@ -296,22 +305,27 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
'date_acte',
|
||||
'LPAD(num_acte,2,0) AS num_acte',
|
||||
'type_acte',
|
||||
))
|
||||
->where('siren=?', $this->siren)
|
||||
->where('num_depot=?', $depotNum)
|
||||
->where('date_depot=?', $depotDate)
|
||||
->where('num_acte=?', $acteNum)
|
||||
->where('date_acte=?', $acteDate)
|
||||
->where('type_acte=?', $acteType);
|
||||
$row = $actesM->fetchRow($sql);
|
||||
if ( null === $row ) {
|
||||
);
|
||||
$qb = $this->conn->createQueryBuilder();
|
||||
$qb->select($columns)->from('jo.greffes_actes')
|
||||
->where('siren=:siren')->setParameter('siren', $this->siren)
|
||||
->andWhere('num_depot=:depotNum')->setParameter('depotNum', $depotNum)
|
||||
->andWhere('date_depot=:depotDate')->setParameter('depotDate', $depotDate)
|
||||
->andWhere('num_acte=:acteNum')->setParameter('acteNum', $acteNum)
|
||||
->andWhere('date_acte=:acteDate')->setParameter('acteDate', $acteDate)
|
||||
->andWhere('type_acte=:acteType')->setParameter('acteType', $acteType);
|
||||
$stmt = $qb->execute();
|
||||
|
||||
if ($stmt->rowCount() == 0) {
|
||||
throw new Exception('Not exist');
|
||||
}
|
||||
|
||||
$this->mode_diffusion = 'C';
|
||||
$this->reference_client = $reference;
|
||||
|
||||
//Générer les paramètres de commande depuis la base de données
|
||||
$row = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
|
||||
// Générer les paramètres de commande depuis la base de données
|
||||
$this->greffe = $row->numGreffe;
|
||||
$this->dossier_millesime = substr($row->numRC,0,2);
|
||||
$this->dossier_statut = substr($row->numRC,2,1);
|
||||
@ -321,11 +335,11 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
$this->date_acte = $row->date_acte;
|
||||
$this->num = $row->num_acte;
|
||||
|
||||
//Faire la requete
|
||||
// Faire la requete
|
||||
try {
|
||||
$xml = $this->callRequest();
|
||||
} catch(Exception $e) {
|
||||
//La prise en charge du courrier est effective
|
||||
// La prise en charge du courrier est effective
|
||||
if ( $e->getCode() != 17 ) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
@ -525,56 +539,64 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
'actif' => 1,
|
||||
);
|
||||
|
||||
//Only new element are inserted
|
||||
try {
|
||||
$acteM = new Application_Model_JoGreffesActes($this->db);
|
||||
$sql = $acteM->select()
|
||||
->where('siren=?', $list['num_siren'])
|
||||
->where('num_depot=?', intval($list['num_depot']))
|
||||
->where('date_depot=?', $list['date_depot'])
|
||||
//->where('date_acte=?', $depot['date_acte'])
|
||||
->where('num_acte=?', intval($depot['num_acte']))
|
||||
->order('dateInsert DESC');
|
||||
$rows = $acteM->fetchAll($sql);
|
||||
} catch(Zend_Db_Adapter_Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
|
||||
//Insert new element
|
||||
if ( count($rows)==0 ) {
|
||||
try {
|
||||
//Add dateInsert
|
||||
$sql = "SELECT * FROM jo.greffes_actes
|
||||
WHERE siren=:siren AND num_depot=:depotNum AND date_depot=:depotDate
|
||||
AND num_acte=:acteNum ORDER BY dateInsert";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('siren', $this->siren);
|
||||
$stmt->bindValue('depotNum', intval($list['num_depot']));
|
||||
$stmt->bindValue('depotDate', $list['date_depot']);
|
||||
$stmt->bindValue('acteNum', intval($depot['num_acte']));
|
||||
$stmt->execute();
|
||||
// Insert
|
||||
if ($stmt->rowCount() == 0) {
|
||||
$data['dateInsert'] = date('YmdHis');
|
||||
$result = $acteM->insert($data);
|
||||
} catch(Zend_Exception $e) {
|
||||
try {
|
||||
$result = $this->conn->insert('jo.greffes_actes', $data);
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
//Update information
|
||||
// Update
|
||||
else {
|
||||
//Correct multiple item
|
||||
$item = $rows[0];
|
||||
if ( count($rows) > 1 ) {
|
||||
// Get first Item
|
||||
$item = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
|
||||
// Correction anomalie item multiple
|
||||
if ($stmt->rowCount() > 1) {
|
||||
$this->conn->beginTransaction();
|
||||
try {
|
||||
$result = $acteM->delete(array(
|
||||
'siren='.$this->siren,
|
||||
'num_depot='.intval($list['num_depot']),
|
||||
'date_depot="'.$list['date_depot'].'"',
|
||||
'num_acte='.intval($depot['num_acte']),
|
||||
'id!='.$item->id,
|
||||
));
|
||||
} catch(Zend_Exception $e) {
|
||||
while ($rowDel = $stmt->fetch(\PDO::FETCH_OBJ)) {
|
||||
$this->conn->delete('jo.greffes_actes', array(
|
||||
'id' => $rowDel->id));
|
||||
}
|
||||
$this->conn->commit();
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
$this->conn->rollBack();
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// Real Update
|
||||
try {
|
||||
$result = $acteM->update($data, 'id='.$item->id);
|
||||
} catch(Zend_Exception $e) {
|
||||
$result = $this->conn->update('jo.greffes_actes', $data,
|
||||
array('id' => $item->id));
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -598,20 +620,17 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
'pdfDate' => date('Ymd'),
|
||||
);
|
||||
|
||||
$where = array(
|
||||
'siren='.$this->siren,
|
||||
'num_depot='.$this->num_depot,
|
||||
'date_depot="'.$this->date_depot.'"',
|
||||
'date_acte="'.$this->date_acte.'"',
|
||||
'num_acte='.$this->num,
|
||||
$identifier = array(
|
||||
'siren' => $this->siren,
|
||||
'num_depot' => $this->num_depot,
|
||||
'date_depot' => $this->date_depot,
|
||||
'date_acte' => $this->date_acte,
|
||||
'num_acte' => $this->num,
|
||||
);
|
||||
|
||||
try {
|
||||
$acteM = new Application_Model_JoGreffesActes();
|
||||
$result = $acteM->update($data, $where);
|
||||
} catch(Zend_Db_Adapter_Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
} catch(Zend_Db_Exception $e) {
|
||||
$result = $this->conn->update('jo.greffes_actes', $data, $identifier);
|
||||
} catch(\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
|
||||
@ -621,6 +640,4 @@ class Metier_Infogreffe_DocAC extends Metier_Infogreffe_Service
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -6,41 +6,49 @@ require_once dirname(__FILE__) . '/Service.php';
|
||||
*/
|
||||
class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
{
|
||||
|
||||
const INT = 1000;
|
||||
|
||||
/**
|
||||
* Db Adapter
|
||||
* @var Zend_Db_Adapter_Abstract
|
||||
*/
|
||||
public $db;
|
||||
|
||||
/**
|
||||
* Type de comptes
|
||||
* consolides|sociaux
|
||||
* @var string
|
||||
*/
|
||||
public $type_comptes;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $siren
|
||||
* PDO Connection with Doctrine
|
||||
* @var \Doctrine\DBAL\Connection
|
||||
*/
|
||||
public function __construct($siren, $db = null)
|
||||
protected $conn;
|
||||
|
||||
/**
|
||||
* Infogreffe : Document Bilan
|
||||
* @param \Doctrine\DBAL\Connection $conn
|
||||
*/
|
||||
public function __construct($conn = null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//Set type
|
||||
$this->type_document = 'BI';
|
||||
|
||||
//Set Siren
|
||||
$this->siren = $siren;
|
||||
|
||||
//Get defaut database adapter
|
||||
if ($db === null) {
|
||||
$this->db = Zend_Db_Table_Abstract::getDefaultAdapter();
|
||||
} else {
|
||||
$this->db = $db;
|
||||
// Set Database
|
||||
if ($conn === null) {
|
||||
$this->conn = Zend_Registry::get('doctrine');
|
||||
}
|
||||
else {
|
||||
$this->conn = $conn;
|
||||
}
|
||||
|
||||
// Set type
|
||||
$this->type_document = 'BI';
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini le SIREN
|
||||
* @param string $siren
|
||||
* @return void
|
||||
*/
|
||||
public function setSiren($siren)
|
||||
{
|
||||
$this->siren = $siren;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,33 +61,30 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
$this->mode_diffusion = 'XL';
|
||||
$this->reference_client = 'list-' . $this->siren;
|
||||
|
||||
$bilansM = new Application_Model_JoGreffesBilans();
|
||||
|
||||
//Requete WebService
|
||||
// Requete WebService
|
||||
$bilansXML = null;
|
||||
if ( $onlyDb === false ) {
|
||||
//Infogreffe webservice
|
||||
// Infogreffe webservice
|
||||
try {
|
||||
$xml = $this->callRequest();
|
||||
$requestOk = true;
|
||||
} catch( Exception $e ) {
|
||||
$requestOk = false;
|
||||
//@todo : get error message
|
||||
// @todo : get error message
|
||||
}
|
||||
if ( $requestOk === true ) {
|
||||
//Set All line state to 0
|
||||
// Set All line state to 0
|
||||
try {
|
||||
$bilansM->update(array('actif' => 0), 'siren='.$this->siren);
|
||||
} catch(Zend_Db_Exception $e) {
|
||||
|
||||
$this->conn->update('jo.greffes_bilans',
|
||||
array('actif' => 0), array('siren' => $this->siren));
|
||||
}
|
||||
catch(\Doctrine\DBAL\DBALException $e) {}
|
||||
$bilansXML = $this->formatList($xml);
|
||||
}
|
||||
}
|
||||
|
||||
//Lecture de la base de données
|
||||
$sql = $bilansM->select()
|
||||
->from($bilansM, array(
|
||||
// Lecture de la base de données
|
||||
$columns = array(
|
||||
'siren',
|
||||
'numRC',
|
||||
'LPAD(numGreffe,4,0) AS numGreffe',
|
||||
@ -95,17 +100,22 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
'saisie_date',
|
||||
'saisie_code',
|
||||
'pages',
|
||||
))
|
||||
->where('siren=?', $this->siren)
|
||||
->where('actif=1')
|
||||
->order('date_cloture DESC')
|
||||
->order('num_depot DESC')
|
||||
->order('dateInsert DESC');
|
||||
//GROUP BY type_comptes, date_cloture AND ORDER BY num_depot DESC
|
||||
$rows = $bilansM->fetchAll($sql);
|
||||
);
|
||||
try {
|
||||
$qb = $this->conn->createQueryBuilder();
|
||||
$qb->select($columns)->from('jo.greffes_bilans')
|
||||
->where('siren=:siren')->setParameter('siren', $this->siren)->andWhere('actif=1')
|
||||
->orderBy('date_cloture', 'DESC')->orderBy('num_depot', 'DESC')
|
||||
->orderBy('date_cloture', 'DESC');
|
||||
$stmt = $qb->execute();
|
||||
}
|
||||
catch(\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception(__METHOD__ . ': ' . $e->getMessage());
|
||||
}
|
||||
|
||||
$bilans = array();
|
||||
if ( count($rows)>0 ) {
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$rows = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
foreach ( $rows as $row ) {
|
||||
$item = new stdClass();
|
||||
$item->File = $row->pdfLink;
|
||||
@ -183,10 +193,8 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
*/
|
||||
public function getCommandeT($dateCloture = null, $type = 'sociaux', $orderId = null)
|
||||
{
|
||||
//Lire dans la base de données
|
||||
$bilansM = new Application_Model_JoGreffesBilans();
|
||||
$sql = $bilansM->select()
|
||||
->from($bilansM, array(
|
||||
// Lire dans la base de données
|
||||
$columns = array(
|
||||
'siren',
|
||||
'numRC',
|
||||
'LPAD(numGreffe,4,0) AS numGreffe',
|
||||
@ -195,21 +203,25 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
'num_depot',
|
||||
'date_cloture',
|
||||
'type_comptes',
|
||||
))
|
||||
->where('siren=?', $this->siren)
|
||||
->where('date_cloture=?', $dateCloture);
|
||||
);
|
||||
$qb = $this->conn->createQueryBuilder();
|
||||
$qb->select($columns)->from('jo.greffes_bilans')
|
||||
->where('siren=:siren')->setParameter('siren', $this->siren)
|
||||
->andWhere('date_cloture=:date')->setParameter('date', $dateCloture);
|
||||
if ( $type == 'sociaux' || $type == '' ) {
|
||||
$sql->where("(type_comptes='sociaux' OR type_comptes='')");
|
||||
$qb->andWhere("(type_comptes='sociaux' OR type_comptes='')");
|
||||
} else {
|
||||
$sql->where('type_comptes=?',$type);
|
||||
$qb->andWhere('type_comptes=:type')->setParameter('type', $type);
|
||||
}
|
||||
$sql->order('dateInsert DESC')->order('num_depot DESC')->limit(1);
|
||||
$qb->orderBy('dateInsert', 'DESC')->orderBy('num_depot', 'DESC');
|
||||
$stmt = $qb->execute();
|
||||
|
||||
$row = $bilansM->fetchRow($sql);
|
||||
if ( null === $row ) {
|
||||
if ( $stmt->rowCount() == 0 ) {
|
||||
throw new Exception("Element doesn't exist");
|
||||
}
|
||||
|
||||
$row = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
|
||||
$this->mode_diffusion = 'T';
|
||||
$this->reference_client = 'T'.date('YmdHis');
|
||||
$this->greffe = $row->numGreffe;
|
||||
@ -262,11 +274,10 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
}
|
||||
|
||||
if ( $orderId !== null ) {
|
||||
$commandeM = new Application_Model_Sdv1GreffeCommandesBi();
|
||||
$commandeM->update(array(
|
||||
'cmdUrl'=> $url,
|
||||
'dateCommande' => date('YmdHis'),
|
||||
), 'id='.$orderId);
|
||||
$this->conn->update('sdv1.greffe_commandes_bi', array(
|
||||
'cmdUrl' => $url,
|
||||
'dateCommande' => date('YmdHis')),
|
||||
array('id' => $orderId));
|
||||
}
|
||||
|
||||
//Récupérer le fichier
|
||||
@ -298,10 +309,8 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
{
|
||||
$this->mode_diffusion = 'C';
|
||||
|
||||
//Lire dans la base de données
|
||||
$bilansM = new Application_Model_JoGreffesBilans();
|
||||
$sql = $bilansM->select()
|
||||
->from($bilansM, array(
|
||||
// Lire dans la base de données
|
||||
$columns = array(
|
||||
'siren',
|
||||
'numRC',
|
||||
'LPAD(numGreffe,4,0) AS numGreffe',
|
||||
@ -310,21 +319,26 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
'num_depot',
|
||||
'date_cloture',
|
||||
'type_comptes',
|
||||
))
|
||||
->where('siren=?', $this->siren)
|
||||
->where('date_cloture=?', $dateCloture);
|
||||
if ($type=='sociaux') {
|
||||
$sql->where("(type_comptes='sociaux' OR type_comptes='')");
|
||||
);
|
||||
$qb = $this->conn->createQueryBuilder();
|
||||
$qb->select($columns)->from('jo.greffes_bilans')
|
||||
->where('siren=:siren')->setParameter('siren', $this->siren)
|
||||
->andWhere('date_cloture=:date')->setParameter('date', $dateCloture);
|
||||
if ($type == 'sociaux') {
|
||||
$qb->andWhere("(type_comptes='sociaux' OR type_comptes='')");
|
||||
} else {
|
||||
$sql->where('type_comptes=?',$type);
|
||||
$qb->andWhere('type_comptes=:type')->setParameter('type', $type);
|
||||
}
|
||||
$row = $bilansM->fetchRow($sql);
|
||||
if ( null === $row ) {
|
||||
$stmt = $qb->execute();
|
||||
|
||||
if ( $stmt->rowCount() == 0 ) {
|
||||
throw new Exception('Not exist');
|
||||
}
|
||||
|
||||
$this->reference_client = $reference;
|
||||
|
||||
$row = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
|
||||
//Générer les paramètres de commande depuis la base de données
|
||||
$this->greffe = $row->numGreffe;
|
||||
$this->dossier_millesime = substr($row->numRC,0,2);
|
||||
@ -355,7 +369,7 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
*/
|
||||
public function getFileName($type, $dateCloture)
|
||||
{
|
||||
if ($type=='') {
|
||||
if ($type == '') {
|
||||
$type = 'sociaux';
|
||||
}
|
||||
$date = substr($dateCloture,0,4).substr($dateCloture,5,2).substr($dateCloture,8,2);
|
||||
@ -372,7 +386,7 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
*/
|
||||
public function getFilePath($type, $dateCloture)
|
||||
{
|
||||
if ($type=='') {
|
||||
if ($type == '') {
|
||||
$type = 'sociaux';
|
||||
}
|
||||
return 'bilans' . '/' . $type . '/' . substr($dateCloture,0,4);
|
||||
@ -392,10 +406,8 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
$bilan_complet = $liste_bilan_complet->getElementsByTagName('bilan_complet');
|
||||
|
||||
$bilans = array();
|
||||
if ( count($bilan_complet)>0 )
|
||||
{
|
||||
foreach( $bilan_complet as $element )
|
||||
{
|
||||
if (count($bilan_complet) > 0) {
|
||||
foreach( $bilan_complet as $element ) {
|
||||
$bilan = array();
|
||||
$num_gest = $element->getElementsByTagName('num_gest')->item(0);
|
||||
$bilan['num_gest']['greffe'] = $num_gest->getElementsByTagName('greffe')->item(0)->nodeValue;
|
||||
@ -412,8 +424,7 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
$bilan['num_depot'] = $element->getElementsByTagName('num_depot')->item(0)->nodeValue;
|
||||
$bilan['type_comptes'] = $element->getElementsByTagName('type_comptes')->item(0)->nodeValue;
|
||||
$mode_diffusion = $element->getElementsByTagName('mode_diffusion')->item(0)->getElementsByTagName('mode');
|
||||
foreach($mode_diffusion as $mode)
|
||||
{
|
||||
foreach($mode_diffusion as $mode) {
|
||||
$bilan['mode_diffusion'][] = $mode->getAttribute('type');
|
||||
}
|
||||
|
||||
@ -422,8 +433,7 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
|
||||
//Génération de l'index pour le tri
|
||||
$date = $bilan['date_cloture_iso'];
|
||||
if( !empty($date) )
|
||||
{
|
||||
if( !empty($date) ) {
|
||||
$key = substr($date,0,4).substr($date,5,2).substr($date,8,2).'-'.$bilan['num_depot'];
|
||||
//Affectation liste générale avec un index permettant le tri
|
||||
$bilans[$key] = $bilan;
|
||||
@ -469,7 +479,7 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
*/
|
||||
protected function dbUpdateItem($list)
|
||||
{
|
||||
//Insert or Update
|
||||
// Insert or Update
|
||||
$data = array(
|
||||
'siren' => $list['num_siren'],
|
||||
'numRC' => $list['num_gest']['dossier_millesime'].
|
||||
@ -484,60 +494,60 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
'actif' => 1,
|
||||
);
|
||||
|
||||
$this->db->getProfiler()->setEnabled(true);
|
||||
|
||||
try {
|
||||
$bilanM = new Application_Model_JoGreffesBilans();
|
||||
$sql = $bilanM->select()
|
||||
->where('siren=?', $this->siren)
|
||||
->where('num_depot=?', $list['num_depot'])
|
||||
->where('date_cloture=?', $list['date_cloture_iso'])
|
||||
//->where('type_comptes=?', $list['type_comptes'])
|
||||
->order('dateInsert ASC');
|
||||
$rows = $bilanM->fetchAll($sql);
|
||||
} catch(Zend_Db_Exception $e) {
|
||||
/*echo $query = $this->db->getProfiler()->getLastQueryProfile()->getQuery();
|
||||
echo "\n";
|
||||
$queryParams = $this->db->getProfiler()->getLastQueryProfile()->getQueryParams();
|
||||
print_r($queryParams);
|
||||
echo "\n";*/
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
|
||||
$this->db->getProfiler()->setEnabled(false);
|
||||
|
||||
if ( count($rows) == 0 ) {
|
||||
//Add dateInsert
|
||||
$sql = "SELECT * FROM jo.greffes_bilans
|
||||
WHERE siren=:siren AND num_depot=:num AND date_cloture=:date ORDER BY dateInsert";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('siren', $this->siren);
|
||||
$stmt->bindValue('num', $list['num_depot']);
|
||||
$stmt->bindValue('date', $list['date_cloture_iso']);
|
||||
$stmt->execute();
|
||||
// Insert
|
||||
if ($stmt->rowCount() == 0) {
|
||||
$data['dateInsert'] = date('YmdHis');
|
||||
try {
|
||||
$result = $bilanM->insert($data);
|
||||
} catch(Zend_Exception $e) {
|
||||
$result = $this->conn->insert('jo.greffes_bilans', $data);
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
} else {
|
||||
//Correct multiple item
|
||||
$item = $rows[0];
|
||||
if ( count($rows) > 1 ) {
|
||||
}
|
||||
// Update
|
||||
else {
|
||||
// Get first Item
|
||||
$item = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
|
||||
// Correction anomalie item multiple
|
||||
if ($stmt->rowCount() > 1) {
|
||||
$this->conn->beginTransaction();
|
||||
try {
|
||||
$result = $bilanM->delete(array(
|
||||
$bilanM->getAdapter()->quoteInto('siren=?', $this->siren),
|
||||
$bilanM->getAdapter()->quoteInto('num_depot=?', $list['num_depot']),
|
||||
$bilanM->getAdapter()->quoteInto('date_cloture=?', $list['date_cloture_iso']),
|
||||
$bilanM->getAdapter()->quoteInto('type_comptes=?', $list['type_comptes']),
|
||||
'id!='.$item->id,
|
||||
));
|
||||
} catch(Zend_Exception $e) {
|
||||
while ($rowDel = $stmt->fetch(\PDO::FETCH_OBJ)) {
|
||||
$this->conn->delete('jo.greffes_bilans', array(
|
||||
'id' => $rowDel->id));
|
||||
}
|
||||
$this->conn->commit();
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
$this->conn->rollBack();
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// Real Update
|
||||
try {
|
||||
$result = $bilanM->update($data, 'id='.$item->id);
|
||||
} catch(Zend_Exception $e) {
|
||||
$result = $this->conn->update('jo.greffes_bilans', $data,
|
||||
array('id' => $item->id));
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
return true;
|
||||
}
|
||||
@ -563,18 +573,15 @@ class Metier_Infogreffe_DocBI extends Metier_Infogreffe_Service
|
||||
'pdfDate' => date('Ymd'),
|
||||
);
|
||||
|
||||
$where = array(
|
||||
'siren='.$this->siren,
|
||||
'date_cloture="'.$this->date_cloture.'"',
|
||||
'type_comptes="'.$this->type_comptes.'"',
|
||||
$identifier = array(
|
||||
'siren' => $this->siren,
|
||||
'date_cloture' => $this->date_cloture,
|
||||
'type_comptes' => $this->type_comptes,
|
||||
);
|
||||
|
||||
try {
|
||||
$bilanM = new Application_Model_JoGreffesBilans();
|
||||
$result = $bilanM->update($data, $where);
|
||||
} catch(Zend_Db_Adapter_Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
} catch(Zend_Db_Exception $e) {
|
||||
$result = $this->conn->update('jo.greffes_bilans', $data, $identifier);
|
||||
} catch(\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
|
||||
|
@ -8,37 +8,43 @@ class Metier_Infogreffe_DocST extends Metier_Infogreffe_Service
|
||||
{
|
||||
|
||||
/**
|
||||
* Db Adapter
|
||||
* @var Zend_Db_Adapter_Abstract
|
||||
* PDO Connection with Doctrine
|
||||
* @var \Doctrine\DBAL\Connection
|
||||
*/
|
||||
public $db;
|
||||
protected $conn;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $siren
|
||||
* Infogreffe : Document Bilan
|
||||
* @param \Doctrine\DBAL\Connection $conn
|
||||
*/
|
||||
public function __construct($siren, $db = null)
|
||||
public function __construct($conn = null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//Set type
|
||||
$this->type_document = 'ST';
|
||||
|
||||
//Set Siren
|
||||
$this->siren = $siren;
|
||||
|
||||
//Get defaut database adapter
|
||||
if ($db === null) {
|
||||
$this->db = Zend_Db_Table_Abstract::getDefaultAdapter();
|
||||
} else {
|
||||
$this->db = $db;
|
||||
// Set Database
|
||||
if ($conn === null) {
|
||||
$this->conn = Zend_Registry::get('doctrine');
|
||||
}
|
||||
else {
|
||||
$this->conn = $conn;
|
||||
}
|
||||
|
||||
// Set type
|
||||
$this->type_document = 'ST';
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini le SIREN
|
||||
* @param string $siren
|
||||
* @return void
|
||||
*/
|
||||
public function setSiren($siren)
|
||||
{
|
||||
$this->siren = $siren;
|
||||
}
|
||||
|
||||
public function getList()
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
public function getCommandeT()
|
||||
{
|
||||
@ -67,11 +73,10 @@ class Metier_Infogreffe_DocST extends Metier_Infogreffe_Service
|
||||
}
|
||||
|
||||
if ( $orderId !== null ) {
|
||||
$commandeM = new Application_Model_Sdv1GreffeCommandesBi();
|
||||
$commandeM->update(array(
|
||||
'cmdUrl'=> $url,
|
||||
'dateCommande' => date('YmdHis'),
|
||||
), 'id='.$orderId);
|
||||
$this->conn->update('sdv1.greffe_commandes_st', array(
|
||||
'cmdUrl' => $url,
|
||||
'dateCommande' => date('YmdHis')),
|
||||
array('id' => $orderId));
|
||||
}
|
||||
|
||||
//Récupérer le fichier
|
||||
@ -117,10 +122,7 @@ class Metier_Infogreffe_DocST extends Metier_Infogreffe_Service
|
||||
*/
|
||||
public function getFilePath($type, $dateCloture)
|
||||
{
|
||||
if ($type=='') {
|
||||
$type = 'sociaux';
|
||||
}
|
||||
return 'bilans' . '/' . $type . '/' . substr($dateCloture,0,4);
|
||||
return 'statut/' . $type . '/' . substr($dateCloture,0,4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -238,6 +238,7 @@ class Metier_Infogreffe_Service
|
||||
|
||||
/**
|
||||
* Download file from URL
|
||||
* @todo : Use Guzzle
|
||||
* @param string $url
|
||||
* @param string $filename
|
||||
* @throws Exception
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -13,11 +13,6 @@ class Metier_Liens_Base
|
||||
*/
|
||||
protected $siren = null;
|
||||
|
||||
/**
|
||||
* @var Zend_Db_Adapter_Abstract
|
||||
*/
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Array to list id find during list of childrens
|
||||
* @var array
|
||||
@ -43,38 +38,50 @@ class Metier_Liens_Base
|
||||
public $stopAtPP = true;
|
||||
|
||||
/**
|
||||
* Databas table name
|
||||
* @var string
|
||||
* PDO Connection with Doctrine
|
||||
* @var \Doctrine\DBAL\Connection
|
||||
*/
|
||||
protected $_schema = 'jo';
|
||||
protected $conn;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $id
|
||||
* @param string $type ref|siren
|
||||
* @param Zend_Db_Adapter $db
|
||||
* @throws SoapFault
|
||||
* Gestion des liens inter entreprises
|
||||
* @param \Doctrine\DBAL\Connection $conn
|
||||
*/
|
||||
public function __construct($id, $type = 'ref', $db = null)
|
||||
public function __construct($conn = null)
|
||||
{
|
||||
//Get defaut database adapter
|
||||
if( $db === null ) {
|
||||
$this->db = Zend_Db_Table_Abstract::getDefaultAdapter();
|
||||
} else {
|
||||
$this->db = $db;
|
||||
Zend_Db_Table_Abstract::setDefaultAdapter($db);
|
||||
if ($conn === null) {
|
||||
$this->conn = Zend_Registry::get('doctrine');
|
||||
}
|
||||
else {
|
||||
$this->conn = $conn;
|
||||
}
|
||||
}
|
||||
|
||||
//Get Id
|
||||
/**
|
||||
* Identifiant
|
||||
* @param string $id
|
||||
* @param string $type ref|siren
|
||||
*/
|
||||
public function setId($id, $type = 'ref')
|
||||
{
|
||||
// Get Id
|
||||
if ( $type == 'siren' ) {
|
||||
$this->siren = $id;
|
||||
$refM = new Application_Model_JoLiensRef();
|
||||
$sql = $refM->select()->where('siren=?', $id)->where('dateSuppr=0');
|
||||
$result = $refM->fetchRow($sql);
|
||||
if ( $result !== null ) {
|
||||
try {
|
||||
$sql = "SELECT * FROM jo.liensRef WHERE siren = :id AND dateSuppr = 0";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('id', $id);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$result = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
$this->idRef = $result->id;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception(__METHOD__ . ': ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->idRef = $id;
|
||||
}
|
||||
}
|
||||
@ -98,34 +105,36 @@ class Metier_Liens_Base
|
||||
}
|
||||
|
||||
try {
|
||||
$sql = $this->db->select()
|
||||
->from(array('l'=>$this->_schema.'.liens2'),
|
||||
array('id', 'idAct', 'PDetention', 'Pvote', 'MajMin', 'idPar',
|
||||
'dateEffetLien', 'dateInsert', 'dateUpdate'))
|
||||
->where('idPar=?', $id)
|
||||
->join(array('r'=>$this->_schema.'.liensRef'), 'l.idAct=r.id',
|
||||
array('LPAD(siren, 9, 000000000) AS siren','PpPm', 'RS', 'sigle', 'civilite', 'nom', 'prenom', 'nom_usage',
|
||||
'naissance_date', 'naissance_dept_pays', 'naissance_lieu', 'nat',
|
||||
'adresse_num', 'adresse_btq', 'adresse_codvoie', 'adresse_libvoie',
|
||||
'adresse_comp', 'adresse_cp', 'adresse_ville', 'adresse_pays',
|
||||
'idLoc1Type', 'idLoc1Num', 'idLoc2Type', 'idLoc2Num', 'idLoc3Type', 'idLoc3Num',
|
||||
))
|
||||
->order('PDetention DESC');
|
||||
$qb = $this->conn->createQueryBuilder();
|
||||
$qb->select(array(
|
||||
'l.id', 'l.idAct', 'l.PDetention', 'l.Pvote', 'l.MajMin', 'l.idPar',
|
||||
'l.dateEffetLien', 'l.dateInsert', 'l.dateUpdate',
|
||||
'LPAD(r.siren, 9, 0) AS siren', 'r.PpPm', 'r.RS', 'r.sigle', 'r.civilite', 'r.nom',
|
||||
'r.prenom', 'r.nom_usage', 'r.naissance_date', 'r.naissance_dept_pays',
|
||||
'r.naissance_lieu', 'r.nat', 'r.adresse_num', 'r.adresse_btq', 'r.adresse_codvoie',
|
||||
'r.adresse_libvoie', 'r.adresse_comp', 'r.adresse_cp', 'r.adresse_ville',
|
||||
'r.adresse_pays', 'r.idLoc1Type', 'r.idLoc1Num', 'r.idLoc2Type', 'r.idLoc2Num',
|
||||
'r.idLoc3Type', 'r.idLoc3Num'
|
||||
)
|
||||
)->from('jo.liens2', 'l')->join('l', 'jo.liensRef', 'r', 'l.idAct = r.id')
|
||||
->where('l.idPar = :id')->setParameter('id', $id)
|
||||
->orderBy('l.PDetention', 'DESC');
|
||||
|
||||
//Actif / Inactif
|
||||
// Actif / Inactif
|
||||
if ( null !== $actif ) {
|
||||
if ( false === $actif ) {
|
||||
$sql->where('l.actif=?',0);
|
||||
$qb->andWhere('l.actif = 0');
|
||||
} else {
|
||||
$sql->where('l.actif=?',1);
|
||||
$qb->andWhere('l.actif = 1');
|
||||
}
|
||||
}
|
||||
|
||||
//Don't display deleted - anomaly
|
||||
$sql->where('l.dateSuppr=?', '0000-00-00 00:00:00');
|
||||
|
||||
$liens = $this->db->fetchAll($sql, null, Zend_Db::FETCH_OBJ);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
// Don't display deleted - anomaly
|
||||
$qb->andWhere("l.dateSuppr = '0000-00-00 00:00:00'");
|
||||
$stmt = $qb->execute();
|
||||
$liens = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception(__METHOD__ . ': ' . $e->getMessage());
|
||||
}
|
||||
|
||||
@ -157,34 +166,36 @@ class Metier_Liens_Base
|
||||
}
|
||||
|
||||
try {
|
||||
$sql = $this->db->select()
|
||||
->from(array('l'=>$this->_schema.'.liens2'),
|
||||
array('id', 'idAct', 'PDetention', 'Pvote', 'MajMin', 'idPar',
|
||||
'dateEffetLien', 'dateInsert', 'dateUpdate'))
|
||||
->where('idAct=?', $id)
|
||||
->join(array('r'=>$this->_schema.'.liensRef'), 'l.idPar=r.id',
|
||||
array('LPAD(siren, 9, 000000000) AS siren','PpPm', 'RS', 'sigle', 'civilite', 'nom', 'prenom', 'nom_usage',
|
||||
'naissance_date', 'naissance_dept_pays', 'naissance_lieu', 'nat',
|
||||
'adresse_num', 'adresse_btq', 'adresse_codvoie', 'adresse_libvoie',
|
||||
'adresse_comp', 'adresse_cp', 'adresse_ville', 'adresse_pays',
|
||||
'idLoc1Type', 'idLoc1Num', 'idLoc2Type', 'idLoc2Num', 'idLoc3Type', 'idLoc3Num',
|
||||
))
|
||||
->order('PDetention DESC');
|
||||
$qb = $this->conn->createQueryBuilder();
|
||||
$qb->select(array(
|
||||
'l.id', 'l.idAct', 'l.PDetention', 'l.Pvote', 'l.MajMin', 'l.idPar',
|
||||
'l.dateEffetLien', 'l.dateInsert', 'l.dateUpdate',
|
||||
'LPAD(r.siren, 9, 0) AS siren', 'r.PpPm', 'r.RS', 'r.sigle', 'r.civilite', 'r.nom',
|
||||
'r.prenom', 'r.nom_usage', 'r.naissance_date', 'r.naissance_dept_pays',
|
||||
'r.naissance_lieu', 'r.nat', 'r.adresse_num', 'r.adresse_btq', 'r.adresse_codvoie',
|
||||
'r.adresse_libvoie', 'r.adresse_comp', 'r.adresse_cp', 'r.adresse_ville',
|
||||
'r.adresse_pays', 'r.idLoc1Type', 'r.idLoc1Num', 'r.idLoc2Type', 'r.idLoc2Num',
|
||||
'r.idLoc3Type', 'r.idLoc3Num'
|
||||
)
|
||||
)->from('jo.liens2', 'l')->join('l', 'jo.liensRef', 'r', 'l.idPar=r.id')
|
||||
->where('l.idAct = :id')->setParameter('id', $id)
|
||||
->orderBy('l.PDetention', 'DESC');
|
||||
|
||||
//Actif / Inactif
|
||||
// Actif / Inactif
|
||||
if ( null !== $actif ) {
|
||||
if ( false === $actif ) {
|
||||
$sql->where('l.actif=?',0);
|
||||
$qb->andWhere('l.actif = 0');
|
||||
} else {
|
||||
$sql->where('l.actif=?',1);
|
||||
$qb->andWhere('l.actif = 1');
|
||||
}
|
||||
}
|
||||
|
||||
//Don't display deleted - anomaly
|
||||
$sql->where('l.dateSuppr=?', '0000-00-00 00:00:00');
|
||||
|
||||
$liens = $this->db->fetchAll($sql, null, Zend_Db::FETCH_OBJ);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
$qb->andWhere("l.dateSuppr = '0000-00-00 00:00:00'");
|
||||
$stmt = $qb->execute();
|
||||
$liens = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception(__METHOD__ . ': ' . $e->getMessage());
|
||||
}
|
||||
|
||||
@ -194,42 +205,45 @@ class Metier_Liens_Base
|
||||
/**
|
||||
* Fonctions de direction
|
||||
* @param boolean $actif
|
||||
* @return Zend_Db_Table_Rowset_Abstract
|
||||
* @return array
|
||||
*/
|
||||
public function getDirections($actif = null)
|
||||
{
|
||||
if ( null === $this->siren ) {
|
||||
$refM = new Application_Model_JoLiensRef();
|
||||
$rows = $refM->find($this->idRef);
|
||||
$siren = str_pad($rows->current()->siren, 9, '0', STR_PAD_LEFT);
|
||||
} else {
|
||||
if (null === $this->siren) {
|
||||
$sql = "SELECT LPAD(siren, 9, 0) AS siren FROM jo.liensRef WHERE id = :id";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('id', $this->idRef);
|
||||
$result = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
$siren = $result->siren;
|
||||
}
|
||||
else {
|
||||
$siren = $this->siren;
|
||||
}
|
||||
|
||||
$result = array();
|
||||
|
||||
if ( null !== $siren && intval($siren) != 0 )
|
||||
{
|
||||
if (null !== $siren && intval($siren) != 0) {
|
||||
try {
|
||||
$directionsM = new Application_Model_JoRncsDirigeants();
|
||||
$sql = $directionsM->select()->from($directionsM, array(
|
||||
'LPAD(siren, 9, 000000000) AS siren','raisonSociale', 'dirSiren', 'dirRS', 'civilite', 'nom',
|
||||
'prenom', 'naissance_date', 'naissance_lieu', 'fonction_code', 'fonction_lib'
|
||||
))->where("typeDir IN ('PM', 'PP')")->where('dirSiren=?', $siren);
|
||||
|
||||
//Actif / Inactif
|
||||
if ( null !== $actif ) {
|
||||
$qb = $this->conn->createQueryBuilder();
|
||||
$qb->select(array('LPAD(siren, 9, 0) AS siren', 'raisonSociale',
|
||||
'dirSiren', 'dirRS', 'civilite', 'nom', 'prenom', 'naissance_date',
|
||||
'naissance_lieu', 'fonction_code', 'fonction_lib')
|
||||
)->from('jo.rncs_dirigeants')->where("typeDir IN ('PM', 'PP')")
|
||||
->andWhere('dirSiren = :siren')->setParameter('siren', $siren);
|
||||
// Actif / Inactif
|
||||
if (null !== $actif) {
|
||||
if ( false === $actif ) {
|
||||
$sql->where('actif=?',0);
|
||||
} else {
|
||||
$sql->where('actif=?',1);
|
||||
$qb->andWhere('actif = 0');
|
||||
}
|
||||
else {
|
||||
$qb->andWhere('actif = 1');
|
||||
}
|
||||
}
|
||||
$sql->order('fonction_code DESC');
|
||||
$sql->order('raisonSociale ASC');
|
||||
|
||||
$result = $directionsM->fetchAll($sql);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
$qb->orderBy('fonction_code', 'DESC');
|
||||
$qb->orderBy('raisonSociale', 'ASC');
|
||||
$stmt = $qb->execute();
|
||||
$result = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception(__METHOD__ . ': ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
@ -237,7 +251,6 @@ class Metier_Liens_Base
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retourne la maison mère
|
||||
* @param int $id
|
||||
@ -296,7 +309,7 @@ class Metier_Liens_Base
|
||||
/**
|
||||
* Retourne les éléments identitaire présent dans lienRef
|
||||
* @param string $id
|
||||
* @return Zend_Db_Table_Rowset_Abstract
|
||||
* @return array
|
||||
*/
|
||||
public function getIdentity($id = null)
|
||||
{
|
||||
@ -304,10 +317,12 @@ class Metier_Liens_Base
|
||||
$id = $this->idRef;
|
||||
}
|
||||
|
||||
$refM = new Application_Model_JoLiensRef();
|
||||
$row = $refM->find($id);
|
||||
if (null !== $row) {
|
||||
return $row->current();
|
||||
$sql = "SELECT * FROM jo.liensRef WHERE id = :id";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('id', $id);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount() > 0) {
|
||||
return $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -319,7 +334,7 @@ class Metier_Liens_Base
|
||||
* @param int $nbNiveaux
|
||||
* @return array
|
||||
*/
|
||||
public function getTree( $pctMin=33, $nbNiveaux=10 )
|
||||
public function getTree($pctMin = 33, $nbNiveaux = 10)
|
||||
{
|
||||
//Get identity to stop at isin
|
||||
$itemWithIsin = null;
|
||||
@ -423,13 +438,16 @@ class Metier_Liens_Base
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return multitype:NULL
|
||||
* Liste des entités du CAC40
|
||||
* @return array
|
||||
*/
|
||||
public function getCAC40()
|
||||
{
|
||||
$sql = "SELECT isin, nom, MAX(`date`) AS dateMAJ FROM sdv1.bourse_listes WHERE lstCode='xcac40p' GROUP BY lstCode, isin HAVING MAX(`date`) ORDER BY dateMAJ DESC;";
|
||||
$result = $this->db->query($sql);
|
||||
$sql = "SELECT isin, nom, MAX(date) AS dateMAJ FROM sdv1.bourse_listes
|
||||
WHERE lstCode='xcac40p' GROUP BY lstCode, isin HAVING MAX(date) ORDER BY dateMAJ DESC;";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
|
||||
$output = array();
|
||||
foreach ( $result as $item ) {
|
||||
@ -444,23 +462,19 @@ class Metier_Liens_Base
|
||||
* @param number $pctMin
|
||||
* @return array
|
||||
*/
|
||||
public function getGroupeCAC40( $pctMin=50 )
|
||||
public function getGroupeCAC40($pctMin = 50)
|
||||
{
|
||||
$listeIsin = $this->getCAC40();
|
||||
$isin = implode(",",$listeIsin);
|
||||
|
||||
$refM = new Application_Model_JoLiensRef();
|
||||
$sql = $refM->select()
|
||||
->where("idLoc1Type=63")->where("idLoc1Num IN (?)", $isin)
|
||||
->orWhere("idLoc2Type=63")->where("idLoc2Num IN (?)", $isin)
|
||||
->orWhere("idLoc3Type=63")->where("idLoc3Num IN (?)", $isin);
|
||||
|
||||
$result = $refM->fetchAll($sql);
|
||||
$isin = "'".implode("','",$listeIsin)."'";
|
||||
|
||||
$this->findId = array();
|
||||
|
||||
$sql = "SELECT id FROM jo.liensRef WHERE (idLoc1Type=63 AND idLoc1Num IN (".$isin."))
|
||||
OR (idLoc2Type=63 AND idLoc2Num IN (".$isin.")) OR (idLoc3Type=63 AND idLoc3Num IN (".$isin."))";
|
||||
$stmt = $this->conn->executeQuery($sql);
|
||||
$output = array();
|
||||
if ( $result->count()>0 ) {
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$result = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
foreach ( $result as $item ) {
|
||||
$output = $output + $this->getListeGroupeCAC40($item->id, $pctMin);
|
||||
}
|
||||
@ -504,7 +518,7 @@ class Metier_Liens_Base
|
||||
* @param number $pctMin
|
||||
* @return boolean
|
||||
*/
|
||||
public function isInGroupeCAC40( $pctMin=50 )
|
||||
public function isInGroupeCAC40($pctMin = 50)
|
||||
{
|
||||
//Si pas d'actionnaires => false
|
||||
if ( count($this->getActionnaires()) == 0 ) {
|
||||
@ -524,12 +538,10 @@ class Metier_Liens_Base
|
||||
*/
|
||||
protected function getCountry()
|
||||
{
|
||||
$countryM = new Application_Model_JoTabPays();
|
||||
$sql = $countryM->select()
|
||||
->from($countryM, array('codPays3', 'libPays'))
|
||||
->where('codPays3 IS NOT NULL');
|
||||
$rows = $countryM->fetchAll($sql);
|
||||
if ( $rows !== null ) {
|
||||
$sql = "SELECT codPays3, libPays FROM jo.tabPays WHERE codPays3 IS NOT NULL";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$data = array();
|
||||
foreach($rows as $item) {
|
||||
$data[$item->codPays3] = $item->libPays;
|
||||
|
@ -11,81 +11,99 @@ class Metier_Partenaires_MArtisanat
|
||||
public $libErreur='';
|
||||
public $cookie='';
|
||||
public $iDb;
|
||||
public $enCache=false;
|
||||
|
||||
function __construct() {
|
||||
$this->iDb=new Metier_Util_Db();
|
||||
protected $remote = false;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->iDb = new Metier_Util_Db();
|
||||
}
|
||||
|
||||
function getIdentite($siren, $refresh=false) {
|
||||
$siren=$siren*1;
|
||||
$res=$this->iDb->select('jo.artisanat', 'id, siren, actif, numRM, denomination, sigle, nomCommercial, enseigne, fj, effectif, aprm, debutActivite, activite, adresse, cp, ville, cessation, radiation, nbInscriptions, nom, prenom, nomUsage, dateNaiss, lieuNaiss, natio, qualite, qualif, dateQualif, dateFctDeb, dateFctFin, IF(dateInsert>dateUpdate,dateInsert,dateUpdate) AS dateUpdate', "siren=$siren", false, MYSQL_ASSOC);
|
||||
if (count($res)>0 && !$refresh) {
|
||||
$this->enCache=true;
|
||||
$tabInsert=$res[0];
|
||||
/**
|
||||
* Active la récupération des données distantes
|
||||
*/
|
||||
public function setRemote()
|
||||
{
|
||||
$this->remote = true;
|
||||
}
|
||||
|
||||
public function getIdentite($siren)
|
||||
{
|
||||
$siren = $siren * 1;
|
||||
$res = $this->iDb->select('jo.artisanat', 'id, siren, actif, numRM, denomination, sigle, nomCommercial, enseigne, fj, effectif, aprm, debutActivite, activite, adresse, cp, ville, cessation, radiation, nbInscriptions, nom, prenom, nomUsage, dateNaiss, lieuNaiss, natio, qualite, qualif, dateQualif, dateFctDeb, dateFctFin, IF(dateInsert>dateUpdate,dateInsert,dateUpdate) AS dateUpdate', "siren=$siren", false, MYSQL_ASSOC);
|
||||
if (count($res)>0 && !$this->remote) {
|
||||
$tabInsert = $res[0];
|
||||
} elseif (ARTISANAT_DISPO_WEB) {
|
||||
$this->enCache=false;
|
||||
$url='http://www.cma-paris.fr/CMP/rm_recherche.php?dom=Gerer&fonction=recherche';
|
||||
$page=getUrl($url, '', '', $this->referer, false, 'www.cma-paris.fr', false, '', '', 21);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
$this->libErreur='Erreur Artisanat 200a !';
|
||||
$tabInsert = $this->getRemoteIdentite();
|
||||
}
|
||||
return $tabInsert;
|
||||
}
|
||||
|
||||
public function getRemoteIdentite()
|
||||
{
|
||||
$url = 'http://www.cma-paris.fr/CMP/rm_recherche.php?dom=Gerer&fonction=recherche';
|
||||
$page = getUrl($url, '', '', $this->referer, false, 'www.cma-paris.fr', false, '', '', 21);
|
||||
$this->body = $page['body'];
|
||||
$this->codeRetour = $page['code'];
|
||||
if ($this->codeRetour != '200') {
|
||||
$this->libErreur = 'Erreur Artisanat 200a !';
|
||||
return false;
|
||||
}
|
||||
$this->cookie=$page['header']['Set-Cookie'];
|
||||
$this->referer=$url;
|
||||
$this->cookie = $page['header']['Set-Cookie'];
|
||||
$this->referer = $url;
|
||||
|
||||
$url='http://www.cma-paris.fr/CMP/rm_recherche.php?dom=Gerer&fonction=cherche';
|
||||
$postData=array( 'siren_op'=>'%3D',
|
||||
'siren'=>$siren,
|
||||
'den_rent_op'=>'%25',
|
||||
'den_rent'=>'',
|
||||
'adresse_op'=>'contient',
|
||||
'adresse'=>'',
|
||||
'bde_rent_op'=>'%25',
|
||||
'bde_rent'=>'',
|
||||
'nom_rdir_op'=>'%25',
|
||||
'nom_rdir'=>'',
|
||||
'pren_rdir_op'=>'%25',
|
||||
'pren_rdir'=>'',
|
||||
'table'=>'rentreprise',//'rentrad',
|
||||
'x'=>56,
|
||||
'y'=>14,
|
||||
$url = 'http://www.cma-paris.fr/CMP/rm_recherche.php?dom=Gerer&fonction=cherche';
|
||||
$postData = array(
|
||||
'siren_op' => '%3D',
|
||||
'siren' => $siren,
|
||||
'den_rent_op' => '%25',
|
||||
'den_rent' => '',
|
||||
'adresse_op' => 'contient',
|
||||
'adresse' => '',
|
||||
'bde_rent_op' => '%25',
|
||||
'bde_rent' => '',
|
||||
'nom_rdir_op' => '%25',
|
||||
'nom_rdir' => '',
|
||||
'pren_rdir_op' => '%25',
|
||||
'pren_rdir' => '',
|
||||
'table' => 'rentreprise',//'rentrad',
|
||||
'x' => 56,
|
||||
'y' => 14,
|
||||
);
|
||||
sleep(rand(1, 2));
|
||||
$page=getUrl($url, $this->cookie, $postData, $this->referer, false, 'www.cma-paris.fr', false, '', '', 21);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
$this->libErreur='Erreur Artisanat 200b !';
|
||||
$page = getUrl($url, $this->cookie, $postData, $this->referer, false, 'www.cma-paris.fr', false, '', '', 21);
|
||||
$this->body = $page['body'];
|
||||
$this->codeRetour = $page['code'];
|
||||
if ($this->codeRetour != '200') {
|
||||
$this->libErreur = 'Erreur Artisanat 200b !';
|
||||
return false;
|
||||
}
|
||||
$this->referer=$url;
|
||||
$this->referer = $url;
|
||||
|
||||
if (preg_match('/<span.class="rouge">aucune.entreprise.ne.correspond(?:.*)vos.crit(?:.*)de.recherche<\/span>/Uis', $this->body, $matches)) {
|
||||
$url='http://www.cma-paris.fr/CMP/rm_recherche.php?dom=Gerer&fonction=cherche';
|
||||
$postData=array( 'siren_op'=>'%3D',
|
||||
'siren'=>$siren,
|
||||
'den_rent_op'=>'%25',
|
||||
'den_rent'=>'',
|
||||
'adresse_op'=>'contient',
|
||||
'adresse'=>'',
|
||||
'bde_rent_op'=>'%25',
|
||||
'bde_rent'=>'',
|
||||
'nom_rdir_op'=>'%25',
|
||||
'nom_rdir'=>'',
|
||||
'pren_rdir_op'=>'%25',
|
||||
'pren_rdir'=>'',
|
||||
'table'=>'rentrad',
|
||||
'x'=>56,
|
||||
'y'=>14,
|
||||
$url = 'http://www.cma-paris.fr/CMP/rm_recherche.php?dom=Gerer&fonction=cherche';
|
||||
$postData = array(
|
||||
'siren_op' => '%3D',
|
||||
'siren' => $siren,
|
||||
'den_rent_op' => '%25',
|
||||
'den_rent' => '',
|
||||
'adresse_op' => 'contient',
|
||||
'adresse' => '',
|
||||
'bde_rent_op' => '%25',
|
||||
'bde_rent' => '',
|
||||
'nom_rdir_op' => '%25',
|
||||
'nom_rdir' => '',
|
||||
'pren_rdir_op' => '%25',
|
||||
'pren_rdir' => '',
|
||||
'table' => 'rentrad',
|
||||
'x' => 56,
|
||||
'y' => 14,
|
||||
);
|
||||
sleep(rand(1, 2));
|
||||
$page=getUrl($url, $this->cookie, $postData, $this->referer, false, 'www.cma-paris.fr', false, '', '', 21);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
$this->body = $page['body'];
|
||||
$this->codeRetour = $page['code'];
|
||||
if ($this->codeRetour != '200') {
|
||||
$this->libErreur='Erreur Artisanat 200c !';
|
||||
return false;
|
||||
}
|
||||
@ -93,120 +111,134 @@ class Metier_Partenaires_MArtisanat
|
||||
}
|
||||
|
||||
/** Gestion des multi-inscriptions au RM **/
|
||||
if (preg_match('/<b class="gris">(.*)entreprises.correspondent(?:.*)vos.crit(?:.*)de.recherche<\/span>/Uis', $this->body, $matches))
|
||||
{
|
||||
$nbRep=trim($matches[1])*1;
|
||||
$iRadMax=-1;
|
||||
if (preg_match('/<b class="gris">(.*)entreprises.correspondent(?:.*)vos.crit(?:.*)de.recherche<\/span>/Uis', $this->body, $matches)) {
|
||||
$nbRep = trim($matches[1])*1;
|
||||
$iRadMax = -1;
|
||||
if (preg_match_all('/<a class="turquoise" href="(rm\.php\?dom=Gerer&fonction=dossier&(.*))">/Uis', $this->body, $matches)) {
|
||||
$tabUrls=array_unique($matches[1]);
|
||||
$anRadMax=0;
|
||||
$tabUrls = array_unique($matches[1]);
|
||||
$anRadMax = 0;
|
||||
// Recherche de la dernière inscription
|
||||
foreach ($tabUrls as $iUrl=>$url) {
|
||||
foreach ($tabUrls as $iUrl => $url) {
|
||||
// On prend la dernière inscription
|
||||
$tabTmp=explode('&',$url);
|
||||
if (substr($tabTmp[3],0,8)=='an_rera=') {
|
||||
$tabTmp = explode('&',$url);
|
||||
if (substr($tabTmp[3],0,8) == 'an_rera=') {
|
||||
$anRad=substr($tabTmp[3],8);
|
||||
if ($anRad>$anRadMax) {
|
||||
$anRadMax=$anRad;
|
||||
$iRadMax=$iUrl;
|
||||
if ($anRad > $anRadMax) {
|
||||
$anRadMax = $anRad;
|
||||
$iRadMax = $iUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($iRadMax==-1) die('$iRadMax==-1 Cas impossible !'.PHP_EOL.print_r($tabUrls,true).PHP_EOL.print_r($matches,true));
|
||||
// Accès à la dernière fiche
|
||||
$url='http://www.cma-paris.fr/CMP/'.strtr(trim($tabUrls[$iRadMax]),array('&'=>'&'));
|
||||
$url = 'http://www.cma-paris.fr/CMP/'.strtr(trim($tabUrls[$iRadMax]),array('&'=>'&'));
|
||||
sleep(rand(1, 2));
|
||||
$page=getUrl($url, $this->cookie, '', $this->referer, false, 'www.cma-paris.fr', false, '', '', 21);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
$this->libErreur='Erreur Artisanat 200c !';
|
||||
$page = getUrl($url, $this->cookie, '', $this->referer, false, 'www.cma-paris.fr', false, '', '', 21);
|
||||
$this->body = $page['body'];
|
||||
$this->codeRetour = $page['code'];
|
||||
if ($this->codeRetour != '200') {
|
||||
$this->libErreur = 'Erreur Artisanat 200c !';
|
||||
return false;
|
||||
}
|
||||
$this->referer=$url;
|
||||
$this->referer = $url;
|
||||
}
|
||||
|
||||
$tabInsert=array();
|
||||
$tabInsert = array();
|
||||
|
||||
if (preg_match('/n° d\'identification \(SIREN\)<\/span><\/td>(?:.*)<td align="left" nowrap>(.*) <\/td>((?:.*)n° de gestion rm<\/span><\/td>(?:.*)<td align="left" nowrap>(.*)<\/td>)?/Uis', $this->body, $matches)) {
|
||||
$sirenLu=$matches[1]*1;
|
||||
if ($siren==$sirenLu) {
|
||||
$tabInsert['siren']=$matches[1];
|
||||
$tabInsert['numRM']=@$matches[2];
|
||||
} else {
|
||||
$this->libErreur='Erreur Siren $sirenLu<>$siren !';
|
||||
$sirenLu = $matches[1]*1;
|
||||
if ($siren == $sirenLu) {
|
||||
$tabInsert['siren'] = $matches[1];
|
||||
$tabInsert['numRM'] = @$matches[2];
|
||||
}
|
||||
else {
|
||||
$this->libErreur = 'Erreur Siren $sirenLu<>$siren !';
|
||||
return false;
|
||||
}
|
||||
} elseif (preg_match('/<span class="rouge">aucune entreprise ne correspond à vos critères de recherche<\/span>/Uis', $this->body, $matches)) {
|
||||
$this->libErreur='Erreur Artisan absent de la base Artisanat !';
|
||||
// die($this->body);
|
||||
}
|
||||
elseif (preg_match('/<span class="rouge">aucune entreprise ne correspond à vos critères de recherche<\/span>/Uis', $this->body, $matches)) {
|
||||
$this->libErreur = 'Erreur Artisan absent de la base Artisanat !';
|
||||
return false;
|
||||
} else {
|
||||
$this->libErreur='Erreur Siren absent dans la page !';
|
||||
}
|
||||
else {
|
||||
$this->libErreur = 'Erreur Siren absent dans la page !';
|
||||
return false;
|
||||
}
|
||||
|
||||
$actif=null;
|
||||
$actif = null;
|
||||
if (preg_match("/Renseignements.relatif(?:.*)entreprise(.*)<\/b>/Uis", $this->body, $matches)) {
|
||||
switch (trim(strtr($matches[1],array(chr(160)=>'')))) {
|
||||
case 'en activité': $actif=1; break;
|
||||
case 'radiée': $actif=0; break;
|
||||
default: print_r($matches);die(); break;
|
||||
case 'en activité': $actif = 1; break;
|
||||
case 'radiée': $actif = 0; break;
|
||||
default: print_r($matches); die(); break;
|
||||
}
|
||||
//die(PHP_EOL.'$actif='.$actif.PHP_EOL.print_r($matches));
|
||||
}
|
||||
$tabInsert['actif']=$actif;
|
||||
if ($actif===null) {
|
||||
//die("siren=$siren".PHP_EOL."sirenLu=$sirenLu".PHP_EOL.$this->body);
|
||||
$this->libErreur='Erreur Actif/Radié non trouvé !';
|
||||
$tabInsert['actif'] = $actif;
|
||||
if ($actif === null) {
|
||||
$this->libErreur = 'Erreur Actif/Radié non trouvé !';
|
||||
return false;
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">dénomination<\/span><\/td>(?:.*)<td align="left" colspan="5">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['denomination'] = $matches[1];
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">dénomination<\/span><\/td>(?:.*)<td align="left" colspan="5">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['denomination']=$matches[1];
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">dénomination<\/span><\/td>(?:.*)<td align="left" colspan="5">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['denomination']=$matches[1];
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">sigle<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">sigle<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['sigle']=$matches[1];
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise"> nom commercial<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise"> nom commercial<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['nomCommercial']=$matches[1];
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">enseigne<\/span><\/td>(?:.*)<td align="left" colspan="4">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">enseigne<\/span><\/td>(?:.*)<td align="left" colspan="4">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['enseigne']=$matches[1];
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">forme juridique<\/span><\/td>(?:.*)<td align="left" colspan="5">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">forme juridique<\/span><\/td>(?:.*)<td align="left" colspan="5">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['fj']=$matches[1];
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">effectif<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">effectif<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['effectif']=$matches[1];
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">code APRM<\/span><\/td>(?:.*)<td align="left">(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">code APRM<\/span><\/td>(?:.*)<td align="left">(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['aprm']=$matches[1];
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">début d\'activité<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">début d\'activité<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['debutActivite']=Metier_Util_Date::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches[1]),chr(160),' ')));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise"> activité\(s\) exercée\(s\) donnant lieu à immatriculation<\/span>(?:.*)<td colspan="5">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise"> activité\(s\) exercée\(s\) donnant lieu à immatriculation<\/span>(?:.*)<td colspan="5">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['activite']=trim($matches[1]);
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">adresse de l\'entreprise<\/span><\/td>(?:.*)<td align="left" colspan="5">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">adresse de l\'entreprise<\/span><\/td>(?:.*)<td align="left" colspan="5">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['adresse']=trim($matches[1]);
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">code postal<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">code postal<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['cp']=trim($matches[1]);
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">ville<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">ville<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['ville']=trim($matches[1]);
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">cessation d\'activité<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">cessation d\'activité<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['cessation']=Metier_Util_Date::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches[1]),chr(160),' ')));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">radiation du RM<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">radiation du RM<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['radiation']=Metier_Util_Date::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches[1]),chr(160),' ')));
|
||||
}
|
||||
$tabEtabs=array();
|
||||
if (preg_match('/<!--deb Etablissements secondaires-->(?:.*)<b class="gris">Aucune inscription complémentaire<\/b>(?:.*)<!--fin Etablissements secondaires-->/Uis', $this->body, $matches))
|
||||
if (preg_match('/<!--deb Etablissements secondaires-->(?:.*)<b class="gris">Aucune inscription complémentaire<\/b>(?:.*)<!--fin Etablissements secondaires-->/Uis', $this->body, $matches)) {
|
||||
$tabInsert['nbInscriptions']=0;
|
||||
}
|
||||
elseif (preg_match('/<!--deb Etablissements secondaires-->(?:.*)<b class="gris">Inscription complémentaire<\/b>(.*)<!--fin Etablissements secondaires-->/Uis', $this->body, $matches)) {
|
||||
$tabInsert['nbInscriptions']=0;
|
||||
if (preg_match_all('/<tr>(?:.*)<td><img alt="" src="inter\/pixtrans\.gif" width="30" height="1"><\/td>(?:.*)<td nowrap>(?:.*)<!-- adresse -->(.*)<\/td>(?:.*)<td nowrap>(?:.*)<!-- code postal et ville -->(.*)<\/td>(?:.*)<td nowrap>(?:.*)<!-- enseigne -->(.*)<\/td>(?:.*)<td>(?:.*)<!-- debut activite -->(.*)<\/td>(?:.*)<td>(?:.*)<!-- fin activite -->(.*)<\/td>(?:.*)<\/tr>/Uis', $matches[1], $matches2)) {
|
||||
foreach ($matches2[1] as $i=>$adresse) {
|
||||
$tabEtabs[$i]['siren'] =$siren;
|
||||
$tabEtabs[$i]['num'] =$i;
|
||||
$tabEtabs[$i]['adresse'] =trim(strtr(html_entity_decode($adresse),chr(160),' '));
|
||||
$tabEtabs[$i]['cpVille'] =trim(strtr(html_entity_decode($matches2[2][$i]),chr(160),' '));
|
||||
$tabEtabs[$i]['enseigne']=trim(strtr(html_entity_decode($matches2[3][$i]),chr(160),' '));
|
||||
$tabEtabs[$i]['actDeb'] =Metier_Util_Date::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches2[4][$i]),chr(160),' ')));
|
||||
$tabEtabs[$i]['actFin'] =Metier_Util_Date::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches2[5][$i]),chr(160),' ')));
|
||||
$tabEtabs[$i]['siren'] = $siren;
|
||||
$tabEtabs[$i]['num'] = $i;
|
||||
$tabEtabs[$i]['adresse'] = trim(strtr(html_entity_decode($adresse),chr(160),' '));
|
||||
$tabEtabs[$i]['cpVille'] = trim(strtr(html_entity_decode($matches2[2][$i]),chr(160),' '));
|
||||
$tabEtabs[$i]['enseigne']= trim(strtr(html_entity_decode($matches2[3][$i]),chr(160),' '));
|
||||
$tabEtabs[$i]['actDeb'] = Metier_Util_Date::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches2[4][$i]),chr(160),' ')));
|
||||
$tabEtabs[$i]['actFin'] = Metier_Util_Date::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches2[5][$i]),chr(160),' ')));
|
||||
$tabInsert['nbInscriptions']++;
|
||||
}
|
||||
}
|
||||
@ -217,57 +249,62 @@ class Metier_Partenaires_MArtisanat
|
||||
$urlDir='http://www.cma-paris.fr/CMP/'.strtr(trim($matches[1]),array('&'=>'&'));
|
||||
//die($urlDir);
|
||||
sleep(rand(1, 2));
|
||||
$page=getUrl($urlDir, $this->cookie, '', $this->referer, false, 'www.cma-paris.fr', false, '', '', 21);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
$this->libErreur='Erreur Artisanat 200d !';
|
||||
$page = getUrl($urlDir, $this->cookie, '', $this->referer, false, 'www.cma-paris.fr', false, '', '', 21);
|
||||
$this->body = $page['body'];
|
||||
$this->codeRetour = $page['code'];
|
||||
if ($this->codeRetour != '200') {
|
||||
$this->libErreur = 'Erreur Artisanat 200d !';
|
||||
return false;
|
||||
}
|
||||
$this->referer=$url;
|
||||
$this->referer = $url;
|
||||
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">nom<\/span><\/td>(?:.*)<td align="left" nowrap>(.*)<\/td>/Uis', $this->body, $matches))
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">nom<\/span><\/td>(?:.*)<td align="left" nowrap>(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['nom']=trim(strtr(html_entity_decode($matches[1]),chr(160),' '));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">prénom<\/span><\/td>(?:.*)<td align="left" nowrap>(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">prénom<\/span><\/td>(?:.*)<td align="left" nowrap>(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['prenom']=trim(strtr(html_entity_decode($matches[1]),chr(160),' '));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">nom d\'usage<\/span><\/td>(?:.*)<td align="left" nowrap>(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">nom d\'usage<\/span><\/td>(?:.*)<td align="left" nowrap>(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['nomUsage']=trim(strtr(html_entity_decode($matches[1]),chr(160),' '));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"(?:.*)<span class="turquoise"> date de naissance<\/span><\/td>(?:.*)-->(?:.*)<td(?: +)align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"(?:.*)<span class="turquoise"> date de naissance<\/span><\/td>(?:.*)-->(?:.*)<td(?: +)align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['dateNaiss']=Metier_Util_Date::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches[1]),chr(160),' ')));
|
||||
// if (preg_match('/date de naissance(.*)<td background="inter\/pix3_turquoise\.gif" align="right"/Uis', $this->body, $matches))
|
||||
// die(print_r($matches));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise"> lieu de naissance<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise"> lieu de naissance<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['lieuNaiss']=trim(strtr(html_entity_decode($matches[1]),chr(160),' '));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">nationalité<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">nationalité<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['natio']=trim(strtr(html_entity_decode($matches[1]),chr(160),' '));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">qualité<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">qualité<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['qualite']=trim(strtr(html_entity_decode($matches[1]),chr(160),' '));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right" nowrap><span class="turquoise">qualification artisanale<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right" nowrap><span class="turquoise">qualification artisanale<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['qualif']=trim(strtr(html_entity_decode($matches[1]),chr(160),' '));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">date d\'obtention<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">date d\'obtention<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['datequalif']=Metier_Util_Date::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches[1]),chr(160),' ')));
|
||||
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">prise de fonction<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">prise de fonction<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['dateFctDeb']=Metier_Util_Date::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches[1]),chr(160),' ')));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">fin de fonction<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">fin de fonction<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['dateFctFin']=Metier_Util_Date::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches[1]),chr(160),' ')));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Insertion en base de données
|
||||
$tabInsert['dateInsert']=date('Y-m-d H:i:s');
|
||||
$id=$this->iDb->insert('jo.artisanat', $tabInsert, true);
|
||||
$tabInsert['id']=$id;
|
||||
$tabInsert['dateInsert'] = date('Y-m-d H:i:s');
|
||||
$id = $this->iDb->insert('jo.artisanat', $tabInsert, true);
|
||||
$tabInsert['id'] = $id;
|
||||
foreach ($tabEtabs as $tabInsert2) {
|
||||
$tabInsert2['dateInsert']=$tabInsert['dateInsert'];
|
||||
$id2=$this->iDb->insert('jo.artisanat_etab', $tabInsert2, true);
|
||||
$tabInsert2['dateInsert'] = $tabInsert['dateInsert'];
|
||||
$id2 = $this->iDb->insert('jo.artisanat_etab', $tabInsert2, true);
|
||||
}
|
||||
|
||||
$tabInsert['dateUpdate']=substr($tabInsert['dateInsert'],0,10);
|
||||
$tabInsert['dateUpdate'] = substr($tabInsert['dateInsert'],0,10);
|
||||
unset($tabInsert['dateInsert']);
|
||||
}
|
||||
|
||||
return $tabInsert;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -8,10 +8,10 @@ class Metier_Partenaires_MCadastre
|
||||
protected $siren = null;
|
||||
|
||||
/**
|
||||
* Database
|
||||
* @var Metier_Util_Db
|
||||
* PDO Connection with Doctrine
|
||||
* @var \Doctrine\DBAL\Connection
|
||||
*/
|
||||
protected $iDb;
|
||||
protected $conn;
|
||||
|
||||
/**
|
||||
* Droits des locaux
|
||||
@ -162,17 +162,20 @@ class Metier_Partenaires_MCadastre
|
||||
|
||||
/**
|
||||
* Cadastre
|
||||
* @param string $siren
|
||||
* @param Metier_Util_Db $db
|
||||
* @param \Doctrine\DBAL\Connection $conn
|
||||
*/
|
||||
public function __construct($siren = null, $db = null)
|
||||
public function __construct($conn = null)
|
||||
{
|
||||
$this->siren = $siren;
|
||||
if ( $db === null ) {
|
||||
$this->iDb = new Metier_Util_Db();
|
||||
} else {
|
||||
$this->iDb = $db;
|
||||
$this->conn = Zend_Registry::get('doctrine');
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifiant
|
||||
* @param string $companyId
|
||||
*/
|
||||
public function setId($companyId)
|
||||
{
|
||||
$this->siren = $companyId;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -230,15 +233,14 @@ class Metier_Partenaires_MCadastre
|
||||
$siren = $this->siren;
|
||||
}
|
||||
|
||||
$results = $this->iDb->select(
|
||||
'sdv1.cad_perloc l, sdv1.cad_permor e',
|
||||
'e.INTCIF, e.DNUPER, e.CCOGRM, e.DDENPM, e.DSIPMO, e.DFORME, e.DSIREN, e.DLIGN3, e.DLIGN4, e.DLIGN5, e.DLIGN6, e.CCODEP, e.CCOCOM AS companyCCOCOM,
|
||||
l.CCODRO, l.CCOCOM, l.CCOPRF, l.CCOSEC, l.DNUPLA, l.DNUBAT, l.DESC, l.DNIV, l.DPOR, l.CCONLC, l.CCOAFF0, l.DSUPOD0, l.CCOAFF1, l.DSUPOD1, l.CCOAFF2, l.DSUPOD2, l.CCOAFF3, l.DSUPOD3, l.CCOAFF4, l.DSUPOD4, l.CCOAFF5, l.DSUPOD5, l.CCOAFF6, l.DSUPOD6, l.CCOAFF7, l.DSUPOD7, l.CCOAFF8, l.DSUPOD8, l.CCOAFF9, l.DSUPOD9, l.CCODEP, l.DLICOM, l.CCORIV, l.CNAVOI, l.DLIVOI, l.DNUVOI, l.DLTNUV',
|
||||
"e.DSIREN='$siren' AND e.INTCIF=l.INTCIF AND e.DNUPER=l.DNUPER", false, MYSQL_ASSOC);
|
||||
$sql = "SELECT e.INTCIF, e.DNUPER, e.CCOGRM, e.DDENPM, e.DSIPMO, e.DFORME, e.DSIREN, e.DLIGN3, e.DLIGN4, e.DLIGN5, e.DLIGN6, e.CCODEP, e.CCOCOM AS companyCCOCOM,
|
||||
l.CCODRO, l.CCOCOM, l.CCOPRF, l.CCOSEC, l.DNUPLA, l.DNUBAT, l.DESC, l.DNIV, l.DPOR, l.CCONLC, l.CCOAFF0, l.DSUPOD0, l.CCOAFF1, l.DSUPOD1, l.CCOAFF2, l.DSUPOD2, l.CCOAFF3, l.DSUPOD3, l.CCOAFF4, l.DSUPOD4, l.CCOAFF5, l.DSUPOD5, l.CCOAFF6, l.DSUPOD6, l.CCOAFF7, l.DSUPOD7, l.CCOAFF8, l.DSUPOD8, l.CCOAFF9, l.DSUPOD9, l.CCODEP, l.DLICOM, l.CCORIV, l.CNAVOI, l.DLIVOI, l.DNUVOI, l.DLTNUV
|
||||
FROM sdv1.cad_perloc l, sdv1.cad_permor e WHERE e.DSIREN='$siren' AND e.INTCIF=l.INTCIF AND e.DNUPER=l.DNUPER";
|
||||
$stmt = $this->conn->executeQuery($sql);
|
||||
|
||||
$locaux = array();
|
||||
if (count($results) > 0) {
|
||||
foreach ($results as $i => $loc) {
|
||||
if ($stmt->rowCount() > 0) {
|
||||
while($loc = $stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
$format = array(
|
||||
'idCentre' => $loc['INTCIF'],
|
||||
'idPmMajic' => $loc['DNUPER'],
|
||||
@ -306,15 +308,15 @@ class Metier_Partenaires_MCadastre
|
||||
$siren = $this->siren;
|
||||
};
|
||||
|
||||
$results = $this->iDb->select(
|
||||
'sdv1.cad_perpar p, sdv1.cad_permor e',
|
||||
'e.INTCIF, e.DNUPER, e.CCOGRM, e.DDENPM, e.DSIPMO, e.DFORME, e.DSIREN, e.DLIGN3, e.DLIGN4, e.DLIGN5, e.DLIGN6, e.CCODEP, e.CCOCOM AS companyCCOCOM,
|
||||
p.CCODRO, p.CCOCOM, p.CCOPRF, p.CCOSEC, p.DNUPLA, p.DCNPAR, p.DSGRPF0, p.DCNSUF0, p.DSGRPF1, p.DCNSUF1, p.DSGRPF2, p.DCNSUF2, p.DSGRPF3, p.DCNSUF3, p.DSGRPF4, p.DCNSUF4, p.DSGRPF5, p.DCNSUF5, p.DSGRPF6, p.DCNSUF6, p.DSGRPF7, p.DCNSUF7, p.DSGRPF8, p.DCNSUF8, p.DSGRPF9, p.DCNSUF9, p.CCODEP, p.DLICOM, p.CCORIV, p.CNAVOI, p.DLIVOI, p.DNUVOI, p.DLTNUV',
|
||||
"e.DSIREN='$siren' AND e.INTCIF=p.INTCIF AND e.DNUPER=p.DNUPER", false, MYSQL_ASSOC);
|
||||
$sql = "SELECT e.INTCIF, e.DNUPER, e.CCOGRM, e.DDENPM, e.DSIPMO, e.DFORME, e.DSIREN, e.DLIGN3, e.DLIGN4, e.DLIGN5, e.DLIGN6, e.CCODEP, e.CCOCOM AS companyCCOCOM,
|
||||
p.CCODRO, p.CCOCOM, p.CCOPRF, p.CCOSEC, p.DNUPLA, p.DCNPAR, p.DSGRPF0, p.DCNSUF0, p.DSGRPF1, p.DCNSUF1, p.DSGRPF2, p.DCNSUF2, p.DSGRPF3, p.DCNSUF3, p.DSGRPF4, p.DCNSUF4, p.DSGRPF5, p.DCNSUF5, p.DSGRPF6, p.DCNSUF6, p.DSGRPF7, p.DCNSUF7, p.DSGRPF8, p.DCNSUF8, p.DSGRPF9, p.DCNSUF9, p.CCODEP, p.DLICOM, p.CCORIV, p.CNAVOI, p.DLIVOI, p.DNUVOI, p.DLTNUV
|
||||
FROM sdv1.cad_perpar p, sdv1.cad_permor e
|
||||
WHERE e.DSIREN='$siren' AND e.INTCIF=p.INTCIF AND e.DNUPER=p.DNUPER";
|
||||
$stmt = $this->conn->executeQuery($sql);
|
||||
|
||||
$parcelles = array();
|
||||
if (count($results) > 0) {
|
||||
foreach ($results as $i => $loc) {
|
||||
if ($stmt->rowCount() > 0) {
|
||||
while($loc = $stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
$format = array(
|
||||
'idCentre' => $loc['INTCIF'],
|
||||
'idPmMajic' => $loc['DNUPER'],
|
||||
@ -368,6 +370,41 @@ class Metier_Partenaires_MCadastre
|
||||
return $parcelles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Nombre d'éléments et surface total
|
||||
* @param string $types (local, parcelle)
|
||||
* @param string $droit (P:Propriétaire, L:Locataire)
|
||||
* @return mixed
|
||||
* false | [itemTotal, surfaceTotal]
|
||||
*/
|
||||
public function getSurfaceTotal($type = 'local', $droit = 'P')
|
||||
{
|
||||
if ($type == 'local') {
|
||||
$droitSql = " AND l.CCODRO='P'";
|
||||
if ($droit != 'P') {
|
||||
$droitSql = " AND l.CCODRO!='P'";
|
||||
}
|
||||
$sql = "SELECT count(*) AS itemTotal, (SUM(l.DSUPOD0) + SUM(l.DSUPOD1) + SUM(l.DSUPOD2) + SUM(l.DSUPOD3) + SUM(l.DSUPOD4) + SUM(l.DSUPOD5) + SUM(l.DSUPOD7) + SUM(l.DSUPOD8) + SUM(l.DSUPOD9)) AS surfaceTotal
|
||||
FROM sdv1.cad_perloc l, sdv1.cad_permor e
|
||||
WHERE e.DSIREN='".$this->siren."' AND e.INTCIF=l.INTCIF AND e.DNUPER=l.DNUPER".$droitSql;
|
||||
$stmt = $this->conn->executeQuery($sql);
|
||||
$results = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
}
|
||||
elseif ($type == 'parcelle') {
|
||||
$droitSql = " AND p.CCODRO='P'";
|
||||
if ($droit != 'P') {
|
||||
$droitSql = " AND p.CCODRO!='P'";
|
||||
}
|
||||
$sql = "SELECT count(*) AS itemTotal, sum(p.DCNPAR) AS surfaceTotal
|
||||
FROM sdv1.cad_perpar p, sdv1.cad_permor e
|
||||
WHERE e.DSIREN='".$this->siren."' AND e.INTCIF=p.INTCIF AND e.DNUPER=p.DNUPER".$droitSql;
|
||||
$stmt = $this->conn->executeQuery($sql);
|
||||
$results = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* List des éléments du patrimoine
|
||||
* @return array
|
||||
@ -455,15 +492,11 @@ class Metier_Partenaires_MCadastre
|
||||
"WHERE e.DSIREN='$this->siren' AND e.INTCIF=p.INTCIF AND e.DNUPER=p.DNUPER";
|
||||
|
||||
$sql = "SELECT * FROM ( ($locauxSql) UNION ALL ($parcellesSql) ) results";
|
||||
|
||||
$db = Zend_Db_Table::getDefaultAdapter();
|
||||
|
||||
//$results = $this->iDb->query($sql, true);
|
||||
$results = $db->fetchAll($sql, null, Zend_Db::FETCH_ASSOC);
|
||||
$stmt = $this->conn->executeQuery($sql);
|
||||
|
||||
$list = array();
|
||||
if (count($results) > 0) {
|
||||
foreach ($results as $result) {
|
||||
if ($stmt->rowCount() > 0) {
|
||||
while ($result = $stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
// Libellé role
|
||||
$result['roleLib'] = self::$codeDroit[trim($result['role'])];
|
||||
$list[] = $result;
|
||||
|
@ -514,7 +514,7 @@ class Metier_Partenaires_MMap
|
||||
'alt'=>$this->altitude,
|
||||
'precis'=>$this->precision,
|
||||
'source'=>$this->geocodeur,
|
||||
'dateInsert'=>DATETIME,
|
||||
'dateInsert'=>date('YmdHis'),
|
||||
);
|
||||
/** Insertion de l'adresse que si elle est possible
|
||||
**/
|
||||
|
@ -36,9 +36,24 @@ class Metier_Rnvp_Adresse
|
||||
);
|
||||
|
||||
/**
|
||||
* Récupération de l'adresse normalisé
|
||||
* PDO Connection with Doctrine
|
||||
* @var \Doctrine\DBAL\Connection
|
||||
*/
|
||||
public function __construct(){}
|
||||
protected $conn;
|
||||
|
||||
/**
|
||||
* Récupération de l'adresse normalisé
|
||||
* @param \Doctrine\DBAL\Connection $conn
|
||||
*/
|
||||
public function __construct($conn = null)
|
||||
{
|
||||
if ($conn === null) {
|
||||
$this->conn = Zend_Registry::get('doctrine');
|
||||
}
|
||||
else {
|
||||
$this->conn = $conn;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -59,17 +74,21 @@ class Metier_Rnvp_Adresse
|
||||
public function setCompanyIdProxy($companyId)
|
||||
{
|
||||
try {
|
||||
$etabM = new Application_Model_JoEtablissements();
|
||||
$sql = $etabM->select(true)->columns(array('LPAD(source,3,0) AS source', 'LPAD(source_id,20,0) AS sourceId'))
|
||||
->where('siren=?', substr($companyId,0,9))
|
||||
->where('nic=?', substr($companyId,9,5));
|
||||
$etabResult = $etabM->fetchRow($sql);
|
||||
if ($etabResult === null) {
|
||||
$sql = "SELECT LPAD(source,3,0) AS source AND LPAD(source_id,20,0) AS source_id
|
||||
FROM jo.etablissements WHERE siren=:siren AND nic=:nic";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('siren', substr($companyId,0,9));
|
||||
$stmt->bindValue('nic', substr($companyId,9,5));
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount() == 0) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
$etabResult = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
$this->source = $etabResult->source;
|
||||
$this->sourceId = $etabResult->source_id;
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
}
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception($e->getMessage(), 'ERR');
|
||||
}
|
||||
}
|
||||
@ -81,17 +100,19 @@ class Metier_Rnvp_Adresse
|
||||
*/
|
||||
public function format()
|
||||
{
|
||||
try
|
||||
{
|
||||
$rnvpM = new Application_Model_VillesRnvpSources();
|
||||
$sql = $rnvpM->select(true)->columns($this->columns)
|
||||
->where('source=?', $this->source)
|
||||
->where('source_id=?', $this->sourceId);
|
||||
$rnvpResult = $rnvpM->fetchRow($sql);
|
||||
if ($rnvpResult === null) {
|
||||
try {
|
||||
$qb = $this->conn->createQueryBuilder();
|
||||
$qb->select($this->columns)
|
||||
->from('villes.rnvpSources')
|
||||
->where('source = :source')->setParameter('source', $this->source)
|
||||
->andWhere('source_id = :sourceId')->setParameter('sourceId', $this->sourceId);
|
||||
$stmt = $qb->execute();
|
||||
if ($stmt->rowCount() == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$rnvpResult = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
|
||||
$rnvp = new stdClass();
|
||||
$rnvp->L1 = $rnvpResult->L1rnvp;
|
||||
$rnvp->L2 = $rnvpResult->L2rnvp;
|
||||
@ -134,8 +155,8 @@ class Metier_Rnvp_Adresse
|
||||
$rnvp->CedexaCdxL6 = $rnvpResult->Cdx_V6Cdx;
|
||||
$rnvp->DateInsert = $rnvpResult->dateInsert;
|
||||
$rnvp->DateUpdate = $rnvpResult->dateUpdate;
|
||||
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
throw new Exception($e->getMessage(), 'ERR');
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -9,20 +9,26 @@ define('INDISCORE_DEBUG', false);
|
||||
*/
|
||||
function getIndiscoreHisto($siren)
|
||||
{
|
||||
if (intval($siren) < 1000) return false;
|
||||
if (intval($siren) < 1000) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$query="SELECT siren, actif, procol, naf, indiScore, indiScore20, encours, indiScoreDate, dateBilan, sourceModif, scoreSolv, scoreDir, scoreConf, scoreZ, scoreCH, scoreAfdcc1, scoreAfdcc2, scoreAfdcc2note, scoreAltman, scoreAltmanCote, scoreCCF, cs, csMoisMaj, csMoisFin, adresseDom, situFi, infoNote, noteStruct, noteFin, tendance, nbModifs, dateUpdate
|
||||
FROM jo.scores_surveillance
|
||||
WHERE siren=$siren
|
||||
UNION SELECT siren, actif, procol, naf, indiScore, indiScore20, encours, indiScoreDate, dateBilan, sourceModif, scoreSolv, scoreDir, scoreConf, scoreZ, scoreCH, scoreAfdcc1, scoreAfdcc2, scoreAfdcc2note, scoreAltman, scoreAltmanCote, scoreCCF, cs, csMoisMaj, csMoisFin, adresseDom, situFi, infoNote, noteStruct, noteFin, tendance, nbModifs, dateUpdate
|
||||
FROM historiques.scores_surveillance
|
||||
WHERE siren=$siren
|
||||
$query = "SELECT siren, actif, procol, naf, indiScore, indiScore20, encours, indiScoreDate,
|
||||
dateBilan, sourceModif, scoreSolv, scoreDir, scoreConf, scoreZ, scoreCH, scoreAfdcc1,
|
||||
scoreAfdcc2, scoreAfdcc2note, scoreAltman, scoreAltmanCote, scoreCCF, cs, csMoisMaj,
|
||||
csMoisFin, adresseDom, situFi, infoNote, noteStruct, noteFin, tendance, nbModifs, dateUpdate
|
||||
FROM jo.scores_surveillance WHERE siren=$siren UNION SELECT siren, actif, procol, naf,
|
||||
indiScore, indiScore20, encours, indiScoreDate, dateBilan, sourceModif, scoreSolv,
|
||||
scoreDir, scoreConf, scoreZ, scoreCH, scoreAfdcc1, scoreAfdcc2, scoreAfdcc2note, scoreAltman,
|
||||
scoreAltmanCote, scoreCCF, cs, csMoisMaj, csMoisFin, adresseDom, situFi, infoNote,
|
||||
noteStruct, noteFin, tendance, nbModifs, dateUpdate
|
||||
FROM historiques.scores_surveillance WHERE siren=$siren
|
||||
GROUP BY indiScoreDate
|
||||
ORDER BY indiScoreDate DESC";
|
||||
$iDb = new Metier_Util_Db();
|
||||
$ret = $iDb->query($query);
|
||||
$tabRet = array();
|
||||
while( $ret = $iDb->fetch(MYSQL_ASSOC) ) {
|
||||
while($ret = $iDb->fetch(MYSQL_ASSOC)) {
|
||||
$tabRet[] = array(
|
||||
'siren' => $ret['siren'],
|
||||
'actif' => $ret['actif'],
|
||||
@ -68,8 +74,13 @@ function getIndiscoreHisto($siren)
|
||||
*/
|
||||
function getIndiscoreCache($siren)
|
||||
{
|
||||
if ($siren<1000) return false;
|
||||
$query="SELECT siren, actif, procol, naf, indiScore, indiScore20, encours, indiScoreDate, dateBilan, sourceModif, scoreSolv, scoreDir, scoreConf, scoreZ, scoreCH, scoreAfdcc1, scoreAfdcc2, scoreAfdcc2note, scoreAltman, scoreAltmanCote, scoreCCF, cs, csMoisMaj, csMoisFin, adresseDom, situFi, infoNote, noteStruct, noteFin, tendance, nbModifs, dateUpdate
|
||||
if ($siren < 1000) {
|
||||
return false;
|
||||
}
|
||||
$query = "SELECT siren, actif, procol, naf, indiScore, indiScore20, encours, indiScoreDate,
|
||||
dateBilan, sourceModif, scoreSolv, scoreDir, scoreConf, scoreZ, scoreCH, scoreAfdcc1,
|
||||
scoreAfdcc2, scoreAfdcc2note, scoreAltman, scoreAltmanCote, scoreCCF, cs, csMoisMaj,
|
||||
csMoisFin, adresseDom, situFi, infoNote, noteStruct, noteFin, tendance, nbModifs, dateUpdate
|
||||
FROM jo.scores_surveillance
|
||||
WHERE siren=$siren
|
||||
ORDER BY indiScoreDate DESC";
|
||||
@ -123,12 +134,15 @@ function getIndiscoreCache($siren)
|
||||
*/
|
||||
function getScoreSecteur($naf5)
|
||||
{
|
||||
if (len($naf)<>5) return false;
|
||||
$tabTmp=$iDb->select( 'jo.scores_surveillance',
|
||||
'naf, AVG(indiScore) AS score100moy, AVG(indiScore20) AS score20moy, AVG(encours) AS encoursMoy, MAX(indiScoreDate) AS lastScore, COUNT(siren) AS nbSiren',
|
||||
if (len($naf) != 5) {
|
||||
return false;
|
||||
}
|
||||
$tabTmp = $iDb->select('jo.scores_surveillance',
|
||||
'naf, AVG(indiScore) AS score100moy, AVG(indiScore20) AS score20moy,
|
||||
AVG(encours) AS encoursMoy, MAX(indiScoreDate) AS lastScore, COUNT(siren) AS nbSiren',
|
||||
"naf='$naf5' AND actif=1", false, MYSQL_ASSOC);
|
||||
if ( count($tabTmp)>0 ) {
|
||||
$tabTmp=$tabTmp[0];
|
||||
if (count($tabTmp) > 0) {
|
||||
$tabTmp = $tabTmp[0];
|
||||
return array(
|
||||
'naf' => $tabTmp['naf'],
|
||||
'score100moy' => $tabTmp['score100moy'],
|
||||
@ -167,7 +181,7 @@ function getTxTva($date)
|
||||
function getTxRendement($annee)
|
||||
{
|
||||
$tabTxRendObli = include __DIR__ . '/Data/RendObli.php';
|
||||
if ( isset($tabTxRendObli[$annee]) ) {
|
||||
if (isset($tabTxRendObli[$annee])) {
|
||||
return $tabTxRendObli[$annee];
|
||||
}
|
||||
}
|
||||
@ -189,14 +203,18 @@ function number_format2($nombre, $decimales, $sepDec, $sepMil, $unite, $signe)
|
||||
if ($signe == '+') {
|
||||
if ($nombre > 0) {
|
||||
return '+ '.number_format(abs($nombre),$decimales,$sepDec,$sepMil).' '.$unite;
|
||||
} elseif ($nombre<0) {
|
||||
}
|
||||
elseif ($nombre < 0) {
|
||||
return '- '.number_format(abs($nombre),$decimales,$sepDec,$sepMil).' '.$unite;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return number_format(abs($nombre),$decimales,$sepDec,$sepMil).' '.$unite;
|
||||
}
|
||||
} elseif ($signe=='!') {
|
||||
}
|
||||
elseif ($signe == '!') {
|
||||
return number_format(abs($nombre),$decimales,$sepDec,$sepMil).' '.$unite;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return number_format($nombre,$decimales,$sepDec,$sepMil).' '.$unite;
|
||||
}
|
||||
}
|
||||
@ -292,27 +310,31 @@ function formatValeur($variable, $longeur=0, $fonction='')
|
||||
if ( isset($tabVariables[$nomVar]) ) {
|
||||
if ($longeur>0) {
|
||||
return $variable;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// Tableau ZEMET
|
||||
if ($nomVar=='ZEMET') {
|
||||
if ($nomVar == 'ZEMET') {
|
||||
global $RPET, $DateNotice80;
|
||||
if ( substr($DateNotice80,0,4)>=2010 ) {
|
||||
if ( substr($DateNotice80,0,4) >= 2010 ) {
|
||||
$tableZemet = 'ZEMET2010';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$tableZemet = 'ZEMET1994';
|
||||
}
|
||||
// Cette variable a un libellé associé
|
||||
if (isset($tabVariables[$tableZemet][$RPET.$ZEMET]['art'])) {
|
||||
return $tabVariables[$tableZemet][$RPET.$ZEMET]['art'];
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return $tabVariables[$tableZemet][$RPET.$ZEMET]['lib'];
|
||||
}
|
||||
}
|
||||
// Cette variable a un libellé associé
|
||||
$strTmp=eval("return $valeur;");
|
||||
if (isset($tabVariables[$nomVar][$strTmp]['lib'])){
|
||||
if (isset($tabVariables[$nomVar][$strTmp]['lib'])) {
|
||||
return $tabVariables[$nomVar][$strTmp]['lib'];
|
||||
} elseif (isset($tabVariables[$nomVar]['0'.$strTmp]['lib'])){
|
||||
}
|
||||
elseif (isset($tabVariables[$nomVar]['0'.$strTmp]['lib'])) {
|
||||
return $tabVariables[$nomVar]['0'.$strTmp]['lib'];
|
||||
}
|
||||
}
|
||||
@ -346,25 +368,32 @@ function formatValeur($variable, $longeur=0, $fonction='')
|
||||
// --- Formattage variable [...]_EU
|
||||
elseif (preg_match('/_EU$/', $nomVar)) {
|
||||
$strTmp=eval("return $valeur;");
|
||||
if ($strTmp>=0 && $strTmp<10 || $strTmp>-10 && $strTmp<=0)
|
||||
if ($strTmp>=0 && $strTmp<10 || $strTmp>-10 && $strTmp<=0) {
|
||||
return number_format($strTmp,2,',',' ').' €';
|
||||
elseif ($strTmp>=10 && $strTmp<5000 || $strTmp>-5000 && $strTmp<=10)
|
||||
}
|
||||
elseif ($strTmp>=10 && $strTmp<5000 || $strTmp>-5000 && $strTmp<=10) {
|
||||
return number_format($strTmp,0,',',' ').' €';
|
||||
elseif ($strTmp<=-10000000 || $strTmp>=10000000)
|
||||
}
|
||||
elseif ($strTmp<=-10000000 || $strTmp>=10000000) {
|
||||
return number_format($strTmp/1000000,0,',',' ').' M€';
|
||||
else
|
||||
}
|
||||
else {
|
||||
return number_format($strTmp/1000,0,',',' ').' K€';
|
||||
}
|
||||
}
|
||||
// --- Formattage variable [...]_POURC
|
||||
elseif (preg_match('/_POURC$/', $nomVar)) {
|
||||
$strTmp=eval("return $valeur;");
|
||||
if ($strTmp>=10 || $strTmp<=-10)
|
||||
if ($strTmp>=10 || $strTmp<=-10) {
|
||||
return number_format($strTmp,0,',',' ').' %';
|
||||
elseif ($strTmp>=1 || $strTmp<=-1)
|
||||
}
|
||||
elseif ($strTmp>=1 || $strTmp<=-1) {
|
||||
return number_format($strTmp,1,',',' ').' %';
|
||||
else
|
||||
}
|
||||
else {
|
||||
return number_format($strTmp,3,',',' ').' %';
|
||||
}
|
||||
}
|
||||
// --- Formattage variable [...]CAPITAL
|
||||
elseif (preg_match('/CAPITAL$/', $nomVar)) {
|
||||
return number_format($CAPITAL,0,',', ' ').' €';
|
||||
@ -391,51 +420,85 @@ function formatValeur($variable, $longeur=0, $fonction='')
|
||||
}
|
||||
// --- Formattage variable [...]DIMMAT
|
||||
elseif (preg_match('/DIMMAT$/', $nomVar)) {
|
||||
return preg_replace('/00\//','01/', Metier_Util_Date::dateT('Ymd','d/m/Y', substr(str_replace('-','',$DIMMAT),0,8)));
|
||||
return preg_replace('/00\//','01/',
|
||||
Metier_Util_Date::dateT('Ymd','d/m/Y', substr(str_replace('-','',$DIMMAT),0,8)));
|
||||
}
|
||||
// --- Formattage variable [...]DCREN
|
||||
elseif (preg_match('/DCREN$/',$nomVar)) {
|
||||
return preg_replace('/00\//','01/', Metier_Util_Date::dateT('Ymd','d/m/Y', substr(str_replace('-','',$DCREN),0,8)));
|
||||
return preg_replace('/00\//','01/',
|
||||
Metier_Util_Date::dateT('Ymd','d/m/Y', substr(str_replace('-','',$DCREN),0,8)));
|
||||
}
|
||||
// --- Formattage variable [...]MARCHEVOL
|
||||
elseif (preg_match('/MARCHEVOL$/', $nomVar)) {
|
||||
if (abs($MARCHEVOL)>=5) return round($MARCHEVOL).' %';
|
||||
else return number_format($MARCHEVOL,3,',',' ').' %';
|
||||
if (abs($MARCHEVOL)>=5) {
|
||||
return round($MARCHEVOL).' %';
|
||||
}
|
||||
else {
|
||||
number_format($MARCHEVOL,3,',',' ').' %';
|
||||
}
|
||||
}
|
||||
// --- Formattage variable [...]MARCHEPART
|
||||
elseif (preg_match('/MARCHEPART$/', $nomVar)) {
|
||||
if (abs($MARCHEPART)>=5) return round($MARCHEPART).' %';
|
||||
else return number_format($MARCHEPART,3,',',' ').' %';
|
||||
if (abs($MARCHEPART)>=5) {
|
||||
return round($MARCHEPART).' %';
|
||||
}
|
||||
else {
|
||||
return number_format($MARCHEPART,3,',',' ').' %';
|
||||
}
|
||||
}
|
||||
// --- Formattage variable [...]MARCHEPARTp
|
||||
elseif (preg_match('/MARCHEPARTp$/', $nomVar)) {
|
||||
if (abs($MARCHEPARTp)>=5) return round($MARCHEPARTp).' %';
|
||||
else return number_format($MARCHEPARTp,3,',',' ').' %';
|
||||
if (abs($MARCHEPARTp)>=5) {
|
||||
return round($MARCHEPARTp).' %';
|
||||
}
|
||||
else {
|
||||
return number_format($MARCHEPARTp,3,',',' ').' %';
|
||||
}
|
||||
}
|
||||
// --- Formattage variable [...]MARCHEPARTEVOL
|
||||
elseif (preg_match('/MARCHEPARTEVOL$/', $nomVar)) {
|
||||
if (abs($MARCHEPARTEVOL)>=5) return round($MARCHEPARTEVOL).' %';
|
||||
else return number_format($MARCHEPARTEVOL,3,',',' ').' %';
|
||||
if (abs($MARCHEPARTEVOL)>=5) {
|
||||
return round($MARCHEPARTEVOL).' %';
|
||||
}
|
||||
else {
|
||||
return number_format($MARCHEPARTEVOL,3,',',' ').' %';
|
||||
}
|
||||
}
|
||||
// --- Formattage variable [...]MARCHE
|
||||
elseif (preg_match('/MARCHE$/', $nomVar)) {
|
||||
if ($MARCHE<10000) return number_format($MARCHE,0,',',' ').' €';
|
||||
elseif ($MARCHE<1000000) return number_format($MARCHE/1000,0,',',' ').' K€';
|
||||
elseif ($MARCHE<1000000000) return number_format($MARCHE/1000000,0,',',' ').' M€';
|
||||
else return number_format($MARCHE/1000000000,0,',',' ')." milliards d'€";
|
||||
if ($MARCHE<10000) {
|
||||
return number_format($MARCHE,0,',',' ').' €';
|
||||
}
|
||||
elseif ($MARCHE<1000000) {
|
||||
return number_format($MARCHE/1000,0,',',' ').' K€';
|
||||
}
|
||||
elseif ($MARCHE<1000000000) {
|
||||
return number_format($MARCHE/1000000,0,',',' ').' M€';
|
||||
}
|
||||
else {
|
||||
return number_format($MARCHE/1000000000,0,',',' ')." milliards d'€";
|
||||
}
|
||||
// --- Formattage variable [...]MARCHE
|
||||
elseif (preg_match('/MARCHEp$/', $nomVar)) {
|
||||
if ($MARCHEp<10000) return number_format($MARCHEp,0,',',' ').' €';
|
||||
elseif ($MARCHEp<1000000) return number_format($MARCHEp/1000,0,',',' ').' K€';
|
||||
elseif ($MARCHEp<1000000000)return number_format($MARCHEp/1000000,0,',',' ').' M€';
|
||||
else return number_format($MARCHEp/1000000000,0,',',' ')." milliards d'€";
|
||||
}
|
||||
// --- Formattage variable [...]MARCHEp
|
||||
elseif (preg_match('/MARCHEp$/', $nomVar)) {
|
||||
if ($MARCHEp<10000) {
|
||||
return number_format($MARCHEp,0,',',' ').' €';
|
||||
}
|
||||
elseif ($MARCHEp<1000000) {
|
||||
return number_format($MARCHEp/1000,0,',',' ').' K€';
|
||||
}
|
||||
elseif ($MARCHEp<1000000000) {
|
||||
return number_format($MARCHEp/1000000,0,',',' ').' M€';
|
||||
}
|
||||
else {
|
||||
return number_format($MARCHEp/1000000000,0,',',' ')." milliards d'€";
|
||||
}
|
||||
}
|
||||
// --- Formattage variable CA_Y[*]
|
||||
elseif (preg_match('/^CA_Y\[(.*)\]/U', $nomVar, $matches2)) {
|
||||
return number_format($CA_Y[$matches2[1]]/1000,0,',',' ').' K€';
|
||||
}
|
||||
// --- Formattage variable CA_Y[*]
|
||||
// --- Formattage variable RCAI_Y[*]
|
||||
elseif (preg_match('/^RCAI_Y\[(.*)\]/U', $nomVar, $matches2)) {
|
||||
return number_format($RCAI_Y[$matches2[1]]/1000,0,',',' ').' K€';
|
||||
}
|
||||
@ -482,8 +545,12 @@ function formatValeur($variable, $longeur=0, $fonction='')
|
||||
}
|
||||
// --- Formattage variable SCOREDEFTAUX
|
||||
elseif (preg_match('/^SCOREDEFTAUX$/', $nomVar)) {
|
||||
if ($SCOREDEFTAUX>=5) return round($SCOREDEFTAUX).' %';
|
||||
else return number_format($SCOREDEFTAUX,3,',',' ').' %';
|
||||
if ($SCOREDEFTAUX>=5) {
|
||||
return round($SCOREDEFTAUX).' %';
|
||||
}
|
||||
else {
|
||||
return number_format($SCOREDEFTAUX,3,',',' ').' %';
|
||||
}
|
||||
}
|
||||
// --- Formattage variable BILANANNEE
|
||||
elseif (preg_match('/BILANANNEE$/', $nomVar)) {
|
||||
@ -509,15 +576,22 @@ function format($matches)
|
||||
|
||||
// --- Moyenne
|
||||
if (preg_match("/\{MOY\(R\[(\d+)\],(\d+)\)/Ui", $strRetour, $matches2)) {
|
||||
$tmpRatioId=$matches2[1]*1;
|
||||
$tmpAnnees =$matches2[2]*1;
|
||||
|
||||
$valeur=$R[$tmpRatioId];
|
||||
$tmpRatioId = $matches2[1]*1;
|
||||
$tmpAnnees = $matches2[2]*1;
|
||||
$valeur = $R[$tmpRatioId];
|
||||
for($iMoy=0; $iMoy<$tmpAnnees; $iMoy++) {
|
||||
if ($iMoy==1) $valeur+=$Rp[$tmpRatioId];
|
||||
elseif ($iMoy==2) $valeur+=$Rp2[$tmpRatioId];
|
||||
elseif ($iMoy==3) $valeur+=$Rp3[$tmpRatioId];
|
||||
elseif ($iMoy==4) $valeur+=$Rp4[$tmpRatioId];
|
||||
if ($iMoy==1) {
|
||||
$valeur+= $Rp[$tmpRatioId];
|
||||
}
|
||||
elseif ($iMoy==2) {
|
||||
$valeur+= $Rp2[$tmpRatioId];
|
||||
}
|
||||
elseif ($iMoy==3) {
|
||||
$valeur+= $Rp3[$tmpRatioId];
|
||||
}
|
||||
elseif ($iMoy==4) {
|
||||
$valeur+= $Rp4[$tmpRatioId];
|
||||
}
|
||||
}
|
||||
return formatRatio('', $valeur/$tmpAnnees, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']));
|
||||
}
|
||||
@ -527,53 +601,77 @@ function format($matches)
|
||||
}
|
||||
// --- Ratios
|
||||
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;
|
||||
if ($matches2[1]=='+') $forceSigne='+';
|
||||
elseif ($matches2[1]=='!') $forceSigne='!';
|
||||
else $forceSigne='';
|
||||
if ($tmpRatio=='R')
|
||||
return formatRatio($R, $tmpRatioId, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']), $forceSigne);
|
||||
elseif ($tmpRatio=='Rp')
|
||||
return formatRatio($Rp, $tmpRatioId, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']), $forceSigne);
|
||||
elseif ($tmpRatio=='Rp2')
|
||||
return formatRatio($Rp2, $tmpRatioId, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']), $forceSigne);
|
||||
elseif ($tmpRatio=='Rp3')
|
||||
return formatRatio($Rp3, $tmpRatioId, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']), $forceSigne);
|
||||
elseif ($tmpRatio=='Rp4')
|
||||
return formatRatio($Rp4, $tmpRatioId, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']), $forceSigne);
|
||||
elseif ($tmpRatio=='Ra')
|
||||
return formatRatio($Ra, $tmpRatioId, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']), $forceSigne);
|
||||
elseif ($tmpRatio=='Rap')
|
||||
return formatRatio($Rap, $tmpRatioId, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']), $forceSigne);
|
||||
elseif ($tmpRatio=='Rs')
|
||||
return formatRatio($Rs, $tmpRatioId, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']), $forceSigne);
|
||||
elseif ($tmpRatio=='Rsp')
|
||||
return formatRatio($Rsp, $tmpRatioId, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']), $forceSigne);
|
||||
elseif ($tmpRatio=='Rsp2')
|
||||
return formatRatio($Rsp2, $tmpRatioId, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']), $forceSigne);
|
||||
elseif ($tmpRatio=='Rsp3')
|
||||
return formatRatio($Rsp3, $tmpRatioId, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']), $forceSigne);
|
||||
elseif ($tmpRatio=='Rsp4')
|
||||
return formatRatio($Rsp4, $tmpRatioId, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']), $forceSigne);
|
||||
elseif ($tmpRatio=='Revol')
|
||||
$tmpRatio = $matches2[2];
|
||||
$tmpRatioId = $matches2[3]*1;
|
||||
$unite = strtoupper($tabFormulesRatios[$tmpRatioId]['unite']);
|
||||
if ($matches2[1]=='+') {
|
||||
$forceSigne='+';
|
||||
}
|
||||
elseif ($matches2[1]=='!') {
|
||||
$forceSigne='!';
|
||||
}
|
||||
else {
|
||||
$forceSigne='';
|
||||
}
|
||||
if ($tmpRatio=='R') {
|
||||
return formatRatio($R, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
elseif ($tmpRatio=='Rp') {
|
||||
return formatRatio($Rp, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
elseif ($tmpRatio=='Rp2') {
|
||||
return formatRatio($Rp2, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
elseif ($tmpRatio=='Rp3') {
|
||||
return formatRatio($Rp3, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
elseif ($tmpRatio=='Rp4') {
|
||||
return formatRatio($Rp4, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
elseif ($tmpRatio=='Ra') {
|
||||
return formatRatio($Ra, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
elseif ($tmpRatio=='Rap') {
|
||||
return formatRatio($Rap, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
elseif ($tmpRatio=='Rs') {
|
||||
return formatRatio($Rs, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
elseif ($tmpRatio=='Rsp') {
|
||||
return formatRatio($Rsp, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
elseif ($tmpRatio=='Rsp2') {
|
||||
return formatRatio($Rsp2, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
elseif ($tmpRatio=='Rsp3') {
|
||||
return formatRatio($Rsp3, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
elseif ($tmpRatio=='Rsp4') {
|
||||
return formatRatio($Rsp4, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
elseif ($tmpRatio=='Revol') {
|
||||
return formatRatio($Revol, $tmpRatioId, '%', $forceSigne);
|
||||
elseif ($tmpRatio=='Rdiff')
|
||||
return formatRatio($Rdiff, $tmpRatioId, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']), $forceSigne);
|
||||
elseif ($tmpRatio=='Revolp')
|
||||
}
|
||||
elseif ($tmpRatio=='Rdiff') {
|
||||
return formatRatio($Rdiff, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
elseif ($tmpRatio=='Revolp') {
|
||||
return formatRatio($Revolp, $tmpRatioId, '%', $forceSigne);
|
||||
elseif ($tmpRatio=='Revolp2')
|
||||
}
|
||||
elseif ($tmpRatio=='Revolp2') {
|
||||
return formatRatio($Revolp2, $tmpRatioId, '%', $forceSigne);
|
||||
elseif ($tmpRatio=='Revolp3')
|
||||
}
|
||||
elseif ($tmpRatio=='Revolp3') {
|
||||
return formatRatio($Revolp3, $tmpRatioId, '%', $forceSigne);
|
||||
elseif ($tmpRatio=='regR')
|
||||
return formatRatio($regR, $tmpRatioId, strtoupper($tabFormulesRatios[$tmpRatioId]['unite']), $forceSigne);
|
||||
|
||||
}
|
||||
elseif ($tmpRatio=='regR') {
|
||||
return formatRatio($regR, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
}
|
||||
// --- Valeur
|
||||
elseif (preg_match('/\$\{(.*)\((\d+)\)\}/Ui', $strRetour, $matches2)) {
|
||||
$tmpVar=$matches2[1];
|
||||
$tmpVarLen=$matches2[2]*1;
|
||||
$tmpVar = $matches2[1];
|
||||
$tmpVarLen = $matches2[2]*1;
|
||||
return formatValeur('$'.$tmpVar, $tmpVarLen);
|
||||
}
|
||||
else {
|
||||
@ -687,22 +785,22 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
|
||||
$tabRatiosSecteurs = $tabRatios2 = $tabRatiosEvol = array();
|
||||
|
||||
$NIC=substr($tabIdentite['SiretSiege'],-5);
|
||||
$SIREN=$siren;
|
||||
$SIRET=$tabIdentite['SiretSiege'];
|
||||
$NIC = substr($tabIdentite['SiretSiege'],-5);
|
||||
$SIREN = $siren;
|
||||
$SIRET = $tabIdentite['SiretSiege'];
|
||||
|
||||
$ANNEE=date('Y')*1;
|
||||
$ANNEEp3=$ANNEE-3;
|
||||
$ANNEEp2=$ANNEE-2;
|
||||
$ANNEEp=$ANNEE-1;
|
||||
$ANNEE1=$ANNEE+1;
|
||||
$ANNEE2=$ANNEE+2;
|
||||
$ANNEE3=$ANNEE+3;
|
||||
$ANNEE4=$ANNEE+4;
|
||||
$ANNEE5=$ANNEE+5;
|
||||
$ANNEE = date('Y')*1;
|
||||
$ANNEEp3 = $ANNEE-3;
|
||||
$ANNEEp2 = $ANNEE-2;
|
||||
$ANNEEp = $ANNEE-1;
|
||||
$ANNEE1 = $ANNEE+1;
|
||||
$ANNEE2 = $ANNEE+2;
|
||||
$ANNEE3 = $ANNEE+3;
|
||||
$ANNEE4 = $ANNEE+4;
|
||||
$ANNEE5 = $ANNEE+5;
|
||||
|
||||
$JOUR_DATE=date('Y-m-d');
|
||||
$JOUR_HEURE=date('H:i');
|
||||
$JOUR_DATE = date('Y-m-d');
|
||||
$JOUR_HEURE = date('H:i');
|
||||
|
||||
$MAX_TEMOINS=99;
|
||||
|
||||
@ -840,9 +938,9 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
|
||||
$tendance='';
|
||||
$naf=$tabIdentite['NafEnt'];
|
||||
$APEETAB=$tabIdentite['NafEtab'];
|
||||
$TRIBUNAL_ACTUEL=strtr($tabIdentite['TribunalLib'],array('TC '=>'Tribunal de Commerce de '));
|
||||
$TRIBUNAL_CREATION=$TRIBUNAL_PROCOL='';
|
||||
$APEETAB = $tabIdentite['NafEtab'];
|
||||
$TRIBUNAL_ACTUEL = strtr($tabIdentite['TribunalLib'],array('TC '=>'Tribunal de Commerce de '));
|
||||
$TRIBUNAL_CREATION = $TRIBUNAL_PROCOL='';
|
||||
|
||||
$nafLib=$tabIdentite['NafEntLib'];
|
||||
$efftr=$tabIdentite['Effectif']*1;
|
||||
@ -866,27 +964,27 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
// Elements provenant du Notice 80 hors identité
|
||||
$tabIden80=$iInsee->getInfosNotice($siren,$NIC);
|
||||
$timer['getInfosNotice'] = microtime(true);
|
||||
$RECME=$tabIden80['insRECME'];
|
||||
$ZEMET=$tabIden80['insZEMET'];
|
||||
$RPET=$tabIden80['insRPET'];
|
||||
$RPEN=$tabIden80['insRPEN'];
|
||||
$DateNotice80=$tabIden80['dateNotice'];
|
||||
$depcomen=$tabIden80['insDEPCOMEN']*1;
|
||||
$TU=$tabIden80['insTU'];
|
||||
$RECME = $tabIden80['insRECME'];
|
||||
$ZEMET = $tabIden80['insZEMET'];
|
||||
$RPET = $tabIden80['insRPET'];
|
||||
$RPEN = $tabIden80['insRPEN'];
|
||||
$DateNotice80 = $tabIden80['dateNotice'];
|
||||
$depcomen = $tabIden80['insDEPCOMEN']*1;
|
||||
$TU = $tabIden80['insTU'];
|
||||
|
||||
/**
|
||||
* Différences INSEE/RNCS
|
||||
*/
|
||||
$iRncs = new Metier_Partenaires_MRncs($iDb);
|
||||
$tabIdentiteRncs=$iRncs->getInfosEntrep($siren);
|
||||
$ACTIFRNCS=$tabIdentiteRncs['actif'];
|
||||
$ACTIFINSEE=$tabIdentite['Actif'];
|
||||
$ACTIFRNCS = $tabIdentiteRncs['actif'];
|
||||
$ACTIFINSEE = $tabIdentite['Actif'];
|
||||
|
||||
$APEENT=$APEINSEE=$naf;
|
||||
$APERNCS=$tabIdentiteRncs['nafEnt'];
|
||||
if (strlen($APEENT)==5) $APE5=$APEENT;
|
||||
elseif (strlen($APEENT)==4) $APE4=$APEENT;
|
||||
else $APE5=$APE4='';
|
||||
$APEENT = $APEINSEE=$naf;
|
||||
$APERNCS = $tabIdentiteRncs['nafEnt'];
|
||||
if (strlen($APEENT)==5) $APE5 = $APEENT;
|
||||
elseif (strlen($APEENT)==4) $APE4 = $APEENT;
|
||||
else $APE5 = $APE4='';
|
||||
|
||||
$DIMMAT=$tabIdentiteRncs['dateImma'];
|
||||
$DIMMAT_AA=substr($tabIdentiteRncs['dateImma'],0,4);
|
||||
@ -908,34 +1006,34 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
if ($tabIdentite['Source']*1<>2) $PRESENTINSEE=false;
|
||||
else $PRESENTINSEE=true;
|
||||
|
||||
$NOMEN=trim(strtr($tabIdentite['Nom'],array('*'=>' ','/'=>' ')));
|
||||
$ENSEIGNE=$tabIdentite['Enseigne'];
|
||||
$ENTREP_ALT=$tabIdentite['GeoAlt']; // Altitude de l'établissement
|
||||
$ACTIVNAT=$tabIdentite['NatureActivite'];
|
||||
$AUXILT=$tabIdentite['Auxiliaire'];
|
||||
$ORIGINE=$tabIdentite['OrigineCreation'];
|
||||
$ACTISURF=$tabIdentite['ACTISURF'];
|
||||
$EXPLEN=$tabIdentite['EXPLEN'];
|
||||
$EXPLET=$tabIdentite['EXPLET'];
|
||||
$LIEUACT=$tabIdentite['LIEUACT'];
|
||||
$MODEN=$tabIdentite['MODEN'];
|
||||
$MONOACT=$tabIdentite['MONOACT'];
|
||||
$MONOREG=$tabIdentite['MONOREG'];
|
||||
$PRODPART=$tabIdentite['PRODPART'];
|
||||
$NOMEN = trim(strtr($tabIdentite['Nom'],array('*'=>' ','/'=>' ')));
|
||||
$ENSEIGNE = $tabIdentite['Enseigne'];
|
||||
$ENTREP_ALT = $tabIdentite['GeoAlt']; // Altitude de l'établissement
|
||||
$ACTIVNAT = $tabIdentite['NatureActivite'];
|
||||
$AUXILT = $tabIdentite['Auxiliaire'];
|
||||
$ORIGINE = $tabIdentite['OrigineCreation'];
|
||||
$ACTISURF = $tabIdentite['ACTISURF'];
|
||||
$EXPLEN = $tabIdentite['EXPLEN'];
|
||||
$EXPLET = $tabIdentite['EXPLET'];
|
||||
$LIEUACT = $tabIdentite['LIEUACT'];
|
||||
$MODEN = $tabIdentite['MODEN'];
|
||||
$MONOACT = $tabIdentite['MONOACT'];
|
||||
$MONOREG = $tabIdentite['MONOREG'];
|
||||
$PRODPART = $tabIdentite['PRODPART'];
|
||||
|
||||
// Saisonnalité de l'activité
|
||||
if ($tabIdentite['Saisonnalite']==1) $SAISONAT='S';
|
||||
else $SAISONAT='P';
|
||||
$CAPITAL=$tabIdentite['Capital'];
|
||||
$CAPITAL_NBACTION=$tabIdentite['CapitalNbActions'];
|
||||
$CAPITAL_MTACTION=$tabIdentite['CapitalMtActions'];
|
||||
$CAPITAL_NBACTION = $tabIdentite['CapitalNbActions'];
|
||||
$CAPITAL_MTACTION = $tabIdentite['CapitalMtActions'];
|
||||
if ($CAPITAL>0) {
|
||||
switch ($tabIdentite['CapitalType']) {
|
||||
case 'V': $CAPITAL_TYPE='variable'; break;
|
||||
case 'S': $CAPITAL_TYPE='fixe'; break;
|
||||
default: $CAPITAL_TYPE=''; break;
|
||||
case 'V': $CAPITAL_TYPE = 'variable'; break;
|
||||
case 'S': $CAPITAL_TYPE = 'fixe'; break;
|
||||
default: $CAPITAL_TYPE = ''; break;
|
||||
}
|
||||
} else $CAPITAL_TYPE='';
|
||||
} else $CAPITAL_TYPE = '';
|
||||
|
||||
$TCAEXP=$tabIdentite['TrancheCAexp'];
|
||||
|
||||
@ -1108,9 +1206,9 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
|
||||
$R = $tabRatiosNew[0];
|
||||
$Rp = $tabRatiosNew[1]; // Ratios précédents N-1
|
||||
$Rp2= $tabRatiosNew[2]; // Ratios précédents N-2
|
||||
$Rp3= $tabRatiosNew[3]; // Ratios précédents N-3
|
||||
$Rp4= $tabRatiosNew[4]; // Ratios précédents N-4
|
||||
$Rp2 = $tabRatiosNew[2]; // Ratios précédents N-2
|
||||
$Rp3 = $tabRatiosNew[3]; // Ratios précédents N-3
|
||||
$Rp4 = $tabRatiosNew[4]; // Ratios précédents N-4
|
||||
|
||||
$Rdiff = $tabRatiosDiff[0];
|
||||
|
||||
@ -1251,31 +1349,35 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
"insSIREN=$siren AND insEVE IN ('400','410','420','425','MPF','MNP') ORDER BY insDATEVE DESC",
|
||||
INDISCORE_DEBUG, MYSQL_ASSOC);
|
||||
if (count($tabTmp)>0) {
|
||||
$tabModif=$tabTmp[0];
|
||||
$ETATINSEE_MMAA=substr($tabModif['insDATEVE'],0,7);
|
||||
$tabModif = $tabTmp[0];
|
||||
$ETATINSEE_MMAA = substr($tabModif['insDATEVE'],0,7);
|
||||
switch(''.$tabModif['insEVE']) {
|
||||
// Suppression d'un double
|
||||
case '400':
|
||||
$ACTIFINSEE=false;
|
||||
$ETATINSEE='SUPD';
|
||||
$ACTIFINSEE = false;
|
||||
$ETATINSEE = 'SUPD';
|
||||
break;
|
||||
// Cessation juridique de l'entreprise
|
||||
case '410':
|
||||
if (!$ACTIFINSEE) $ETATINSEE='JURF';
|
||||
if (!$ACTIFINSEE) {
|
||||
$ETATINSEE = 'JURF';
|
||||
}
|
||||
break;
|
||||
// Absence d'activité de l'entreprise (cessation économique de l.entreprise)
|
||||
case '420':
|
||||
// Absence d'activité d'une entreprise suite à une mise à jour au répertoire
|
||||
case '425':
|
||||
if (!$ACTIFINSEE) $ETATINSEE='ECOF';
|
||||
if (!$ACTIFINSEE) {
|
||||
$ETATINSEE='ECOF';
|
||||
}
|
||||
break;
|
||||
// Présumé Fermé
|
||||
case 'MPF':
|
||||
$ETATINSEE='PFER';
|
||||
$ETATINSEE = 'PFER';
|
||||
break;
|
||||
// NPAI
|
||||
case 'MNP':
|
||||
$ETATINSEE='NPAI';
|
||||
$ETATINSEE = 'NPAI';
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2033,7 +2135,8 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
$RJMERE=$RJFILLE=false;
|
||||
$SITUACT=$NICMERE=$SIRENMERE=$SIRETMERE=$NOMMERE='';
|
||||
|
||||
$lienM = new Metier_Liens_Base($siren, 'siren');
|
||||
$lienM = new Metier_Liens_Base();
|
||||
$lienM->setId($siren, 'siren');
|
||||
|
||||
//Actionnaire
|
||||
$tabA = $lienM->getActionnaires(null, true);
|
||||
@ -2732,13 +2835,13 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
if ($tabTmp[0]['scoreConf'] !== null) {
|
||||
$SCORECONF = $tabTmp[0]['scoreConf'];
|
||||
}
|
||||
if ($SCORECONF>$ENQUETEMAXI) {
|
||||
if ($SCORECONF > $ENQUETEMAXI) {
|
||||
$SCORECONF = $ENQUETEMAXI;
|
||||
}
|
||||
if ($tabTmp[0]['scoreDir'] !== null) {
|
||||
$SCOREDIRI = $tabTmp[0]['scoreDir'];
|
||||
}
|
||||
if ($SCOREDIRI>$ENQUETEMAXI) {
|
||||
if ($SCOREDIRI > $ENQUETEMAXI) {
|
||||
$SCOREDIRI = $ENQUETEMAXI;
|
||||
}
|
||||
if ($tabTmp[0]['scoreSolv'] !== null) {
|
||||
@ -2756,57 +2859,94 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
}
|
||||
|
||||
// --- Commentaire Dirigeance
|
||||
if ($SCOREDIRI>=70) {
|
||||
$analyseDir="L'étude de la dirigeance ne relève aucun problème.";
|
||||
} elseif ($SCOREDIRI>=40) {
|
||||
$analyseDir="L'étude de la dirigeance retient notre attention.";
|
||||
} elseif ($SCOREDIRI>0) {
|
||||
$analyseDir="L'étude de la dirigeance attire toute notre attention.";
|
||||
if ($SCOREDIRI >= 70) {
|
||||
$analyseDir = "L'étude de la dirigeance ne relève aucun problème.";
|
||||
} elseif ($SCOREDIRI >= 40) {
|
||||
$analyseDir = "L'étude de la dirigeance retient notre attention.";
|
||||
} elseif ($SCOREDIRI > 0) {
|
||||
$analyseDir = "L'étude de la dirigeance attire toute notre attention.";
|
||||
} else {
|
||||
$analyseDir="L'étude de la dirigeance révèle des anomalies.";
|
||||
$SCOREDIRI=0;
|
||||
$analyseDir = "L'étude de la dirigeance révèle des anomalies.";
|
||||
$SCOREDIRI = 0;
|
||||
}
|
||||
|
||||
// --- Commentaire Conformité
|
||||
if ($tabIdentite['SituationJuridique']=='P') {
|
||||
if ($tabIdentite['SituationJuridique'] == 'P') {
|
||||
$noteSolvabilite = $SCORECONF = $SCOREDIRI = 0;
|
||||
$analyseConf = "L'entreprise est en procédure collective";
|
||||
} elseif ($tabIdentite['SituationJuridique']=='CL') {
|
||||
}
|
||||
elseif ($tabIdentite['SituationJuridique'] == 'CL') {
|
||||
$noteSolvabilite = $SCORECONF = $SCOREDIRI = 0;
|
||||
$analyseConf = "Cloture après la procédure";
|
||||
} elseif ($tabIdentite['SituationJuridique']=='D') {
|
||||
}
|
||||
elseif ($tabIdentite['SituationJuridique'] == 'D') {
|
||||
$noteSolvabilite = $SCORECONF = $SCOREDIRI = 0;
|
||||
$analyseConf = "L'entreprise est dissoute";
|
||||
} elseif ($tabIdentite['Actif']==0) {
|
||||
}
|
||||
elseif ($tabIdentite['SituationJuridique'] == 'A') {
|
||||
$noteSolvabilite = $SCORECONF = $SCOREDIRI = 0;
|
||||
$analyseConf = "L'entreprise est absorbée";
|
||||
}
|
||||
elseif ($tabIdentite['SituationJuridique'] == 'RR' && $FJUR1 != 1) {
|
||||
$noteSolvabilite = $SCORECONF = $SCOREDIRI = 0;
|
||||
$analyseConf = "L'entreprise est radiée";
|
||||
}
|
||||
elseif ($tabIdentite['Actif'] == 0) {
|
||||
$noteSolvabilite = $SCORECONF = $SCOREDIRI = 0;
|
||||
$analyseConf = "L'entreprise n'est pas en activité";
|
||||
} elseif ($SCORECONF>=70) {
|
||||
}
|
||||
elseif ($SCORECONF >= 70) {
|
||||
$analyseConf = "L'analyse de la conformité est correcte.";
|
||||
} elseif ($SCORECONF>=40) {
|
||||
}
|
||||
elseif ($SCORECONF >= 40) {
|
||||
$analyseConf = "L'analyse de la conformité est acceptable.";
|
||||
} elseif ($SCORECONF>0) {
|
||||
}
|
||||
elseif ($SCORECONF > 0) {
|
||||
$analyseConf = "L'analyse de la conformité est sensible.";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$analyseConf = "L'analyse de la conformité est très sensible.";
|
||||
$SCORECONF = 0;
|
||||
}
|
||||
|
||||
// --- Commentaire Solvabilité
|
||||
if ($noteFin>0) $noteSolv=($noteStructure+$noteFin)/2;
|
||||
else $noteSolv=($noteStructure+$noteFin)/5;
|
||||
if ($noteSolv>=15) $analyseSolv = 'Excellente';
|
||||
elseif ($noteSolv>=12) $analyseSolv = 'Bonne';
|
||||
elseif ($noteSolv>=10) $analyseSolv = 'Correcte';
|
||||
elseif ($noteSolv>=8) $analyseSolv = 'Moyenne';
|
||||
elseif ($noteSolv>=6) $analyseSolv = 'Délicate';
|
||||
else $analyseSolv = 'Inquiétante';
|
||||
if ($noteSolvabilite>=40 && $analyseSolv=='Inquiétante') $analyseSolv = 'Correcte';
|
||||
if ($noteFin > 0) {
|
||||
$noteSolv = ($noteStructure+$noteFin)/2;
|
||||
}
|
||||
else {
|
||||
$noteSolv = ($noteStructure+$noteFin)/5;
|
||||
}
|
||||
if ($noteSolv >= 15) {
|
||||
$analyseSolv = 'Excellente';
|
||||
}
|
||||
elseif ($noteSolv >= 12) {
|
||||
$analyseSolv = 'Bonne';
|
||||
}
|
||||
elseif ($noteSolv >= 10) {
|
||||
$analyseSolv = 'Correcte';
|
||||
}
|
||||
elseif ($noteSolv >= 8) {
|
||||
$analyseSolv = 'Moyenne';
|
||||
}
|
||||
elseif ($noteSolv >= 6) {
|
||||
$analyseSolv = 'Délicate';
|
||||
}
|
||||
else {
|
||||
$analyseSolv = 'Inquiétante';
|
||||
}
|
||||
if ($noteSolvabilite >= 40 && $analyseSolv == 'Inquiétante') {
|
||||
$analyseSolv = 'Correcte';
|
||||
}
|
||||
|
||||
// --- CA Moyen par salarié pour un secteur donné
|
||||
$CAESTIME = $iInsee->getCAnafEffectif($naf, $EFFECTIF);
|
||||
|
||||
if ($CABILAN>0) $CABIOUES=$CABILAN;
|
||||
else $CABIOUES=$CAESTIME;
|
||||
if ($CABILAN > 0) {
|
||||
$CABIOUES = $CABILAN;
|
||||
}
|
||||
else {
|
||||
$CABIOUES = $CAESTIME;
|
||||
}
|
||||
|
||||
// L'encours de départ est à 10% du capital
|
||||
$encoursIni=$tabIdentite['Capital']/10;
|
||||
@ -2831,15 +2971,15 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
if ($encoursFP > $ENCOURS) {
|
||||
$ENCOURS=$encoursFP;
|
||||
}
|
||||
} elseif ($encoursTR>$ENCOURS) {
|
||||
}
|
||||
elseif ($encoursTR>$ENCOURS) {
|
||||
$ENCOURS=$encoursTR;
|
||||
}
|
||||
} elseif (isset($tabBil[0])) {
|
||||
}
|
||||
elseif (isset($tabBil[0])) {
|
||||
// SI BILAN : L'encours théorique de base est plafonnée au CA/36
|
||||
if ($tabBil[0]['CA']>0) $ENCOURS=(($tabBil[0]['CA'])/36);
|
||||
if ($encoursCS>$ENCOURS) $ENCOURS=$encoursCS;
|
||||
/** @todo Gérer les encours pour les sociétés avec CA ridicule et FP énormes **/
|
||||
|
||||
// Plafond à 25% des fonds propres ou à 1000 euros si FP<0
|
||||
if ($tabBil[0]['FondsPr']>0) $plafond=$tabBil[0]['FondsPr']/4;
|
||||
elseif ($R[63]>0) $plafond=$R[63]/12;
|
||||
@ -2911,7 +3051,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
elseif ($noteSolvabilite >= 55) {
|
||||
$plafond = 2000;
|
||||
}
|
||||
if ( $DELAIPAY > $DELAIPAYp && $DELAIPAYp > 0 && $DELAIPAY <= 90 ) {
|
||||
if ($DELAIPAY > $DELAIPAYp && $DELAIPAYp > 0 && $DELAIPAY <= 90) {
|
||||
$plafond = $plafond/2;
|
||||
}
|
||||
/*
|
||||
@ -3013,8 +3153,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
}
|
||||
if ($tendance=='') $tendance='Stable';
|
||||
|
||||
/** Avis à 3 ans
|
||||
**/
|
||||
/** Avis à 3 ans **/
|
||||
if ($noteSolvabilite>=50) {
|
||||
if ($valeurCCF>2160) $AVIS3ANS=true;
|
||||
elseif($valeurCCF>0 && $valeurCCF<2160) $AVIS3ANS=false;
|
||||
@ -3180,7 +3319,6 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
$RISQUEACT_NB = count($tabTmp);
|
||||
$RISQUEACT = array();
|
||||
if ($RISQUEACT_NB > 0) {
|
||||
file_put_contents('test.log', print_r($tabTmp,1));
|
||||
foreach ($tabTmp as $iTmp => $tabArret) {
|
||||
// Libellé risque lié à la l'activité de l'un des etablissements
|
||||
// "l'entreprise à au moins l'un de ses établissements figurant au registre francais des émissions polluantes"
|
||||
@ -3189,8 +3327,8 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
}
|
||||
$RISQUEACT = array_unique($RISQUEACT);
|
||||
$RISQUEACT = implode(', ', $RISQUEACT);
|
||||
}*/
|
||||
$timer['risquesPollu']=microtime(true);
|
||||
}
|
||||
$timer['risquesPollu']=microtime(true);*/
|
||||
|
||||
/** Bassin hydro : Le ou les libellés des bassins hydrographiques concernés
|
||||
**/
|
||||
@ -3412,38 +3550,32 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
$CADTER_NB_NONPROP=0; // nombre de postes TERRAINS à l'adresse dont elle n'est pas propriétaire
|
||||
$CADBAT_SURF_TOT=0; // Surface totale des batiments du SIREN
|
||||
$CADTER_SURF_TOT=0; // Surface totale des terrains du SIREN
|
||||
/**
|
||||
@todo
|
||||
$CADBAT_SURF_CUM=0; // Cumul Surfaces des batiments à l'addresse
|
||||
$CADTER_SURF_CUM=0; // Cumul Surfaces des terrains à l'addresse
|
||||
*/
|
||||
$iCadastre = new Metier_Partenaires_MCadastre();
|
||||
$iCadastre->setId($siren);
|
||||
// Locaux
|
||||
$iCadastre = new Metier_Partenaires_MCadastre($siren, $iDb);
|
||||
$tabTmp = $iCadastre->getLocaux();
|
||||
if(count($tabTmp) > 0) {
|
||||
foreach ($tabTmp as $iTmp => $cad) {
|
||||
$CADBAT_NB_TOT++;
|
||||
if ($cad['localDroit'] == 'P'){
|
||||
$CADBAT_NB_PROP++;
|
||||
}
|
||||
else {
|
||||
$CADBAT_NB_NONPROP++;
|
||||
}
|
||||
$CADBAT_SURF_TOT+= $cad['localSurface'];
|
||||
$batimentP = $iCadastre->getSurfaceTotal('local');
|
||||
if (count($batimentP) > 0) {
|
||||
$CADBAT_NB_PROP = $batimentP['itemTotal'];
|
||||
$CADBAT_SURF_TOT+= $batimentP['surfaceTotal'];
|
||||
}
|
||||
$batimentL = $iCadastre->getSurfaceTotal('local', 'L');
|
||||
if (count($batiment) > 0) {
|
||||
$CADBAT_NB_NONPROP = $batimentL['itemTotal'];
|
||||
$CADBAT_SURF_TOT+= $batimentL['surfaceTotal'];
|
||||
}
|
||||
$CADBAT_NB_TOT = $CADBAT_NB_PROP + $CADBAT_NB_NONPROP;
|
||||
// Parcelles
|
||||
$tabTmp = $iCadastre->getParcelles();
|
||||
foreach ($tabTmp as $iTmp => $cad) {
|
||||
$CADTER_NB_TOT++;
|
||||
if ($cad['parcelDroit'] == 'P') {
|
||||
$CADTER_NB_PROP++;
|
||||
$terrainP = $iCadastre->getSurfaceTotal('parcelle');
|
||||
if (count($terrainP) > 0) {
|
||||
$CADTER_NB_PROP = $batimentP['itemTotal'];
|
||||
$CADTER_SURF_TOT+= $batimentP['surfaceTotal'];
|
||||
}
|
||||
else {
|
||||
$CADTER_NB_NONPROP++;
|
||||
}
|
||||
$CADTER_SURF_TOT+= $cad['parcelSurface'];
|
||||
$terrainL = $iCadastre->getSurfaceTotal('parcelle', 'L');
|
||||
if (count($terrainL) > 0) {
|
||||
$CADTER_NB_NONPROP = $batimentL['itemTotal'];
|
||||
$CADTER_SURF_TOT+= $batimentL['surfaceTotal'];
|
||||
}
|
||||
$CADTER_NB_TOT = $CADTER_NB_PROP + $CADTER_NB_NONPROP;
|
||||
$timer['cadastre'] = microtime(true);
|
||||
|
||||
/** RPS : Entreprise avec négociations ou accord sur les RPS ? **/
|
||||
@ -3511,10 +3643,12 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
$ANNONCEPC_NUM=$tabTmp[0]['numPC'];
|
||||
|
||||
/** Activite réglementée **/
|
||||
$ACTIVREG='';
|
||||
$tabTmp=$iInsee->getActivite($siren, $nic);
|
||||
if ($tabTmp)
|
||||
$ACTIVREG=$tabTmp['libActivite']; // Libellé de l'activité règlementé
|
||||
$ACTIVREG = '';
|
||||
// Libellé de l'activité règlementé
|
||||
$tabTmp = $iInsee->getActivite($siren, $nic);
|
||||
if ($tabTmp) {
|
||||
$ACTIVREG = $tabTmp['libActivite'];
|
||||
}
|
||||
|
||||
$NBSUIVICLI=0; // Nombre de clients suivants cette entreprise
|
||||
$NBSOCSEC=0; // Nombre de siren composants les ratios secteurs
|
||||
@ -3912,8 +4046,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|
||||
}
|
||||
|
||||
// --- Scores identique au précedent, simple mise à jour
|
||||
if ($indiScore==$indiScorePre && $ENCOURS==$encoursPre && $dateScore<>0 )
|
||||
{
|
||||
if ($indiScore==$indiScorePre && $ENCOURS==$encoursPre && $dateScore<>0 ) {
|
||||
$tabUpdate2 = array('sourceModif'=>$sourceModif, 'nbModifs'=>$nbModifs);
|
||||
if (!$iDb->update('jo.scores_surveillance', $tabUpdate2, "siren=$siren", false, 0, true)) {
|
||||
Metier_Util_Log::write('W', 'Erreur lors de la MAJ du score en surveillance pour '. $tabIdentite['Nom'], __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
|
@ -1094,31 +1094,35 @@ class Metier_Scores_MSolvabilite
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Ambigous <number, multitype:number >
|
||||
* @return integer
|
||||
*/
|
||||
public function getPtActivite()
|
||||
{
|
||||
if (strlen($this->naf)==4)
|
||||
if (isset($this->tabPtNaf[$this->naf]))
|
||||
$nbPoints=$this->tabPtNaf[$this->naf];
|
||||
else
|
||||
$nbPoints=5;
|
||||
elseif (strlen($this->naf)==5) {
|
||||
if (strlen($this->naf) == 4) {
|
||||
if (isset($this->tabPtNaf[$this->naf])) {
|
||||
$nbPoints = $this->tabPtNaf[$this->naf];
|
||||
}
|
||||
else {
|
||||
$nbPoints = 5;
|
||||
}
|
||||
}
|
||||
elseif (strlen($this->naf) == 5) {
|
||||
$iCotation = new Metier_Scores_ICotation(array(), true, $this->iDb);
|
||||
//print_r($iCotation->tabNaf21);
|
||||
//die();
|
||||
if (isset($iCotation->tabNaf21[$this->naf])) {
|
||||
$naf4=$iCotation->tabNaf21[$this->naf];
|
||||
if (isset($this->tabPtNaf[$naf4]))
|
||||
$nbPoints=$this->tabPtNaf[$naf4];
|
||||
else
|
||||
$nbPoints=5;
|
||||
$naf4 = $iCotation->tabNaf21[$this->naf];
|
||||
if (isset($this->tabPtNaf[$naf4])) {
|
||||
$nbPoints = $this->tabPtNaf[$naf4];
|
||||
}
|
||||
else {
|
||||
$nbPoints = 5;
|
||||
}
|
||||
}
|
||||
else
|
||||
$nbPoints=5;
|
||||
$nbPoints = 5;
|
||||
}
|
||||
else {
|
||||
$nbPoints = 5;
|
||||
}
|
||||
else
|
||||
$nbPoints=5;
|
||||
|
||||
return $nbPoints;
|
||||
}
|
||||
|
@ -173,14 +173,20 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
*/
|
||||
public function getIndiscoreCache($siren)
|
||||
{
|
||||
if ($siren<1000) return false;
|
||||
$query="SELECT siren, actif, procol, naf, indiScore, indiScore20, encours, indiScoreDate, dateBilan, sourceModif, scoreSolv, scoreDir, scoreConf, scoreZ, scoreCH, scoreAfdcc1, scoreAfdcc2, scoreAfdcc2note, scoreAltman, scoreAltmanCote, scoreCCF, cs, csMoisMaj, csMoisFin, adresseDom, situFi, infoNote, noteStruct, noteFin, tendance, nbModifs, dateUpdate
|
||||
if ($siren < 1000) {
|
||||
return false;
|
||||
}
|
||||
$query = "SELECT siren, actif, procol, naf, indiScore, indiScore20, encours, indiScoreDate,
|
||||
dateBilan, sourceModif, scoreSolv, scoreDir, scoreConf, scoreZ, scoreCH, scoreAfdcc1,
|
||||
scoreAfdcc2, scoreAfdcc2note, scoreAltman, scoreAltmanCote, scoreCCF, cs, csMoisMaj,
|
||||
csMoisFin, adresseDom, situFi, infoNote, noteStruct, noteFin, tendance, nbModifs, dateUpdate
|
||||
FROM jo.scores_surveillance
|
||||
WHERE siren=$siren
|
||||
ORDER BY indiScoreDate DESC";
|
||||
$ret = $this->db->query($query);
|
||||
$iDb = new Metier_Util_Db();
|
||||
$ret = $iDb->query($query);
|
||||
$tabRet = array();
|
||||
while( $ret = $this->db->fetch(MYSQL_ASSOC) ) {
|
||||
while( $ret = $iDb->fetch(MYSQL_ASSOC) ) {
|
||||
$tabRet[] = array (
|
||||
'siren' => $ret['siren'],
|
||||
'actif' => $ret['actif'],
|
||||
@ -227,12 +233,15 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
*/
|
||||
public function getScoreSecteur($naf5)
|
||||
{
|
||||
if (len($naf)<>5) return false;
|
||||
$tabTmp=$iDb->select('jo.scores_surveillance',
|
||||
'naf, AVG(indiScore) AS score100moy, AVG(indiScore20) AS score20moy, AVG(encours) AS encoursMoy, MAX(indiScoreDate) AS lastScore, COUNT(siren) AS nbSiren',
|
||||
if (len($naf) != 5) {
|
||||
return false;
|
||||
}
|
||||
$tabTmp = $iDb->select('jo.scores_surveillance',
|
||||
'naf, AVG(indiScore) AS score100moy, AVG(indiScore20) AS score20moy,
|
||||
AVG(encours) AS encoursMoy, MAX(indiScoreDate) AS lastScore, COUNT(siren) AS nbSiren',
|
||||
"naf='$naf5' AND actif=1", false, MYSQL_ASSOC);
|
||||
if ( count($tabTmp)>0 ) {
|
||||
$tabTmp=$tabTmp[0];
|
||||
if (count($tabTmp) > 0) {
|
||||
$tabTmp = $tabTmp[0];
|
||||
return array(
|
||||
'naf' => $tabTmp['naf'],
|
||||
'score100moy' => $tabTmp['score100moy'],
|
||||
@ -293,14 +302,18 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
if ($signe == '+') {
|
||||
if ($nombre > 0) {
|
||||
return '+ '.number_format(abs($nombre),$decimales,$sepDec,$sepMil).' '.$unite;
|
||||
} elseif ($nombre<0) {
|
||||
}
|
||||
elseif ($nombre < 0) {
|
||||
return '- '.number_format(abs($nombre),$decimales,$sepDec,$sepMil).' '.$unite;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return number_format(abs($nombre),$decimales,$sepDec,$sepMil).' '.$unite;
|
||||
}
|
||||
} elseif ($signe=='!') {
|
||||
}
|
||||
elseif ($signe == '!') {
|
||||
return number_format(abs($nombre),$decimales,$sepDec,$sepMil).' '.$unite;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return number_format($nombre,$decimales,$sepDec,$sepMil).' '.$unite;
|
||||
}
|
||||
}
|
||||
@ -393,25 +406,29 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
if ( isset($this->tabVariables[$varLabel]) ) {
|
||||
if ($longeur > 0) {
|
||||
return $var;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// Tableau ZEMET
|
||||
if ($varLabel == 'ZEMET') {
|
||||
if (substr($this->DateNotice80,0,4) >= 2010) {
|
||||
$tableZemet = 'ZEMET2010';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$tableZemet = 'ZEMET1994';
|
||||
}
|
||||
// Cette variable a un libellé associé
|
||||
if (isset($this->tabVariables[$tableZemet][$this->RPET.$this->ZEMET]['art'])) {
|
||||
return $this->tabVariables[$tableZemet][$this->RPET.$this->ZEMET]['art'];
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return $this->tabVariables[$tableZemet][$this->RPET.$this->ZEMET]['lib'];
|
||||
}
|
||||
}
|
||||
// Cette variable a un libellé associé
|
||||
if (isset($this->tabVariables[$varLabel][$this->{$varValue}]['lib'])) {
|
||||
return $this->tabVariables[$varLabel][$this->{$varValue}]['lib'];
|
||||
} elseif (isset($this->tabVariables[$varLabel]['0'.$this->{$varValue}]['lib'])) {
|
||||
}
|
||||
elseif (isset($this->tabVariables[$varLabel]['0'.$this->{$varValue}]['lib'])) {
|
||||
return $this->tabVariables[$varLabel]['0'.$this->{$varValue}]['lib'];
|
||||
}
|
||||
}
|
||||
@ -442,17 +459,19 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
elseif (preg_match('/_EU$/', $varLabel)) {
|
||||
if ($this->{$varValue}>=0 && $this->{$varValue}<10 || $this->{$varValue}>-10 && $this->{$varValue}<=0) {
|
||||
return number_format($this->{$varValue}, 2, ',', ' ').' €';
|
||||
} elseif ($this->{$varValue}>=10 && $this->{$varValue}<5000 || $this->{$varValue}>-5000 && $this->{$varValue}<=10) {
|
||||
}
|
||||
elseif ($this->{$varValue}>=10 && $this->{$varValue}<5000 || $this->{$varValue}>-5000 && $this->{$varValue}<=10) {
|
||||
return number_format($strTmp,0,',',' ').' €';
|
||||
} elseif ($this->{$varValue}<=-10000000 || $this->{$varValue}>=10000000) {
|
||||
}
|
||||
elseif ($this->{$varValue}<=-10000000 || $this->{$varValue}>=10000000) {
|
||||
return number_format($this->{$varValue}/1000000, 0, ',', ' ').' M€';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return number_format($this->{$varValue}/1000, 0, ',', ' ').' K€';
|
||||
}
|
||||
}
|
||||
// --- Formattage variable [...]_POURC
|
||||
elseif (preg_match('/_POURC$/', $varLabel)) {
|
||||
$strTmp = eval("return $varValue;");
|
||||
if ($this->{$varValue}>=10 || $this->{$varValue}<=-10)
|
||||
return number_format($this->{$varValue}, 0, ',', ' ').' %';
|
||||
elseif ($this->{$varValue}>=1 || $this->{$varValue}<=-1)
|
||||
@ -495,16 +514,20 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
Metier_Util_Date::dateT('Ymd','d/m/Y', substr(str_replace('-','',$this->DCREN),0,8)));
|
||||
}
|
||||
// --- Formattage variable [...]MARCHEVOL
|
||||
elseif (preg_match('/MARCHEVOL$/', $varLabel))
|
||||
{
|
||||
if (abs($MARCHEVOL)>=5) return round($MARCHEVOL).' %';
|
||||
else return number_format($MARCHEVOL,3,',',' ').' %';
|
||||
elseif (preg_match('/MARCHEVOL$/', $varLabel)) {
|
||||
if (abs($MARCHEVOL)>=5) {
|
||||
return round($MARCHEVOL).' %';
|
||||
}
|
||||
else {
|
||||
return number_format($MARCHEVOL,3,',',' ').' %';
|
||||
}
|
||||
}
|
||||
// --- Formattage variable [...]MARCHEPART
|
||||
elseif (preg_match('/MARCHEPART$/', $varLabel)) {
|
||||
if (abs($this->MARCHEPART)>=5) {
|
||||
return round($this->MARCHEPART).' %';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return number_format($this->MARCHEPART,3,',',' ').' %';
|
||||
}
|
||||
}
|
||||
@ -512,7 +535,8 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
elseif (preg_match('/MARCHEPARTp$/', $varLabel)) {
|
||||
if (abs($this->MARCHEPARTp)>=5) {
|
||||
return round($this->MARCHEPARTp).' %';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return number_format($this->MARCHEPARTp,3,',',' ').' %';
|
||||
}
|
||||
}
|
||||
@ -520,7 +544,8 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
elseif (preg_match('/MARCHEPARTEVOL$/', $varLabel)) {
|
||||
if (abs($this->MARCHEPARTEVOL) >= 5) {
|
||||
return round($this->MARCHEPARTEVOL).' %';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return number_format($this->MARCHEPARTEVOL,3,',',' ').' %';
|
||||
}
|
||||
}
|
||||
@ -528,11 +553,14 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
elseif (preg_match('/MARCHE$/', $varLabel)) {
|
||||
if ($this->MARCHE < 10000) {
|
||||
return number_format($MARCHE,0, ',', ' ').' €';
|
||||
} elseif ($this->MARCHE < 1000000) {
|
||||
}
|
||||
elseif ($this->MARCHE < 1000000) {
|
||||
return number_format($this->MARCHE / 1000, 0, ',', ' ').' K€';
|
||||
} elseif ($this->MARCHE < 1000000000) {
|
||||
}
|
||||
elseif ($this->MARCHE < 1000000000) {
|
||||
return number_format($this->MARCHE / 1000000, 0, ',', ' ').' M€';
|
||||
}else {
|
||||
}
|
||||
else {
|
||||
return number_format($this->MARCHE / 1000000000, 0, ',', ' ')." milliards d'€";
|
||||
}
|
||||
}
|
||||
@ -540,11 +568,14 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
elseif (preg_match('/MARCHEp$/', $varLabel)) {
|
||||
if ($this->MARCHEp < 10000) {
|
||||
return number_format($MARCHEp,0, ',', ' ').' €';
|
||||
} elseif ($this->MARCHEp < 1000000) {
|
||||
}
|
||||
elseif ($this->MARCHEp < 1000000) {
|
||||
return number_format($this->MARCHEp / 1000, 0, ',', ' ').' K€';
|
||||
} elseif ($this->MARCHEp < 1000000000) {
|
||||
}
|
||||
elseif ($this->MARCHEp < 1000000000) {
|
||||
return number_format($this->MARCHEp / 1000000, 0, ',', ' ').' M€';
|
||||
}else {
|
||||
}
|
||||
else {
|
||||
return number_format($this->MARCHEp / 1000000000, 0, ',', ' ')." milliards d'€";
|
||||
}
|
||||
}
|
||||
@ -558,7 +589,6 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
}
|
||||
// --- Formattage variable [...]_MT || [...]_TAUX
|
||||
elseif (preg_match('/(_COEF|_TAUX)$/', $varLabel)) {
|
||||
$strTmp=eval("return $varValue;");
|
||||
return number_format($this->{$varValue}, 2, ',', '').' %';
|
||||
}
|
||||
// --- Formattage variable SIREN
|
||||
@ -630,10 +660,18 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
$tmpAnnees = $matches2[2]*1;
|
||||
$valeur = $this->R[$tmpRatioId];
|
||||
for($iMoy=0; $iMoy<$tmpAnnees; $iMoy++) {
|
||||
if ($iMoy==1) $valeur+= $this->Rp[$tmpRatioId];
|
||||
elseif ($iMoy==2) $valeur+= $this->Rp2[$tmpRatioId];
|
||||
elseif ($iMoy==3) $valeur+= $this->Rp3[$tmpRatioId];
|
||||
elseif ($iMoy==4) $valeur+= $this->Rp4[$tmpRatioId];
|
||||
if ($iMoy==1) {
|
||||
$valeur+= $this->Rp[$tmpRatioId];
|
||||
}
|
||||
elseif ($iMoy==2) {
|
||||
$valeur+= $this->Rp2[$tmpRatioId];
|
||||
}
|
||||
elseif ($iMoy==3) {
|
||||
$valeur+= $this->Rp3[$tmpRatioId];
|
||||
}
|
||||
elseif ($iMoy==4) {
|
||||
$valeur+= $this->Rp4[$tmpRatioId];
|
||||
}
|
||||
}
|
||||
return formatRatio('', $valeur/$tmpAnnees, strtoupper($this->tabFormulesRatios[$tmpRatioId]['unite']));
|
||||
}
|
||||
@ -648,46 +686,65 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
$unite = strtoupper($this->tabFormulesRatios[$tmpRatioId]['unite']);
|
||||
if ($matches2[1]=='+') {
|
||||
$forceSigne='+';
|
||||
} elseif ($matches2[1]=='!') {
|
||||
}
|
||||
elseif ($matches2[1]=='!') {
|
||||
$forceSigne='!';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$forceSigne='';
|
||||
}
|
||||
if ($tmpRatio=='R') {
|
||||
return formatRatio($this->R, $tmpRatioId, $unite, $forceSigne);
|
||||
} elseif ($tmpRatio=='Rp') {
|
||||
}
|
||||
elseif ($tmpRatio=='Rp') {
|
||||
return formatRatio($this->Rp, $tmpRatioId, $unite, $forceSigne);
|
||||
} elseif ($tmpRatio=='Rp2') {
|
||||
}
|
||||
elseif ($tmpRatio=='Rp2') {
|
||||
return formatRatio($this->Rp2, $tmpRatioId, $unite, $forceSigne);
|
||||
} elseif ($tmpRatio=='Rp3') {
|
||||
}
|
||||
elseif ($tmpRatio=='Rp3') {
|
||||
return formatRatio($this->Rp3, $tmpRatioId, $unite, $forceSigne);
|
||||
} elseif ($tmpRatio=='Rp4') {
|
||||
}
|
||||
elseif ($tmpRatio=='Rp4') {
|
||||
return formatRatio($this->Rp4, $tmpRatioId, $unite, $forceSigne);
|
||||
} elseif ($tmpRatio=='Ra') {
|
||||
}
|
||||
elseif ($tmpRatio=='Ra') {
|
||||
return formatRatio($this->Ra, $tmpRatioId, $unite, $forceSigne);
|
||||
} elseif ($tmpRatio=='Rap') {
|
||||
}
|
||||
elseif ($tmpRatio=='Rap') {
|
||||
return formatRatio($this->Rap, $tmpRatioId, $unite, $forceSigne);
|
||||
} elseif ($tmpRatio=='Rs') {
|
||||
}
|
||||
elseif ($tmpRatio=='Rs') {
|
||||
return formatRatio($this->Rs, $tmpRatioId, $unite, $forceSigne);
|
||||
} elseif ($tmpRatio=='Rsp') {
|
||||
}
|
||||
elseif ($tmpRatio=='Rsp') {
|
||||
return formatRatio($this->Rsp, $tmpRatioId, $unite, $forceSigne);
|
||||
} elseif ($tmpRatio=='Rsp2') {
|
||||
}
|
||||
elseif ($tmpRatio=='Rsp2') {
|
||||
return formatRatio($this->Rsp2, $tmpRatioId, $unite, $forceSigne);
|
||||
} elseif ($tmpRatio=='Rsp3') {
|
||||
}
|
||||
elseif ($tmpRatio=='Rsp3') {
|
||||
return formatRatio($this->Rsp3, $tmpRatioId, $unite, $forceSigne);
|
||||
} elseif ($tmpRatio=='Rsp4') {
|
||||
}
|
||||
elseif ($tmpRatio=='Rsp4') {
|
||||
return formatRatio($this->Rsp4, $tmpRatioId, $unite, $forceSigne);
|
||||
} elseif ($tmpRatio=='Revol') {
|
||||
}
|
||||
elseif ($tmpRatio=='Revol') {
|
||||
return formatRatio($this->Revol, $tmpRatioId, '%', $forceSigne);
|
||||
} elseif ($tmpRatio=='Rdiff') {
|
||||
}
|
||||
elseif ($tmpRatio=='Rdiff') {
|
||||
return formatRatio($this->Rdiff, $tmpRatioId, $unite, $forceSigne);
|
||||
} elseif ($tmpRatio=='Revolp') {
|
||||
}
|
||||
elseif ($tmpRatio=='Revolp') {
|
||||
return formatRatio($this->Revolp, $tmpRatioId, '%', $forceSigne);
|
||||
} elseif ($tmpRatio=='Revolp2') {
|
||||
}
|
||||
elseif ($tmpRatio=='Revolp2') {
|
||||
return formatRatio($this->Revolp2, $tmpRatioId, '%', $forceSigne);
|
||||
} elseif ($tmpRatio=='Revolp3') {
|
||||
}
|
||||
elseif ($tmpRatio=='Revolp3') {
|
||||
return formatRatio($this->Revolp3, $tmpRatioId, '%', $forceSigne);
|
||||
} elseif ($tmpRatio=='regR') {
|
||||
}
|
||||
elseif ($tmpRatio=='regR') {
|
||||
return formatRatio($this->regR, $tmpRatioId, $unite, $forceSigne);
|
||||
}
|
||||
}
|
||||
@ -1235,7 +1292,7 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
// Cessation juridique de l'entreprise
|
||||
case '410':
|
||||
if (!$this->ACTIFINSEE) {
|
||||
$this->ETATINSEE='JURF';
|
||||
$this->ETATINSEE = 'JURF';
|
||||
}
|
||||
break;
|
||||
// Absence d'activité de l'entreprise (cessation économique de l.entreprise)
|
||||
@ -1243,7 +1300,7 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
// Absence d'activité d'une entreprise suite à une mise à jour au répertoire
|
||||
case '425':
|
||||
if (!$this->ACTIFINSEE) {
|
||||
$this->ETATINSEE='ECOF';
|
||||
$this->ETATINSEE = 'ECOF';
|
||||
}
|
||||
break;
|
||||
// Présumé Fermé
|
||||
@ -2012,7 +2069,8 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
$this->RJMERE=$this->RJFILLE=false;
|
||||
$this->SITUACT=$this->NICMERE=$this->SIRENMERE=$this->SIRETMERE=$this->NOMMERE='';
|
||||
|
||||
$lienM = new Metier_Liens_Base($siren, 'siren');
|
||||
$lienM = new Metier_Liens_Base();
|
||||
$lienM->setId($siren, 'siren');
|
||||
|
||||
// Actionnaire
|
||||
$tabA = $lienM->getActionnaires(null, true);
|
||||
@ -2386,7 +2444,7 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
$this->DIR2_TYPE='PP';
|
||||
}
|
||||
|
||||
$activeRechercheDir = false;
|
||||
$activeRechercheDir = true;
|
||||
if ($activeRechercheDir){
|
||||
$tabDir = $iInsee->rechercheDir($dir['Nom'], $dir['Prenom'], '', $dir['NaissDate'], '', 0, 200, 200);
|
||||
$tabDir = $tabDir['reponses'];
|
||||
@ -2695,7 +2753,7 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
$this->ENQUETE='';
|
||||
if ($this->companyEvenDateStop === null) {
|
||||
$tabTmp = $this->db->select('jo.scores_cutoff',
|
||||
'encours, scoreSolv, scoreDir, scoreConf, DATE(dateInsert)*1 AS dateInsert, DATE(dateUpdate)*1 AS dateUpdate',
|
||||
'encours, scoreSolv, scoreDir, scoreConf, paiement, DATE(dateInsert)*1 AS dateInsert, DATE(dateUpdate)*1 AS dateUpdate',
|
||||
"siren=$siren", $this->debug, MYSQL_ASSOC);
|
||||
$timer['scores_cutoff'] = microtime(true);
|
||||
if (count($tabTmp) > 0) {
|
||||
@ -2706,6 +2764,8 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
}
|
||||
// Si pas plus vieux que 6 mois
|
||||
if (Metier_Util_Date::nbMoisEntre($dateMaj, date('Ymd')) <= $this->ENQUETELIM) {
|
||||
$tabLibCS = $iFacto->getLibInfoCS($tabTmp[0]['paiement']);
|
||||
$libInfoPaiement = $tabLibCS['LibCS'];
|
||||
$encoursForce=$tabTmp[0]['encours'];
|
||||
if ($tabTmp[0]['scoreConf'] !== null) {
|
||||
$this->SCORECONF = $tabTmp[0]['scoreConf'];
|
||||
@ -2723,7 +2783,7 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
$this->ENQUETE = $noteSolvabilite = $tabTmp[0]['scoreSolv'];
|
||||
}
|
||||
if ($this->ENQUETE > $this->ENQUETEMAXI) {
|
||||
$this->ENQUETE=$this->ENQUETEMAXI;
|
||||
$this->ENQUETE = $this->ENQUETEMAXI;
|
||||
}
|
||||
// Permet de supprimer la prise en compte de la procol
|
||||
if ($this->ENQUETE > 0) {
|
||||
@ -2735,57 +2795,94 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
}
|
||||
|
||||
// --- Commentaire Dirigeance
|
||||
if ($this->SCOREDIRI>=70) {
|
||||
$analyseDir="L'étude de la dirigeance ne relève aucun problème.";
|
||||
} elseif ($this->SCOREDIRI>=40) {
|
||||
$analyseDir="L'étude de la dirigeance retient notre attention.";
|
||||
} elseif ($this->SCOREDIRI>0) {
|
||||
$analyseDir="L'étude de la dirigeance attire toute notre attention.";
|
||||
if ($this->SCOREDIRI >= 70) {
|
||||
$analyseDir = "L'étude de la dirigeance ne relève aucun problème.";
|
||||
} elseif ($this->SCOREDIRI >= 40) {
|
||||
$analyseDir = "L'étude de la dirigeance retient notre attention.";
|
||||
} elseif ($this->SCOREDIRI > 0) {
|
||||
$analyseDir = "L'étude de la dirigeance attire toute notre attention.";
|
||||
} else {
|
||||
$analyseDir="L'étude de la dirigeance révèle des anomalies.";
|
||||
$this->SCOREDIRI=0;
|
||||
$analyseDir = "L'étude de la dirigeance révèle des anomalies.";
|
||||
$this->SCOREDIRI = 0;
|
||||
}
|
||||
|
||||
// --- Commentaire Conformité
|
||||
if ($tabIdentite['SituationJuridique']=='P') {
|
||||
if ($tabIdentite['SituationJuridique'] == 'P') {
|
||||
$noteSolvabilite = $this->SCORECONF = $this->SCOREDIRI = 0;
|
||||
$analyseConf = "L'entreprise est en procédure collective";
|
||||
} elseif ($tabIdentite['SituationJuridique']=='CL') {
|
||||
$noteSolvabilite = $SCORECONF = $SCOREDIRI = 0;
|
||||
}
|
||||
elseif ($tabIdentite['SituationJuridique'] == 'CL') {
|
||||
$noteSolvabilite = $this->SCORECONF = $this->SCOREDIRI = 0;
|
||||
$analyseConf = "Cloture après la procédure";
|
||||
} elseif ($tabIdentite['SituationJuridique']=='D') {
|
||||
}
|
||||
elseif ($tabIdentite['SituationJuridique'] == 'D') {
|
||||
$noteSolvabilite = $this->SCORECONF = $this->SCOREDIRI = 0;
|
||||
$analyseConf = "L'entreprise est dissoute";
|
||||
} elseif ($tabIdentite['Actif']==0) {
|
||||
}
|
||||
elseif ($tabIdentite['SituationJuridique'] == 'A') {
|
||||
$noteSolvabilite = $this->SCORECONF = $this->SCOREDIRI = 0;
|
||||
$analyseConf = "L'entreprise est absorbée";
|
||||
}
|
||||
elseif ($tabIdentite['SituationJuridique'] == 'RR' && $this->FJUR1 != 1) {
|
||||
$noteSolvabilite = $this->SCORECONF = $this->SCOREDIRI = 0;
|
||||
$analyseConf = "L'entreprise est radiée";
|
||||
}
|
||||
elseif ($tabIdentite['Actif'] == 0) {
|
||||
$noteSolvabilite = $this->SCORECONF = $this->SCOREDIRI = 0;
|
||||
$analyseConf = "L'entreprise n'est pas en activité";
|
||||
} elseif ($this->SCORECONF>=70) {
|
||||
}
|
||||
elseif ($this->SCORECONF >= 70) {
|
||||
$analyseConf = "L'analyse de la conformité est correcte.";
|
||||
} elseif ($this->SCORECONF>=40) {
|
||||
}
|
||||
elseif ($this->SCORECONF >= 40) {
|
||||
$analyseConf = "L'analyse de la conformité est acceptable.";
|
||||
} elseif ($this->SCORECONF>0) {
|
||||
}
|
||||
elseif ($this->SCORECONF > 0) {
|
||||
$analyseConf = "L'analyse de la conformité est sensible.";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$analyseConf = "L'analyse de la conformité est très sensible.";
|
||||
$this->SCORECONF = 0;
|
||||
}
|
||||
|
||||
// --- Commentaire Solvabilité
|
||||
if ($noteFin>0) $noteSolv=($noteStructure+$noteFin)/2;
|
||||
else $noteSolv=($noteStructure+$noteFin)/5;
|
||||
if ($noteSolv>=15) $analyseSolv = 'Excellente';
|
||||
elseif ($noteSolv>=12) $analyseSolv = 'Bonne';
|
||||
elseif ($noteSolv>=10) $analyseSolv = 'Correcte';
|
||||
elseif ($noteSolv>=8) $analyseSolv = 'Moyenne';
|
||||
elseif ($noteSolv>=6) $analyseSolv = 'Délicate';
|
||||
else $analyseSolv = 'Inquiétante';
|
||||
if ($noteSolvabilite>=40 && $analyseSolv=='Inquiétante') $analyseSolv = 'Correcte';
|
||||
if ($noteFin > 0) {
|
||||
$noteSolv = ($noteStructure+$noteFin)/2;
|
||||
}
|
||||
else {
|
||||
$noteSolv = ($noteStructure+$noteFin)/5;
|
||||
}
|
||||
if ($noteSolv >= 15) {
|
||||
$analyseSolv = 'Excellente';
|
||||
}
|
||||
elseif ($noteSolv >= 12) {
|
||||
$analyseSolv = 'Bonne';
|
||||
}
|
||||
elseif ($noteSolv >= 10) {
|
||||
$analyseSolv = 'Correcte';
|
||||
}
|
||||
elseif ($noteSolv >= 8) {
|
||||
$analyseSolv = 'Moyenne';
|
||||
}
|
||||
elseif ($noteSolv >= 6) {
|
||||
$analyseSolv = 'Délicate';
|
||||
}
|
||||
else {
|
||||
$analyseSolv = 'Inquiétante';
|
||||
}
|
||||
if ($noteSolvabilite >= 40 && $analyseSolv == 'Inquiétante') {
|
||||
$analyseSolv = 'Correcte';
|
||||
}
|
||||
|
||||
// --- CA Moyen par salarié pour un secteur donné
|
||||
$this->CAESTIME = $iInsee->getCAnafEffectif($naf, $this->EFFECTIF);
|
||||
|
||||
if ($this->CABILAN>0) $this->CABIOUES=$this->CABILAN;
|
||||
else $this->CABIOUES=$this->CAESTIME;
|
||||
if ($this->CABILAN > 0) {
|
||||
$this->CABIOUES = $this->CABILAN;
|
||||
}
|
||||
else {
|
||||
$this->CABIOUES = $this->CAESTIME;
|
||||
}
|
||||
|
||||
// L'encours de départ est à 10% du capital
|
||||
$encoursIni = $tabIdentite['Capital']/10;
|
||||
@ -2804,13 +2901,18 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
if ($noteSolvabilite>=40) {
|
||||
if ($this->HOLDING) {
|
||||
// Cas des Holding
|
||||
$this->ENCOURS=$tabIdentite['Capital']/12;
|
||||
$this->ENCOURS = $tabIdentite['Capital'] / 12;
|
||||
if (@$tabBil[0]['FondsPr']>0) {
|
||||
$encoursFP=(($tabBil[0]['FondsPr'])/72);
|
||||
if ($encoursFP>$this->ENCOURS) $this->ENCOURS=$encoursFP;
|
||||
} elseif ($encoursTR>$this->ENCOURS) $this->ENCOURS=$encoursTR;
|
||||
|
||||
} elseif (isset($tabBil[0])) {
|
||||
$encoursFP = $tabBil[0]['FondsPr'] / 72 ;
|
||||
if ($encoursFP > $this->ENCOURS) {
|
||||
$this->ENCOURS=$encoursFP;
|
||||
}
|
||||
}
|
||||
elseif ($encoursTR > $this->ENCOURS) {
|
||||
$this->ENCOURS=$encoursTR;
|
||||
}
|
||||
}
|
||||
elseif (isset($tabBil[0])) {
|
||||
// SI BILAN : L'encours théorique de base est plafonnée au CA/36
|
||||
if ($tabBil[0]['CA']>0) $this->ENCOURS=(($tabBil[0]['CA'])/36);
|
||||
if ($encoursCS>$this->ENCOURS) $this->ENCOURS=$encoursCS;
|
||||
@ -2872,9 +2974,8 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
case 15:
|
||||
case 16:
|
||||
case 19:
|
||||
if ($this->ENCOURS == 0 && $this->ENCOURS <= 2000 && !$this->IMPAYE &&
|
||||
!$this->PRIVILEGES && !$this->RISQUEGROUPE && !$this->DEFAUT &&
|
||||
!$this->LCASSUR && $this->CSFACTO != 50 && !$this->RISQUEIMPAYE) {
|
||||
if ($this->ENCOURS >= 0 && $this->ENCOURS <= 2000 && !$this->IMPAYE && !$this->PRIVILEGES && !$this->RISQUEGROUPE &&
|
||||
!$this->DEFAUT && !$this->LCASSUR && $this->CSFACTO != 50 && !$this->RISQUEIMPAYE) {
|
||||
$this->ENCOURS = $this->CAESTIME/36;
|
||||
if ($noteSolvabilite >= 50 && $this->AGE >= 120) {
|
||||
$plafond = 7000;
|
||||
@ -3152,13 +3253,15 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
'e.codecommune, e.nom, e.codesiret, e.idetab, r.idrejet, r.coderejet, r.libellerejet, r.codeouvragedepollution, r.codeentitehydro, r.nomstep, r.nommilieu',
|
||||
"e.codesiret BETWEEN $sirenDeb AND $sirenFin AND e.idetab=r.idetab GROUP BY e.codesiret, r.libellerejet LIMIT 0,50", $this->debug, MYSQL_ASSOC);
|
||||
// Nombre d'établissements concernés: neutraliser si >= 10
|
||||
$this->RISQUEACT_NB=count($tabTmp);
|
||||
$this->RISQUEACT=array();
|
||||
$this->RISQUEACT_NB = count($tabTmp);
|
||||
$this->RISQUEACT = array();
|
||||
if ($RISQUEACT_NB > 0) {
|
||||
foreach ($tabTmp as $iTmp=>$tabArret) {
|
||||
$this->RISQUEACT[]=$tabArret['libellerejet']; // Libellé risque lié à la l'activité de l'un des etablissements "l'entreprise à au moins l'un de ses établissements figurant au registre francais des émissions polluantes" (AIR, EAU ou et SOL)
|
||||
}
|
||||
$this->RISQUEACT=array_unique($this->RISQUEACT);
|
||||
$this->RISQUEACT=implode(', ', $this->RISQUEACT);
|
||||
$this->RISQUEACT = array_unique($this->RISQUEACT);
|
||||
$this->RISQUEACT = implode(', ', $this->RISQUEACT);
|
||||
}
|
||||
$timer['risquesPollu']=microtime(true);
|
||||
|
||||
/** Bassin hydro : Le ou les libellés des bassins hydrographiques concernés
|
||||
@ -3380,38 +3483,31 @@ class Metier_Scoring_Base extends Metier_Scoring_Vars
|
||||
$this->CADTER_NB_NONPROP=0; // nombre de postes TERRAINS à l'adresse dont elle n'est pas propriétaire
|
||||
$this->CADBAT_SURF_TOT=0; // Surface totale des batiments du SIREN
|
||||
$this->CADTER_SURF_TOT=0; // Surface totale des terrains du SIREN
|
||||
/**
|
||||
@todo
|
||||
$CADBAT_SURF_CUM=0; // Cumul Surfaces des batiments à l'addresse
|
||||
$CADTER_SURF_CUM=0; // Cumul Surfaces des terrains à l'addresse
|
||||
*/
|
||||
$iCadastre = new Metier_Partenaires_MCadastre($siren, $this-db);
|
||||
// Locaux
|
||||
$iCadastre = new Metier_Partenaires_MCadastre($siren, $this->db);
|
||||
$tabTmp = $iCadastre->getLocaux();
|
||||
if(count($tabTmp) > 0) {
|
||||
foreach ($tabTmp as $iTmp => $cad) {
|
||||
$this->CADBAT_NB_TOT++;
|
||||
if ($cad['localDroit'] == 'P'){
|
||||
$this->CADBAT_NB_PROP++;
|
||||
}
|
||||
else {
|
||||
$this->CADBAT_NB_NONPROP++;
|
||||
}
|
||||
$this->CADBAT_SURF_TOT+= $cad['localSurface'];
|
||||
$batimentP = $iCadastre->getSurfaceTotal('local');
|
||||
if (count($batimentP) > 0) {
|
||||
$this->CADBAT_NB_PROP = $batimentP['itemTotal'];
|
||||
$this->CADBAT_SURF_TOT+= $batimentP['surfaceTotal'];
|
||||
}
|
||||
$batimentL = $iCadastre->getSurfaceTotal('local', 'L');
|
||||
if (count($batiment) > 0) {
|
||||
$this->CADBAT_NB_NONPROP = $batimentL['itemTotal'];
|
||||
$this->CADBAT_SURF_TOT+= $batimentL['surfaceTotal'];
|
||||
}
|
||||
$this->CADBAT_NB_TOT = $this->CADBAT_NB_PROP + $this->CADBAT_NB_NONPROP;
|
||||
// Parcelles
|
||||
$tabTmp = $iCadastre->getParcelles();
|
||||
foreach ($tabTmp as $iTmp => $cad) {
|
||||
$this->CADTER_NB_TOT++;
|
||||
if ($cad['parcelDroit'] == 'P') {
|
||||
$this->CADTER_NB_PROP++;
|
||||
$terrainP = $iCadastre->getSurfaceTotal('parcelle');
|
||||
if (count($terrainP) > 0) {
|
||||
$this->CADTER_NB_PROP = $batimentP['itemTotal'];
|
||||
$this->CADTER_SURF_TOT+= $batimentP['surfaceTotal'];
|
||||
}
|
||||
else {
|
||||
$this->CADTER_NB_NONPROP++;
|
||||
}
|
||||
$this->CADTER_SURF_TOT+= $cad['parcelSurface'];
|
||||
$terrainL = $iCadastre->getSurfaceTotal('parcelle', 'L');
|
||||
if (count($terrainL) > 0) {
|
||||
$this->CADTER_NB_NONPROP = $batimentL['itemTotal'];
|
||||
$this->CADTER_SURF_TOT+= $batimentL['surfaceTotal'];
|
||||
}
|
||||
$this->CADTER_NB_TOT = $this->CADTER_NB_PROP + $this->CADTER_NB_NONPROP;
|
||||
$timer['cadastre'] = microtime(true);
|
||||
|
||||
/** RPS : Entreprise avec négociations ou accord sur les RPS ? **/
|
||||
|
@ -630,13 +630,13 @@ class Metier_Sfr_Scoring
|
||||
}
|
||||
|
||||
//Entreprise coté au CAC
|
||||
/*$this->ValIsCAC = 0;
|
||||
$liensM = new Metier_Liens_Base($siren, 'siren');
|
||||
if ( $lienM->isInGroupeCAC40() ) {
|
||||
$this->ValIsCAC = 0;
|
||||
$liensM = new Metier_Liens_Base();
|
||||
$liensM->setId($siren, 'siren');
|
||||
if ($liensM->isInGroupeCAC40()) {
|
||||
$this->ValIsCAC = 1;
|
||||
}
|
||||
if ($this->debug) file_put_contents('sfr.log', "CAC40 = ".$this->ValIsCAC."\n", FILE_APPEND);
|
||||
*/
|
||||
|
||||
//Si Indiscore = null alors calcul
|
||||
if ( $this->ValIndiscore === null ) {
|
||||
|
@ -38,8 +38,8 @@ return array(
|
||||
'ANGOUG' => array('nom'=>"TGI ANGOULEME", 'siret'=>"17330111000073", 'dep'=>"16"),
|
||||
'ANNECA' => array('nom'=>"PREFECTURE D'ANNECY", 'siret'=>"17740001700014", 'dep'=>"74"),
|
||||
'ANNECG' => array('nom'=>"TGIcc ANNECY", 'siret'=>"17730111600063", 'dep'=>"74"),
|
||||
'ANNONC' => array('nom'=>"TC ANNONAY", 'siret'=>"17300111600024", 'dep'=>"71"),
|
||||
'ANTIBC' => array('nom'=>"TC ANTIBES", 'siret'=>"17130111200669", 'dep'=>"66"),
|
||||
'ANNONC' => array('nom'=>"TC ANNONAY", 'siret'=>"17300111600024", 'dep'=>"07"),
|
||||
'ANTIBC' => array('nom'=>"TC ANTIBES", 'siret'=>"17130111200669", 'dep'=>"06"),
|
||||
'ANTONB' => array('nom'=>"SOUS PREFECTURE D'ANTONY", 'siret'=>"17920001900059", 'dep'=>"92"),
|
||||
'APTB' => array('nom'=>"SOUS PREFECTURE D'APT", 'siret'=>"17840001600030", 'dep'=>"84"),
|
||||
'ARGELB' => array('nom'=>"SOUS PREFECTURE D'ARGELES GAZOST", 'siret'=>"17650001500035", 'dep'=>"65"),
|
||||
@ -52,7 +52,7 @@ return array(
|
||||
'ARRASA' => array('nom'=>"PREFECTURE D'ARRAS", 'siret'=>"17620001200019", 'dep'=>"62"),
|
||||
'ARRASC' => array('nom'=>"TC ARRAS", 'siret'=>"17590111500543", 'dep'=>"62"),
|
||||
'ARRASG' => array('nom'=>"TGI ARRAS", 'siret'=>"17590111500535", 'dep'=>"62"),
|
||||
'AUBENC' => array('nom'=>"TC AUBENAS", 'siret'=>"17300111600032", 'dep'=>"72"),
|
||||
'AUBENC' => array('nom'=>"TC AUBENAS", 'siret'=>"17300111600032", 'dep'=>"07"),
|
||||
'AUBUSB' => array('nom'=>"SOUS PREFECTURE D'AUBUSSON", 'siret'=>"17230001400021", 'dep'=>"23"),
|
||||
'AUCHA' => array('nom'=>"PREFECTURE D'AUCH", 'siret'=>"17320001500019", 'dep'=>"32"),
|
||||
'AUCHC' => array('nom'=>"TC AUCH", 'siret'=>"17470111000101", 'dep'=>"32"),
|
||||
@ -76,7 +76,7 @@ return array(
|
||||
'AVRAB' => array('nom'=>"SOUS PREFECTURE D'AVRANCHES", 'siret'=>"17500001700046", 'dep'=>"50"),
|
||||
'BAGNEB' => array('nom'=>"SOUS PREFECTURE DE BAGNERES DE BIGORRE", 'siret'=>"17650001500027", 'dep'=>"65"),
|
||||
'BAGNEC' => array('nom'=>"TC BAGNERES DE BIGORRE", 'siret'=>"17640111500108", 'dep'=>"65"),
|
||||
'BARCEB' => array('nom'=>"SOUS PREFECTURE DE BARCELONNETTE", 'siret'=>"17040001400040", 'dep'=>"44"),
|
||||
'BARCEB' => array('nom'=>"SOUS PREFECTURE DE BARCELONNETTE", 'siret'=>"17040001400040", 'dep'=>"04"),
|
||||
'BARLDA' => array('nom'=>"PREFECTURE DE BAR LE DUC", 'siret'=>"17550001600019", 'dep'=>"55"),
|
||||
'BARLDC' => array('nom'=>"TC BAR LE DUC", 'siret'=>"17540111600462", 'dep'=>"55"),
|
||||
'BARLDG' => array('nom'=>"TGI BAR LE DUC", 'siret'=>"17540111600298", 'dep'=>"55"),
|
||||
@ -101,8 +101,8 @@ return array(
|
||||
'BELFOC' => array('nom'=>"TC BELFORT", 'siret'=>"17250111600484", 'dep'=>"90"),
|
||||
'BELFOG' => array('nom'=>"TGI BELFORT", 'siret'=>"17250111600146", 'dep'=>"90"),
|
||||
'BELLAB' => array('nom'=>"SOUS PREFECTURE DE BELLAC", 'siret'=>"17870001900023", 'dep'=>"87"),
|
||||
'BELLEB' => array('nom'=>"SOUS PREFECTURE DE BELLEY", 'siret'=>"17010001000025", 'dep'=>"13"),
|
||||
'BELLEG' => array('nom'=>"TGIcc BELLEY", 'siret'=>"17690111400023", 'dep'=>"13"),
|
||||
'BELLEB' => array('nom'=>"SOUS PREFECTURE DE BELLEY", 'siret'=>"17010001000025", 'dep'=>"01"),
|
||||
'BELLEG' => array('nom'=>"TGIcc BELLEY", 'siret'=>"17690111400023", 'dep'=>"01"),
|
||||
'BERGEB' => array('nom'=>"SOUS PREFECTURE DE BERGERAC", 'siret'=>"17240001200081", 'dep'=>"24"),
|
||||
'BERGEC' => array('nom'=>"TC BERGERAC", 'siret'=>"17330111000230", 'dep'=>"24"),
|
||||
'BERGEG' => array('nom'=>"TGI BERGERAC", 'siret'=>"17330111000214", 'dep'=>"24"),
|
||||
@ -138,9 +138,9 @@ return array(
|
||||
'BOULOB' => array('nom'=>"SOUS PREFECTURE DE BOULOGNE SUR MER", 'siret'=>"17620001200035", 'dep'=>"62"),
|
||||
'BOULOC' => array('nom'=>"TC BOULOGNE SUR MER", 'siret'=>"17590111500758", 'dep'=>"62"),
|
||||
'BOULOG' => array('nom'=>"TGI BOULOGNE SUR MER", 'siret'=>"17590111500097", 'dep'=>"62"),
|
||||
'BOURGA' => array('nom'=>"PREFECTURE DE BOURG EN BRESSE", 'siret'=>"17010001000017", 'dep'=>"10"),
|
||||
'BOURGC' => array('nom'=>"TC BOURG EN BRESSE", 'siret'=>"17690111400445", 'dep'=>"10"),
|
||||
'BOURGG' => array('nom'=>"TGI BOURG EN BRESSE", 'siret'=>"17690111400080", 'dep'=>"10"),
|
||||
'BOURGA' => array('nom'=>"PREFECTURE DE BOURG EN BRESSE", 'siret'=>"17010001000017", 'dep'=>"01"),
|
||||
'BOURGC' => array('nom'=>"TC BOURG EN BRESSE", 'siret'=>"17690111400445", 'dep'=>"01"),
|
||||
'BOURGG' => array('nom'=>"TGI BOURG EN BRESSE", 'siret'=>"17690111400080", 'dep'=>"01"),
|
||||
'BRESSB' => array('nom'=>"SOUS PREFECTURE DE BRESSUIRE", 'siret'=>"17790001600060", 'dep'=>"79"),
|
||||
'BRESSG' => array('nom'=>"TGIcc BRESSUIRE", 'siret'=>"17860111800106", 'dep'=>"79"),
|
||||
'BRESTB' => array('nom'=>"SOUS PREFECTURE DE BREST", 'siret'=>"17290001100054", 'dep'=>"29"),
|
||||
@ -149,7 +149,7 @@ return array(
|
||||
'BRGESA' => array('nom'=>"PREFECTURE DE BOURGES", 'siret'=>"17180001400010", 'dep'=>"18"),
|
||||
'BRGESC' => array('nom'=>"TC BOURGES", 'siret'=>"17180111100179", 'dep'=>"18"),
|
||||
'BRGESG' => array('nom'=>"TGI BOURGES", 'siret'=>"17180111100062", 'dep'=>"18"),
|
||||
'BRIANB' => array('nom'=>"SOUS PREFECTURE DE BRIANCON", 'siret'=>"17050001100037", 'dep'=>"51"),
|
||||
'BRIANB' => array('nom'=>"SOUS PREFECTURE DE BRIANCON", 'siret'=>"17050001100037", 'dep'=>"05"),
|
||||
'BRIEYB' => array('nom'=>"SOUS PREFECTURE DE BRIEY", 'siret'=>"17540001900055", 'dep'=>"54"),
|
||||
'BRIEYC' => array('nom'=>"TC BRIEY", 'siret'=>"17540111600041", 'dep'=>"54"),
|
||||
'BRIEYG' => array('nom'=>"TGI BRIEY", 'siret'=>"17540111600058", 'dep'=>"54"),
|
||||
@ -172,14 +172,14 @@ return array(
|
||||
'CAMBRB' => array('nom'=>"SOUS PREFECTURE DE CAMBRAI", 'siret'=>"17590001800052", 'dep'=>"59"),
|
||||
'CAMBRC' => array('nom'=>"TC CAMBRAI", 'siret'=>"17590111500923", 'dep'=>"59"),
|
||||
'CAMBRG' => array('nom'=>"TGI CAMBRAI", 'siret'=>"17590111500931", 'dep'=>"59"),
|
||||
'CANNEC' => array('nom'=>"TC CANNES", 'siret'=>"17130111200701", 'dep'=>"64"),
|
||||
'CANNEC' => array('nom'=>"TC CANNES", 'siret'=>"17130111200701", 'dep'=>"06"),
|
||||
'CARCAA' => array('nom'=>"PREFECTURE DE CARCASSONNE", 'siret'=>"17110001900016", 'dep'=>"11"),
|
||||
'CARCAC' => array('nom'=>"TC CARCASSONNE", 'siret'=>"17340111800661", 'dep'=>"11"),
|
||||
'CARCAG' => array('nom'=>"TGI CARCASSONNE", 'siret'=>"17340111800513", 'dep'=>"11"),
|
||||
'CARPEB' => array('nom'=>"SOUS PREFECTURE DE CARPENTRAS", 'siret'=>"17840001600055", 'dep'=>"84"),
|
||||
'CARPEG' => array('nom'=>"TGIcc CARPENTRAS", 'siret'=>"17300111600206", 'dep'=>"84"),
|
||||
'CASTEC' => array('nom'=>"TC CASTELNAUDARY", 'siret'=>"173401118", 'dep'=>"11"),
|
||||
'CASTEB' => array('nom'=>"SOUS PREFECTURE DE CASTELLANE", 'siret'=>"17040001400024", 'dep'=>"41"),
|
||||
'CASTEB' => array('nom'=>"SOUS PREFECTURE DE CASTELLANE", 'siret'=>"17040001400024", 'dep'=>"04"),
|
||||
'CASTRB' => array('nom'=>"SOUS PREFECTURE DE CASTRES", 'siret'=>"17810001200024", 'dep'=>"81"),
|
||||
'CASTRC' => array('nom'=>"TC CASTRES", 'siret'=>"17310111400069", 'dep'=>"81"),
|
||||
'CASTRG' => array('nom'=>"TGI CASTRES", 'siret'=>"17310111400291", 'dep'=>"81"),
|
||||
@ -210,11 +210,11 @@ return array(
|
||||
'CHATIC' => array('nom'=>"TC CHATILLON SUR SEINE", 'siret'=>"17210111500340", 'dep'=>"21"),
|
||||
'CHATEB' => array('nom'=>"SOUS PREFECTURE DE CHATEAULIN", 'siret'=>"17290001100047", 'dep'=>"29"),
|
||||
'CHATSB' => array('nom'=>"SOUS PREFECTURE DE CHATEAU SALINS", 'siret'=>"17570001200081", 'dep'=>"57"),
|
||||
'CHATTB' => array('nom'=>"SOUS PREFECTURE DE CHATEAU THIERRY", 'siret'=>"17020001800027", 'dep'=>"24"),
|
||||
'CHATTB' => array('nom'=>"SOUS PREFECTURE DE CHATEAU THIERRY", 'siret'=>"17020001800027", 'dep'=>"02"),
|
||||
'CHAUMA' => array('nom'=>"PREFECTURE DE CHAUMONT", 'siret'=>"17520001300019", 'dep'=>"52"),
|
||||
'CHAUMC' => array('nom'=>"TC CHAUMONT", 'siret'=>"17210111500159", 'dep'=>"52"),
|
||||
'CHAUMG' => array('nom'=>"TGI CHAUMONT", 'siret'=>"17210111500142", 'dep'=>"52"),
|
||||
'CHAUNC' => array('nom'=>"TC CHAUNY", 'siret'=>"17800111100040", 'dep'=>"23"),
|
||||
'CHAUNC' => array('nom'=>"TC CHAUNY", 'siret'=>"17800111100040", 'dep'=>"02"),
|
||||
'CHERBB' => array('nom'=>"SOUS PREFECTURE DE CHERBOURG", 'siret'=>"17500001700061", 'dep'=>"50"),
|
||||
'CHERBC' => array('nom'=>"TC CHERBOURG", 'siret'=>"17140111000118", 'dep'=>"50"),
|
||||
'CHERBG' => array('nom'=>"TGI CHERBOURG", 'siret'=>"17140111000027", 'dep'=>"50"),
|
||||
@ -222,9 +222,9 @@ return array(
|
||||
'CHLONA' => array('nom'=>"PREFECTURE DE CHALONS SUR MARNE / EN CHAMPAGNE", 'siret'=>"17510001500015", 'dep'=>"51"),
|
||||
'CHLONC' => array('nom'=>"TC CHALONS EN CHAMPAGNE", 'siret'=>"17510111200035", 'dep'=>"51"),
|
||||
'CHLONG' => array('nom'=>"TGI CHALONS EN CHAMPAGNE", 'siret'=>"17510111200068", 'dep'=>"51"),
|
||||
'CHARLA' => array('nom'=>"PREFECTURE DE CHARLEVILLE-MEZIERES", 'siret'=>"17080001500019", 'dep'=>"80"),
|
||||
'CHMEZC' => array('nom'=>"TC CHARLEVILLE MEZIERES", 'siret'=>"17510111200134", 'dep'=>"80"),
|
||||
'CHMEZG' => array('nom'=>"TGI CHARLEVILLE-MEZIERES", 'siret'=>"17510111200126", 'dep'=>"80"),
|
||||
'CHARLA' => array('nom'=>"PREFECTURE DE CHARLEVILLE-MEZIERES", 'siret'=>"17080001500019", 'dep'=>"08"),
|
||||
'CHMEZC' => array('nom'=>"TC CHARLEVILLE MEZIERES", 'siret'=>"17510111200134", 'dep'=>"08"),
|
||||
'CHMEZG' => array('nom'=>"TGI CHARLEVILLE-MEZIERES", 'siret'=>"17510111200126", 'dep'=>"08"),
|
||||
'CHOLEB' => array('nom'=>"SOUS PREFECTURE DE CHOLET", 'siret'=>"17490001900020", 'dep'=>"49"),
|
||||
'CHTLTB' => array('nom'=>"SOUS PREFECTURE DE CHATELLERAULT", 'siret'=>"17860001100039", 'dep'=>"86"),
|
||||
'CHTLTC' => array('nom'=>"TC CHATELLERAULT", 'siret'=>"17860111800569", 'dep'=>"86"),
|
||||
@ -258,8 +258,8 @@ return array(
|
||||
'CRETEC' => array('nom'=>"TC CRETEIL", 'siret'=>"177501111", 'dep'=>"94"),
|
||||
'CRETEG' => array('nom'=>"TGI CRETEIL", 'siret'=>"17750111100641", 'dep'=>"94"),
|
||||
'CREUSC' => array('nom'=>"TC LE CREUSOT", 'siret'=>"17210111500308", 'dep'=>"71"),
|
||||
'CUSSEC' => array('nom'=>"TC CUSSET", 'siret'=>"17630111700113", 'dep'=>"33"),
|
||||
'CUSSEG' => array('nom'=>"TGI CUSSET", 'siret'=>"17630111700063", 'dep'=>"33"),
|
||||
'CUSSEC' => array('nom'=>"TC CUSSET", 'siret'=>"17630111700113", 'dep'=>"03"),
|
||||
'CUSSEG' => array('nom'=>"TGI CUSSET", 'siret'=>"17630111700063", 'dep'=>"03"),
|
||||
'DAXB' => array('nom'=>"SOUS PREFECTURE DE DAX", 'siret'=>"17400001800047", 'dep'=>"40"),
|
||||
'DAXC' => array('nom'=>"TC DAX", 'siret'=>"176401115", 'dep'=>"40"),
|
||||
'DAXG' => array('nom'=>"TGI DAX", 'siret'=>"17640111500264", 'dep'=>"40"),
|
||||
@ -268,8 +268,8 @@ return array(
|
||||
'DIEPPB' => array('nom'=>"SOUS PREFECTURE DE DIEPPE", 'siret'=>"17760001200021", 'dep'=>"76"),
|
||||
'DIEPPC' => array('nom'=>"TC DIEPPE", 'siret'=>"17760111900098", 'dep'=>"76"),
|
||||
'DIEPPG' => array('nom'=>"TGI DIEPPE", 'siret'=>"17760111900023", 'dep'=>"76"),
|
||||
'DIGNEA' => array('nom'=>"PREFECTURE DE DIGNE", 'siret'=>"17040001400016", 'dep'=>"40"),
|
||||
'DIGNEG' => array('nom'=>"TGI DIGNE", 'siret'=>"17130111200297", 'dep'=>"40"),
|
||||
'DIGNEA' => array('nom'=>"PREFECTURE DE DIGNE", 'siret'=>"17040001400016", 'dep'=>"04"),
|
||||
'DIGNEG' => array('nom'=>"TGI DIGNE", 'siret'=>"17130111200297", 'dep'=>"04"),
|
||||
'DIJONA' => array('nom'=>"PREFECTURE DE DIJON", 'siret'=>"17210001800016", 'dep'=>"21"),
|
||||
'DIJONC' => array('nom'=>"TC DIJON", 'siret'=>"17210111500498", 'dep'=>"21"),
|
||||
'DIJONG' => array('nom'=>"TGI DIJON", 'siret'=>"17210111500480", 'dep'=>"21"),
|
||||
@ -309,29 +309,29 @@ return array(
|
||||
'FIGEAB' => array('nom'=>"SOUS PREFECTURE DE FIGEAC", 'siret'=>"17460001500047", 'dep'=>"46"),
|
||||
'FLERSC' => array('nom'=>"TC FLERS", 'siret'=>"", 'dep'=>"61"),
|
||||
'FLORAB' => array('nom'=>"SOUS PREFECTURE DE FLORAC", 'siret'=>"", 'dep'=>"48"),
|
||||
'FOIXA' => array('nom'=>"PREFECTURE DE FOIX", 'siret'=>"17090001300013", 'dep'=>"90"),
|
||||
'FOIXC' => array('nom'=>"TC FOIX", 'siret'=>"17310111400374", 'dep'=>"90"),
|
||||
'FOIXG' => array('nom'=>"TGI FOIX", 'siret'=>"17310111400150", 'dep'=>"90"),
|
||||
'FOIXA' => array('nom'=>"PREFECTURE DE FOIX", 'siret'=>"17090001300013", 'dep'=>"09"),
|
||||
'FOIXC' => array('nom'=>"TC FOIX", 'siret'=>"17310111400374", 'dep'=>"09"),
|
||||
'FOIXG' => array('nom'=>"TGI FOIX", 'siret'=>"17310111400150", 'dep'=>"09"),
|
||||
'FONTB' => array('nom'=>"SOUS PREFECTURE DE FONTAINEBLEAU", 'siret'=>"17770001000081", 'dep'=>"77"),
|
||||
'FONTEB' => array('nom'=>"SOUS PREFECTURE DE FONTENAY LE COMTE", 'siret'=>"17850001300036", 'dep'=>"85"),
|
||||
'FONTG' => array('nom'=>"TGI FONTAINEBLEAU", 'siret'=>"17750111100922", 'dep'=>"77"),
|
||||
'FORBAB' => array('nom'=>"SOUS PREFECTURE DE FORBACH", 'siret'=>"17570001200107", 'dep'=>"57"),
|
||||
'FORCAB' => array('nom'=>"SOUS PREFECTURE DE FORCALQUIER", 'siret'=>"17040001400032", 'dep'=>"43"),
|
||||
'FORCAB' => array('nom'=>"SOUS PREFECTURE DE FORCALQUIER", 'siret'=>"17040001400032", 'dep'=>"04"),
|
||||
'FORTFA' => array('nom'=>"PREFECTURE DE FORT DE FRANCE", 'siret'=>"17972001600015", 'dep'=>"972"),
|
||||
'FORTFG' => array('nom'=>"TGI FORT DE FRANCE", 'siret'=>"17972111300118", 'dep'=>"972"),
|
||||
'FORTFM' => array('nom'=>"TMX FORT DE FRANCE", 'siret'=>"17972111300142", 'dep'=>"972"),
|
||||
'FOUGEB' => array('nom'=>"SOUS PREFECTURE DE FOUGERES", 'siret'=>"17350001800044", 'dep'=>"35"),
|
||||
'FREJUC' => array('nom'=>"TC FREJUS", 'siret'=>"17130111200594", 'dep'=>"83"),
|
||||
'GAPA' => array('nom'=>"PREFECTURE DE GAP", 'siret'=>"17050001100011", 'dep'=>"50"),
|
||||
'GAPC' => array('nom'=>"TC GAP", 'siret'=>"17380111900269", 'dep'=>"50"),
|
||||
'GAPG' => array('nom'=>"TGI GAP", 'siret'=>"17380111900277", 'dep'=>"50"),
|
||||
'GEXB' => array('nom'=>"SOUS PREFECTURE DE GEX", 'siret'=>"17010001000033", 'dep'=>"11"),
|
||||
'GAPA' => array('nom'=>"PREFECTURE DE GAP", 'siret'=>"17050001100011", 'dep'=>"05"),
|
||||
'GAPC' => array('nom'=>"TC GAP", 'siret'=>"17380111900269", 'dep'=>"05"),
|
||||
'GAPG' => array('nom'=>"TGI GAP", 'siret'=>"17380111900277", 'dep'=>"05"),
|
||||
'GEXB' => array('nom'=>"SOUS PREFECTURE DE GEX", 'siret'=>"17010001000033", 'dep'=>"01"),
|
||||
'GOURDB' => array('nom'=>"SOUS PREFECTURE DE GOURDON", 'siret'=>"17460001500039", 'dep'=>"46"),
|
||||
'GOURNC' => array('nom'=>"TC GOURNAY EN BRAY", 'siret'=>"", 'dep'=>"76"),
|
||||
'GRANVC' => array('nom'=>"TC GRANVILLE", 'siret'=>"", 'dep'=>"50"),
|
||||
'GRASSB' => array('nom'=>"SOUS PREFECTURE DE GRASSE", 'siret'=>"17060001900054", 'dep'=>"61"),
|
||||
'GRASSC' => array('nom'=>"TC GRASSE", 'siret'=>"17130111200404", 'dep'=>"61"),
|
||||
'GRASSG' => array('nom'=>"TGI GRASSE", 'siret'=>"17130111200651", 'dep'=>"61"),
|
||||
'GRASSB' => array('nom'=>"SOUS PREFECTURE DE GRASSE", 'siret'=>"17060001900054", 'dep'=>"06"),
|
||||
'GRASSC' => array('nom'=>"TC GRASSE", 'siret'=>"17130111200404", 'dep'=>"06"),
|
||||
'GRASSG' => array('nom'=>"TGI GRASSE", 'siret'=>"17130111200651", 'dep'=>"06"),
|
||||
'GRAYC' => array('nom'=>"TC GRAY", 'siret'=>"17250111600294", 'dep'=>"70"),
|
||||
'GRENOA' => array('nom'=>"PREFECTURE DE GRENOBLE", 'siret'=>"17380001200010", 'dep'=>"38"),
|
||||
'GRENOC' => array('nom'=>"TC GRENOBLE", 'siret'=>"17380111900129", 'dep'=>"38"),
|
||||
@ -363,9 +363,9 @@ return array(
|
||||
'LANGRB' => array('nom'=>"SOUS PREFECTURE DE LANGRES", 'siret'=>"17520001300035", 'dep'=>"52"),
|
||||
'LANGRC' => array('nom'=>"TC LANGRES", 'siret'=>"", 'dep'=>"52"),
|
||||
'LANNIB' => array('nom'=>"SOUS PREFECTURE DE LANNION", 'siret'=>"17220001600043", 'dep'=>"22"),
|
||||
'LAONA' => array('nom'=>"PREFECTURE DE LAON", 'siret'=>"17020001800019", 'dep'=>"20"),
|
||||
'LAONG' => array('nom'=>"TGI LAON", 'siret'=>"17800111100248", 'dep'=>"20"),
|
||||
'LARGEB' => array('nom'=>"SOUS PREFECTURE DE LARGENTIERE", 'siret'=>"17070001700032", 'dep'=>"71"),
|
||||
'LAONA' => array('nom'=>"PREFECTURE DE LAON", 'siret'=>"17020001800019", 'dep'=>"02"),
|
||||
'LAONG' => array('nom'=>"TGI LAON", 'siret'=>"17800111100248", 'dep'=>"02"),
|
||||
'LARGEB' => array('nom'=>"SOUS PREFECTURE DE LARGENTIERE", 'siret'=>"17070001700032", 'dep'=>"07"),
|
||||
'LATOUB' => array('nom'=>"SOUS PREFECTURE DE LA TOUR DU PIN", 'siret'=>"17380001200028", 'dep'=>"38"),
|
||||
'LATRIB' => array('nom'=>"SOUS PREFECTURE DE LA TRINITE", 'siret'=>"17972001600031", 'dep'=>"972"),
|
||||
'LAVALA' => array('nom'=>"PREFECTURE DE LAVAL", 'siret'=>"17530001100053", 'dep'=>"53"),
|
||||
@ -423,7 +423,7 @@ return array(
|
||||
'MAMOUA' => array('nom'=>"PREFECTURE DE MAYOTTE", 'siret'=>"13000334600017", 'dep'=>"976"),
|
||||
'MAMOUP' => array('nom'=>"TPI MAMOUDZOU", 'siret'=>"130003395", 'dep'=>"976"),
|
||||
'MAMOUS' => array('nom'=>"TSA MAMOUDZOU", 'siret'=>"13000339500014", 'dep'=>"976"),
|
||||
'MANOSC' => array('nom'=>"TC MANOSQUE", 'siret'=>"17130111200255", 'dep'=>"41"),
|
||||
'MANOSC' => array('nom'=>"TC MANOSQUE", 'siret'=>"17130111200255", 'dep'=>"04"),
|
||||
'MANSA' => array('nom'=>"PREFECTURE DU MANS", 'siret'=>"17720001100019", 'dep'=>"72"),
|
||||
'MANSC' => array('nom'=>"TC LE MANS", 'siret'=>"17490111600031", 'dep'=>"72"),
|
||||
'MANSG' => array('nom'=>"TGI LE MANS", 'siret'=>"17490111600049", 'dep'=>"72"),
|
||||
@ -447,7 +447,7 @@ return array(
|
||||
'MENDEA' => array('nom'=>"PREFECTURE DE MENDE", 'siret'=>"17480001100010", 'dep'=>"48"),
|
||||
'MENDEC' => array('nom'=>"TC MENDE", 'siret'=>"17300111600131", 'dep'=>"48"),
|
||||
'MENDEG' => array('nom'=>"TGIcc MENDE", 'siret'=>"17300111600131", 'dep'=>"48"),
|
||||
'MENTOC' => array('nom'=>"TC MENTON", 'siret'=>"17130111200396", 'dep'=>"65"),
|
||||
'MENTOC' => array('nom'=>"TC MENTON", 'siret'=>"17130111200396", 'dep'=>"06"),
|
||||
'METZA' => array('nom'=>"PREFECTURE DE METZ", 'siret'=>"17570001200016", 'dep'=>"57"),
|
||||
'METZB' => array('nom'=>"SOUS PREFECTURE DE METZ", 'siret'=>"", 'dep'=>"57"),
|
||||
'METZG' => array('nom'=>"TGIcc METZ", 'siret'=>"17570111900059", 'dep'=>"57"),
|
||||
@ -464,9 +464,9 @@ return array(
|
||||
'MONTEC' => array('nom'=>"TC MONTEREAU", 'siret'=>"17750111100153", 'dep'=>"77"),
|
||||
'MONTIB' => array('nom'=>"SOUS PREFECTURE DE MONTDIDIER", 'siret'=>"17800001400039", 'dep'=>"80"),
|
||||
'MONTIC' => array('nom'=>"TC MONTELIMAR", 'siret'=>"17380111900368", 'dep'=>"26"),
|
||||
'MONTLB' => array('nom'=>"SOUS PREFECTURE DE MONTLUCON", 'siret'=>"17030001600046", 'dep'=>"31"),
|
||||
'MONTLC' => array('nom'=>"TC MONTLUCON", 'siret'=>"17630111700121", 'dep'=>"31"),
|
||||
'MONTLG' => array('nom'=>"TGI MONTLUCON", 'siret'=>"17630111700279", 'dep'=>"31"),
|
||||
'MONTLB' => array('nom'=>"SOUS PREFECTURE DE MONTLUCON", 'siret'=>"17030001600046", 'dep'=>"03"),
|
||||
'MONTLC' => array('nom'=>"TC MONTLUCON", 'siret'=>"17630111700121", 'dep'=>"03"),
|
||||
'MONTLG' => array('nom'=>"TGI MONTLUCON", 'siret'=>"17630111700279", 'dep'=>"03"),
|
||||
'MONTA' => array('nom'=>"PREFECTURE DE MONT DE MARSAN", 'siret'=>"17400001800013", 'dep'=>"40"),
|
||||
'MONTMC' => array('nom'=>"TC MONT DE MARSAN", 'siret'=>"17640111500397", 'dep'=>"40"),
|
||||
'MONTMG' => array('nom'=>"TGI MONT DE MARSAN", 'siret'=>"17640111500256", 'dep'=>"40"),
|
||||
@ -488,9 +488,9 @@ return array(
|
||||
'MORLAC' => array('nom'=>"TC MORLAIX", 'siret'=>"17350111500302", 'dep'=>"29"),
|
||||
'MORLAG' => array('nom'=>"TGI MORLAIX", 'siret'=>"17350111500492", 'dep'=>"29"),
|
||||
'MORTAB' => array('nom'=>"SOUS PREFECTURE DE MORTAGNE AU PERCHE", 'siret'=>"17610001400032", 'dep'=>"61"),
|
||||
'MOULIA' => array('nom'=>"PREFECTURE DE MOULINS", 'siret'=>"17030001600012", 'dep'=>"30"),
|
||||
'MOULIC' => array('nom'=>"TC MOULINS", 'siret'=>"17630111700139", 'dep'=>"30"),
|
||||
'MOULIG' => array('nom'=>"TGI MOULINS", 'siret'=>"17630111700485", 'dep'=>"30"),
|
||||
'MOULIA' => array('nom'=>"PREFECTURE DE MOULINS", 'siret'=>"17030001600012", 'dep'=>"03"),
|
||||
'MOULIC' => array('nom'=>"TC MOULINS", 'siret'=>"17630111700139", 'dep'=>"03"),
|
||||
'MOULIG' => array('nom'=>"TGI MOULINS", 'siret'=>"17630111700485", 'dep'=>"03"),
|
||||
'MULHOB' => array('nom'=>"SOUS PREFECTURE DE MULHOUSE", 'siret'=>"17680001900034", 'dep'=>"68"),
|
||||
'MULHOG' => array('nom'=>"TGIcc MULHOUSE", 'siret'=>"17680111600110", 'dep'=>"68"),
|
||||
'MULHOI' => array('nom'=>"TI MULHOUSE", 'siret'=>"17680111600102", 'dep'=>"68"),
|
||||
@ -504,7 +504,7 @@ return array(
|
||||
'NANTRA' => array('nom'=>"PREFECTURE DE NANTERRE", 'siret'=>"17920001900018", 'dep'=>"92"),
|
||||
'NANTRC' => array('nom'=>"TC NANTERRE", 'siret'=>"17780111500441", 'dep'=>"92"),
|
||||
'NANTRG' => array('nom'=>"TGI NANTERRE", 'siret'=>"17780111500151", 'dep'=>"92"),
|
||||
'NANTUB' => array('nom'=>"SOUS PREFECTURE DE NANTUA", 'siret'=>"17010001000041", 'dep'=>"11"),
|
||||
'NANTUB' => array('nom'=>"SOUS PREFECTURE DE NANTUA", 'siret'=>"17010001000041", 'dep'=>"01"),
|
||||
'NARBOB' => array('nom'=>"SOUS PREFECTURE DE NARBONNE", 'siret'=>"17110001900024", 'dep'=>"11"),
|
||||
'NARBOC' => array('nom'=>"TC NARBONNE", 'siret'=>"17340111800075", 'dep'=>"11"),
|
||||
'NARBOG' => array('nom'=>"TGI NARBONNE", 'siret'=>"17340111800083", 'dep'=>"11"),
|
||||
@ -515,9 +515,9 @@ return array(
|
||||
'NEVERA' => array('nom'=>"PREFECTURE DE NEVERS", 'siret'=>"17580001000019", 'dep'=>"58"),
|
||||
'NEVERC' => array('nom'=>"TC NEVERS", 'siret'=>"17180111100351", 'dep'=>"58"),
|
||||
'NEVERG' => array('nom'=>"TGI NEVERS", 'siret'=>"17180111100401", 'dep'=>"58"),
|
||||
'NICEA' => array('nom'=>"PREFECTURE DE NICE", 'siret'=>"17060001900013", 'dep'=>"62"),
|
||||
'NICEC' => array('nom'=>"TC NICE", 'siret'=>"17130111200677", 'dep'=>"60"),
|
||||
'NICEG' => array('nom'=>"TGI NICE", 'siret'=>"17130111200289", 'dep'=>"63"),
|
||||
'NICEA' => array('nom'=>"PREFECTURE DE NICE", 'siret'=>"17060001900013", 'dep'=>"06"),
|
||||
'NICEC' => array('nom'=>"TC NICE", 'siret'=>"17130111200677", 'dep'=>"06"),
|
||||
'NICEG' => array('nom'=>"TGI NICE", 'siret'=>"17130111200289", 'dep'=>"06"),
|
||||
'NIMESI' => array('nom'=>"TI NIMES", 'siret'=>"17300111600099", 'dep'=>"30"),
|
||||
'NIMESA' => array('nom'=>"PREFECTURE DE NIMES", 'siret'=>"17300001900013", 'dep'=>"30"),
|
||||
'NIMESC' => array('nom'=>"TC NIMES", 'siret'=>"17300111600248", 'dep'=>"30"),
|
||||
@ -541,7 +541,7 @@ return array(
|
||||
'ORLEAG' => array('nom'=>"TGI ORLEANS", 'siret'=>"17450111400063", 'dep'=>"45"),
|
||||
'PAIMPC' => array('nom'=>"TC PAIMPOL", 'siret'=>"17350111500252", 'dep'=>"22"),
|
||||
'PALAIB' => array('nom'=>"SOUS PREFECTURE DE PALAISEAU", 'siret'=>"17910001100040", 'dep'=>"91"),
|
||||
'PAMIEB' => array('nom'=>"SOUS PREFECTURE DE PAMIERS", 'siret'=>"17090001300047", 'dep'=>"91"),
|
||||
'PAMIEB' => array('nom'=>"SOUS PREFECTURE DE PAMIERS", 'siret'=>"17090001300047", 'dep'=>"09"),
|
||||
'PAPEEM' => array('nom'=>"TMX PAPEETE", 'siret'=>"17987642000011", 'dep'=>"987"),
|
||||
'PAPEEP' => array('nom'=>"TPI PAPEETE", 'siret'=>"17987642000011", 'dep'=>"987"),
|
||||
'PARISA' => array('nom'=>"PREFECTURE DE PARIS", 'siret'=>"17750001400010", 'dep'=>"75"),
|
||||
@ -574,9 +574,9 @@ return array(
|
||||
'PONTOG' => array('nom'=>"TGI PONTOISE", 'siret'=>"17780111500201", 'dep'=>"95"),
|
||||
'PONTRB' => array('nom'=>"SOUS PREFECTURE DE PONTARLIER", 'siret'=>"17250001900044", 'dep'=>"25"),
|
||||
'PRADEB' => array('nom'=>"SOUS PREFECTURE DE PRADES", 'siret'=>"17660001300039", 'dep'=>"66"),
|
||||
'PRIVA' => array('nom'=>"PREFECTURE DE PRIVAS", 'siret'=>"17070001700016", 'dep'=>"70"),
|
||||
'PRIVG' => array('nom'=>"TGI PRIVAS", 'siret'=>"17300111600057", 'dep'=>"70"),
|
||||
'PRIVI' => array('nom'=>"TI PRIVAS", 'siret'=>"17300111600313", 'dep'=>"70"),
|
||||
'PRIVA' => array('nom'=>"PREFECTURE DE PRIVAS", 'siret'=>"17070001700016", 'dep'=>"07"),
|
||||
'PRIVG' => array('nom'=>"TGI PRIVAS", 'siret'=>"17300111600057", 'dep'=>"07"),
|
||||
'PRIVI' => array('nom'=>"TI PRIVAS", 'siret'=>"17300111600313", 'dep'=>"07"),
|
||||
'PROVIB' => array('nom'=>"SOUS PREFECTURE DE PROVINS", 'siret'=>"17770001000024", 'dep'=>"77"),
|
||||
'PROVIC' => array('nom'=>"TC PROVINS", 'siret'=>"17750111100161", 'dep'=>"77"),
|
||||
'QUIMPA' => array('nom'=>"PREFECTURE DE QUIMPER", 'siret'=>"17290001100013", 'dep'=>"29"),
|
||||
@ -590,7 +590,7 @@ return array(
|
||||
'RENNEA' => array('nom'=>"PREFECTURE DE RENNES", 'siret'=>"17350001800010", 'dep'=>"35"),
|
||||
'RENNEC' => array('nom'=>"TC RENNES", 'siret'=>"17350111500278", 'dep'=>"35"),
|
||||
'RENNEG' => array('nom'=>"TGI RENNES", 'siret'=>"17350111500161", 'dep'=>"35"),
|
||||
'RETHEB' => array('nom'=>"SOUS PREFECTURE DE RETHEL", 'siret'=>"17080001500068", 'dep'=>"83"),
|
||||
'RETHEB' => array('nom'=>"SOUS PREFECTURE DE RETHEL", 'siret'=>"17080001500068", 'dep'=>"08"),
|
||||
'RIBEAB' => array('nom'=>"SOUS PREFECTURE DE RIBEAUVILLE", 'siret'=>"17680001900042", 'dep'=>"68"),
|
||||
'RIOMB' => array('nom'=>"SOUS PREFECTURE DE RIOM", 'siret'=>"17630001000053", 'dep'=>"63"),
|
||||
'RIOMC' => array('nom'=>"TC RIOM", 'siret'=>"17630111700220", 'dep'=>"63"),
|
||||
@ -636,8 +636,8 @@ return array(
|
||||
'SAVERB' => array('nom'=>"SOUS PREFECTURE DE SAVERNE", 'siret'=>"17670001100099", 'dep'=>"67"),
|
||||
'SAVERG' => array('nom'=>"TGIcc SAVERNE", 'siret'=>"17680111600417", 'dep'=>"67"),
|
||||
'SAVERI' => array('nom'=>"TI SAVERNE", 'siret'=>"17680111600227", 'dep'=>"67"),
|
||||
'SEDANB' => array('nom'=>"SOUS PREFECTURE DE SEDAN", 'siret'=>"17080001500043", 'dep'=>"82"),
|
||||
'SEDANC' => array('nom'=>"TC SEDAN", 'siret'=>"17510111200084", 'dep'=>"82"),
|
||||
'SEDANB' => array('nom'=>"SOUS PREFECTURE DE SEDAN", 'siret'=>"17080001500043", 'dep'=>"08"),
|
||||
'SEDANC' => array('nom'=>"TC SEDAN", 'siret'=>"17510111200084", 'dep'=>"08"),
|
||||
'SEGREB' => array('nom'=>"SOUS PREFECTURE DE SEGRE", 'siret'=>"17490001900038", 'dep'=>"49"),
|
||||
'SELESB' => array('nom'=>"SOUS PREFECTURE DE SELESTAT", 'siret'=>"", 'dep'=>"67"),
|
||||
'SENLIB' => array('nom'=>"SOUS PREFECTURE DE SENLIS", 'siret'=>"17600001600046", 'dep'=>"60"),
|
||||
@ -647,9 +647,9 @@ return array(
|
||||
'SENSC' => array('nom'=>"TC SENS", 'siret'=>"17750111100864", 'dep'=>"89"),
|
||||
'SENSG' => array('nom'=>"TGI SENS", 'siret'=>"17750111100146", 'dep'=>"89"),
|
||||
'SETEC' => array('nom'=>"TC SETE", 'siret'=>"17340111800646", 'dep'=>"34"),
|
||||
'SOISSB' => array('nom'=>"SOUS PREFECTURE DE SOISSONS", 'siret'=>"17020001800050", 'dep'=>"22"),
|
||||
'SOISSC' => array('nom'=>"TC SOISSONS", 'siret'=>"17800111100347", 'dep'=>"22"),
|
||||
'SOISSG' => array('nom'=>"TGI SOISSONS", 'siret'=>"17800111100123", 'dep'=>"22"),
|
||||
'SOISSB' => array('nom'=>"SOUS PREFECTURE DE SOISSONS", 'siret'=>"17020001800050", 'dep'=>"02"),
|
||||
'SOISSC' => array('nom'=>"TC SOISSONS", 'siret'=>"17800111100347", 'dep'=>"02"),
|
||||
'SOISSG' => array('nom'=>"TGI SOISSONS", 'siret'=>"17800111100123", 'dep'=>"02"),
|
||||
'SPIEMP' => array('nom'=>"TPI SAINT PIERRE ET MIQUELON", 'siret'=>"13000269400045", 'dep'=>"975"),
|
||||
'SPIEMS' => array('nom'=>"TSA SAINT PIERRE ET MIQUELON", 'siret'=>"13000269400029", 'dep'=>"975"),
|
||||
'STAFFC' => array('nom'=>"TC SAINT AFRIQUE", 'siret'=>"17340111800232", 'dep'=>"12"),
|
||||
@ -679,7 +679,7 @@ return array(
|
||||
'STGAUC' => array('nom'=>"TC SAINT GAUDENS", 'siret'=>"17310111400556", 'dep'=>"31"),
|
||||
'STGAUG' => array('nom'=>"TGI SAINT GAUDENS", 'siret'=>"17310111400085", 'dep'=>"31"),
|
||||
'STGERB' => array('nom'=>"SOUS PREFECTURE DE ST GERMAIN EN LAYE", 'siret'=>"17780001800034", 'dep'=>"78"),
|
||||
'STGIRB' => array('nom'=>"SOUS PREFECTURE DE ST GIRONS", 'siret'=>"17090001300054", 'dep'=>"92"),
|
||||
'STGIRB' => array('nom'=>"SOUS PREFECTURE DE ST GIRONS", 'siret'=>"17090001300054", 'dep'=>"09"),
|
||||
'STJEAB' => array('nom'=>"SOUS PREFECTURE DE ST JEAN D'ANGELY", 'siret'=>"17170001600057", 'dep'=>"17"),
|
||||
'STJEAC' => array('nom'=>"TC SAINT JEAN D'ANGELY", 'siret'=>"", 'dep'=>"17"),
|
||||
'STJEMB' => array('nom'=>"SOUS PREFECTURE DE ST JEAN DE MAURIENNE", 'siret'=>"17730001900037", 'dep'=>"73"),
|
||||
@ -700,9 +700,9 @@ return array(
|
||||
'STPIEB' => array('nom'=>"SOUS PREFECTURE DE ST PIERRE DE LA REUNION", 'siret'=>"17974001400040", 'dep'=>"974"),
|
||||
'STPIEG' => array('nom'=>"TGIcc SAINT PIERRE", 'siret'=>"17974111100035", 'dep'=>"974"),
|
||||
'STPIMA' => array('nom'=>"PREFECTURE DE ST PIERRE ET MIQUELON", 'siret'=>"17975663000010", 'dep'=>"975"),
|
||||
'STQUEB' => array('nom'=>"SOUS PREFECTURE DE ST QUENTIN", 'siret'=>"17020001800043", 'dep'=>"21"),
|
||||
'STQUEC' => array('nom'=>"TC SAINT QUENTIN", 'siret'=>"17800111100115", 'dep'=>"21"),
|
||||
'STQUEG' => array('nom'=>"TGI SAINT QUENTIN", 'siret'=>"17800111100065", 'dep'=>"23"),
|
||||
'STQUEB' => array('nom'=>"SOUS PREFECTURE DE ST QUENTIN", 'siret'=>"17020001800043", 'dep'=>"02"),
|
||||
'STQUEC' => array('nom'=>"TC SAINT QUENTIN", 'siret'=>"17800111100115", 'dep'=>"02"),
|
||||
'STQUEG' => array('nom'=>"TGI SAINT QUENTIN", 'siret'=>"17800111100065", 'dep'=>"02"),
|
||||
'STRASA' => array('nom'=>"PREFECTURE DE STRASBOURG", 'siret'=>"17670001100016", 'dep'=>"67"),
|
||||
'STRASB' => array('nom'=>"SOUS PREFECTURE DE STRASBOURG", 'siret'=>"17670001100131", 'dep'=>"67"),
|
||||
'STRASG' => array('nom'=>"TGIcc STRASBOURG", 'siret'=>"17680111600276", 'dep'=>"67"),
|
||||
@ -732,7 +732,7 @@ return array(
|
||||
'TOULSC' => array('nom'=>"TC TOULOUSE", 'siret'=>"17310111400168", 'dep'=>"31"),
|
||||
'TOULSG' => array('nom'=>"TGI TOULOUSE", 'siret'=>"17310111400259", 'dep'=>"31"),
|
||||
'TOURCC' => array('nom'=>"TC ROUBAIX TOURCOING", 'siret'=>"17590111500642", 'dep'=>"59"),
|
||||
'TOURNB' => array('nom'=>"SOUS PREFECTURE DE TOURNON SUR RHONE", 'siret'=>"17070001700024", 'dep'=>"73"),
|
||||
'TOURNB' => array('nom'=>"SOUS PREFECTURE DE TOURNON SUR RHONE", 'siret'=>"17070001700024", 'dep'=>"07"),
|
||||
'TOURNC' => array('nom'=>"TC TOURNUS", 'siret'=>"", 'dep'=>"71"),
|
||||
'TOURSA' => array('nom'=>"PREFECTURE DE TOURS", 'siret'=>"17370001400017", 'dep'=>"37"),
|
||||
'TOURSC' => array('nom'=>"TC TOURS", 'siret'=>"17450111400105", 'dep'=>"37"),
|
||||
@ -759,12 +759,12 @@ return array(
|
||||
'VERSAA' => array('nom'=>"PREFECTURE DE VERSAILLES", 'siret'=>"17780001800067", 'dep'=>"78"),
|
||||
'VERSAC' => array('nom'=>"TC VERSAILLES", 'siret'=>"17780111500482", 'dep'=>"78"),
|
||||
'VERSAG' => array('nom'=>"TGI VERSAILLES", 'siret'=>"17780111500466", 'dep'=>"78"),
|
||||
'VERVIB' => array('nom'=>"SOUS PREFECTURE DE VERVINS", 'siret'=>"17020001800035", 'dep'=>"21"),
|
||||
'VERVIC' => array('nom'=>"TC VERVINS", 'siret'=>"17800111100131", 'dep'=>"21"),
|
||||
'VERVIB' => array('nom'=>"SOUS PREFECTURE DE VERVINS", 'siret'=>"17020001800035", 'dep'=>"02"),
|
||||
'VERVIC' => array('nom'=>"TC VERVINS", 'siret'=>"17800111100131", 'dep'=>"02"),
|
||||
'VESOUA' => array('nom'=>"PREFECTURE DE VESOUL", 'siret'=>"17700001500012", 'dep'=>"70"),
|
||||
'VESOUC' => array('nom'=>"TC VESOUL GRAY", 'siret'=>"17250111600476", 'dep'=>"70"),
|
||||
'VESOUG' => array('nom'=>"TGI VESOUL", 'siret'=>"17250111600286", 'dep'=>"70"),
|
||||
'VICHYB' => array('nom'=>"SOUS PREFECTURE DE VICHY", 'siret'=>"17030001600038", 'dep'=>"32"),
|
||||
'VICHYB' => array('nom'=>"SOUS PREFECTURE DE VICHY", 'siret'=>"17030001600038", 'dep'=>"03"),
|
||||
'VIENNB' => array('nom'=>"SOUS PREFECTURE DE VIENNE", 'siret'=>"", 'dep'=>"38"),
|
||||
'VIENNC' => array('nom'=>"TC VIENNE", 'siret'=>"17380111900137", 'dep'=>"38"),
|
||||
'VIENNG' => array('nom'=>"TGI VIENNE", 'siret'=>"17380111900053", 'dep'=>"38"),
|
||||
@ -780,14 +780,14 @@ return array(
|
||||
'VIREB' => array('nom'=>"SOUS PREFECTURE DE VIRE", 'siret'=>"17140001300057", 'dep'=>"14"),
|
||||
'VIREC' => array('nom'=>"TC VIRE", 'siret'=>"", 'dep'=>"14"),
|
||||
'VITRYB' => array('nom'=>"SOUS PREFECTURE DE VITRY LE FRANCOIS", 'siret'=>"17510001500031", 'dep'=>"51"),
|
||||
'VOUZIB' => array('nom'=>"SOUS PREFECTURE DE VOUZIERS", 'siret'=>"17080001500027", 'dep'=>"84"),
|
||||
'VOUZIB' => array('nom'=>"SOUS PREFECTURE DE VOUZIERS", 'siret'=>"17080001500027", 'dep'=>"08"),
|
||||
'WISSEB' => array('nom'=>"SOUS PREFECTURE DE WISSEMBOURG", 'siret'=>"17670001100081", 'dep'=>"67"),
|
||||
'YSSINB' => array('nom'=>"SOUS PREFECTURE DE YSSINGEAUX", 'siret'=>"17430001200047", 'dep'=>"43"),
|
||||
'LOUVII' => array('nom'=>"TI LOUVIERS", 'siret'=>"17760111900304", 'dep'=>"27"),
|
||||
'VIGANI' => array('nom'=>"TI VIGAN", 'siret'=>"17300111600362", 'dep'=>"30"),
|
||||
'NANTUI' => array('nom'=>"TI NANTUA", 'siret'=>"17690111400155", 'dep'=>"11"),
|
||||
'NICEI' => array('nom'=>"TI NICE", 'siret'=>"17130111200685", 'dep'=>"63"),
|
||||
'SEDANI' => array('nom'=>"TI SEDAN", 'siret'=>"17510111200209", 'dep'=>"82"),
|
||||
'NANTUI' => array('nom'=>"TI NANTUA", 'siret'=>"17690111400155", 'dep'=>"01"),
|
||||
'NICEI' => array('nom'=>"TI NICE", 'siret'=>"17130111200685", 'dep'=>"06"),
|
||||
'SEDANI' => array('nom'=>"TI SEDAN", 'siret'=>"17510111200209", 'dep'=>"08"),
|
||||
'PERIGI' => array('nom'=>"TI PERIGUEUX", 'siret'=>"17330111000180", 'dep'=>"24"),
|
||||
'NANTEI' => array('nom'=>"TI NANTES", 'siret'=>"17350111500880", 'dep'=>"44"),
|
||||
'COUTAI' => array('nom'=>"TI COUTANCES", 'siret'=>"17140111000282", 'dep'=>"50"),
|
||||
@ -795,7 +795,7 @@ return array(
|
||||
'PONTOI' => array('nom'=>"TI PONTOISE", 'siret'=>"17780111500573", 'dep'=>"95"),
|
||||
'MOUTII' => array('nom'=>"TI MOUTIERS", 'siret'=>"17730111600139", 'dep'=>"73"),
|
||||
'CIVRAI' => array('nom'=>"TI CIVRAY", 'siret'=>"17860111800494", 'dep'=>"86"),
|
||||
'ROCROI' => array('nom'=>"TI ROCROI", 'siret'=>"17510111200332", 'dep'=>"82"),
|
||||
'ROCROI' => array('nom'=>"TI ROCROI", 'siret'=>"17510111200332", 'dep'=>"08"),
|
||||
'MARENI' => array('nom'=>"TI MARENNES", 'siret'=>"17860111800080", 'dep'=>"17"),
|
||||
'JONZAI' => array('nom'=>"TI JONZAC", 'siret'=>"17860111800098", 'dep'=>"17"),
|
||||
'SAINTI' => array('nom'=>"TI SAINT AMAND MONTROND", 'siret'=>"17180111100070", 'dep'=>"18"),
|
||||
@ -875,11 +875,11 @@ return array(
|
||||
'MELUNI' => array('nom'=>"TI MELUN", 'siret'=>"17750111100211", 'dep'=>"77"),
|
||||
'TROYEI' => array('nom'=>"TI TROYES", 'siret'=>"17510111200266", 'dep'=>"10"),
|
||||
'HAVREI' => array('nom'=>"TI LE HAVRE", 'siret'=>"17760111900320", 'dep'=>"76"),
|
||||
'GANNAI' => array('nom'=>"TI GANNAT", 'siret'=>"17630111700345", 'dep'=>"38"),
|
||||
'GANNAI' => array('nom'=>"TI GANNAT", 'siret'=>"17630111700345", 'dep'=>"03"),
|
||||
'BASTII' => array('nom'=>"TI BASTIA", 'siret'=>"17202111500131", 'dep'=>"20"),
|
||||
'BRIANI' => array('nom'=>"TI BRIANCON", 'siret'=>"17380111900251", 'dep'=>"51"),
|
||||
'BRIANI' => array('nom'=>"TI BRIANCON", 'siret'=>"17380111900251", 'dep'=>"05"),
|
||||
'CORTEI' => array('nom'=>"TI CORTE", 'siret'=>"17202111500149", 'dep'=>"20"),
|
||||
'GAPI' => array('nom'=>"TI GAP", 'siret'=>"17380111900285", 'dep'=>"50"),
|
||||
'GAPI' => array('nom'=>"TI GAP", 'siret'=>"17380111900285", 'dep'=>"05"),
|
||||
'LAROCI' => array('nom'=>"TI LA ROCHE SUR YON", 'siret'=>"17860111800239", 'dep'=>"85"),
|
||||
'MONTMI' => array('nom'=>"TI MONTMORILLON", 'siret'=>"17860111800064", 'dep'=>"86"),
|
||||
'CONFOI' => array('nom'=>"TI CONFOLENS", 'siret'=>"17330111000396", 'dep'=>"16"),
|
||||
@ -890,7 +890,7 @@ return array(
|
||||
'AJACCI' => array('nom'=>"TI AJACCIO", 'siret'=>"17202111500115", 'dep'=>"20"),
|
||||
'VANVEI' => array('nom'=>"TI VANVES", 'siret'=>"17780111500342", 'dep'=>"92"),
|
||||
'VERSAI' => array('nom'=>"TI VERSAILLES", 'siret'=>"17780111500458", 'dep'=>"78"),
|
||||
'VERVII' => array('nom'=>"TI VERVINS", 'siret'=>"17800111100388", 'dep'=>"21"),
|
||||
'VERVII' => array('nom'=>"TI VERVINS", 'siret'=>"17800111100388", 'dep'=>"02"),
|
||||
'VIERZI' => array('nom'=>"TI VIERZON", 'siret'=>"17180111100195", 'dep'=>"18"),
|
||||
'VIREI' => array('nom'=>"TI VIRE", 'siret'=>"17140111000506", 'dep'=>"14"),
|
||||
'WISSEI' => array('nom'=>"TI WISSEMBOURG", 'siret'=>"17680111600144", 'dep'=>"67"),
|
||||
@ -898,7 +898,7 @@ return array(
|
||||
'LEPUYI' => array('nom'=>"TI PUY EN VELAY", 'siret'=>"17630111700428", 'dep'=>"43"),
|
||||
'LERAII' => array('nom'=>"TI LE RAINCY", 'siret'=>"17750111100997", 'dep'=>"93"),
|
||||
'MARTII' => array('nom'=>"TI MARTIGUES", 'siret'=>"17130111200123", 'dep'=>"13"),
|
||||
'MENTOI' => array('nom'=>"TI MENTON", 'siret'=>"17130111200347", 'dep'=>"65"),
|
||||
'MENTOI' => array('nom'=>"TI MENTON", 'siret'=>"17130111200347", 'dep'=>"06"),
|
||||
'MONTRI' => array('nom'=>"TI MONTREUIL SOUS BOIS", 'siret'=>"17750111100542", 'dep'=>"93"),
|
||||
'NEUILI' => array('nom'=>"TI NEUILLY SUR SEINE", 'siret'=>"17780111500326", 'dep'=>"92"),
|
||||
'PANTII' => array('nom'=>"TI PANTIN", 'siret'=>"17750111101052", 'dep'=>"93"),
|
||||
@ -916,22 +916,22 @@ return array(
|
||||
'MONTCI' => array('nom'=>"TI MONTCEAU LES MINES", 'siret'=>"17210111500100", 'dep'=>"71"),
|
||||
'NAZAII' => array('nom'=>"TI SAINT NAZAIRE", 'siret'=>"17350111500724", 'dep'=>"44"),
|
||||
'SEVERI' => array('nom'=>"TI SAINT SEVER", 'siret'=>"17640111500231", 'dep'=>"40"),
|
||||
'BBRESI' => array('nom'=>"TI BOURG EN BRESSE", 'siret'=>"17690111400486", 'dep'=>"10"),
|
||||
'BBRESI' => array('nom'=>"TI BOURG EN BRESSE", 'siret'=>"17690111400486", 'dep'=>"01"),
|
||||
'YSSINI' => array('nom'=>"TI YSSINGEAUX", 'siret'=>"17630111700469", 'dep'=>"43"),
|
||||
'TREVOI' => array('nom'=>"TI TREVOUX", 'siret'=>"17690111400494", 'dep'=>"16"),
|
||||
'TREVOI' => array('nom'=>"TI TREVOUX", 'siret'=>"17690111400494", 'dep'=>"01"),
|
||||
'ROMANI' => array('nom'=>"TI ROMANS SUR ISERE", 'siret'=>"17380111900384", 'dep'=>"26"),
|
||||
'LECHAI' => array('nom'=>"TI LE CHAMBON FEUGEROLLES", 'siret'=>"17690111400544", 'dep'=>"42"),
|
||||
'CHINOI' => array('nom'=>"TI CHATEAU CHINON", 'siret'=>"17180111100369", 'dep'=>"58"),
|
||||
'FUMAYI' => array('nom'=>"TI FUMAY", 'siret'=>"17510111200464", 'dep'=>"81"),
|
||||
'FUMAYI' => array('nom'=>"TI FUMAY", 'siret'=>"17510111200464", 'dep'=>"08"),
|
||||
'NEVERI' => array('nom'=>"TI NEVERS", 'siret'=>"17180111100377", 'dep'=>"58"),
|
||||
'ANGOUI' => array('nom'=>"TI ANGOULEME", 'siret'=>"17330111000099", 'dep'=>"16"),
|
||||
'AMBERI' => array('nom'=>"TI AMBERT", 'siret'=>"17630111700022", 'dep'=>"63"),
|
||||
'AURILI' => array('nom'=>"TI AURILLAC", 'siret'=>"17630111700394", 'dep'=>"15"),
|
||||
'BARSUI' => array('nom'=>"TI BAR SUR AUBE", 'siret'=>"17510111200357", 'dep'=>"10"),
|
||||
'BELLEI' => array('nom'=>"TI BELLEY", 'siret'=>"17690111400502", 'dep'=>"13"),
|
||||
'BELLEI' => array('nom'=>"TI BELLEY", 'siret'=>"17690111400502", 'dep'=>"01"),
|
||||
'BRIEYI' => array('nom'=>"TI BRIEY", 'siret'=>"17540111600066", 'dep'=>"54"),
|
||||
'CHALOI' => array('nom'=>"TI CHALONS EN CHAMPAGNE", 'siret'=>"17510111200225", 'dep'=>"51"),
|
||||
'CHARLI' => array('nom'=>"TI CHARLEVILLE MEZIERES", 'siret'=>"17510111200324", 'dep'=>"80"),
|
||||
'CHARLI' => array('nom'=>"TI CHARLEVILLE MEZIERES", 'siret'=>"17510111200324", 'dep'=>"08"),
|
||||
'VILLFI' => array('nom'=>"TI VILLEFRANCHE SUR SAONE", 'siret'=>"17690111400510", 'dep'=>"69"),
|
||||
'BRIOUI' => array('nom'=>"TI BRIOUDE", 'siret'=>"17630111700527", 'dep'=>"43"),
|
||||
'CROUXI' => array('nom'=>"TI CHATEAUROUX", 'siret'=>"17180111100138", 'dep'=>"36"),
|
||||
@ -947,8 +947,8 @@ return array(
|
||||
'LYONI' => array('nom'=>"TI LYON 3EME", 'siret'=>"17690111400437", 'dep'=>"69"),
|
||||
'MAURII' => array('nom'=>"TI MAURIAC", 'siret'=>"17630111700436", 'dep'=>"15"),
|
||||
'MONTEI' => array('nom'=>"TI MONTELIMAR", 'siret'=>"17380111900301", 'dep'=>"26"),
|
||||
'MONTLI' => array('nom'=>"TI MONTLUCON", 'siret'=>"17630111700261", 'dep'=>"31"),
|
||||
'MOULII' => array('nom'=>"TI MOULINS", 'siret'=>"17630111700451", 'dep'=>"30"),
|
||||
'MONTLI' => array('nom'=>"TI MONTLUCON", 'siret'=>"17630111700261", 'dep'=>"03"),
|
||||
'MOULII' => array('nom'=>"TI MOULINS", 'siret'=>"17630111700451", 'dep'=>"03"),
|
||||
'MARSAI' => array('nom'=>"TI MONT DE MARSAN", 'siret'=>"17640111500173", 'dep'=>"40"),
|
||||
'MURATI' => array('nom'=>"TI MURAT", 'siret'=>"17630111700105", 'dep'=>"15"),
|
||||
'NANCYI' => array('nom'=>"TI NANCY", 'siret'=>"17540111600108", 'dep'=>"54"),
|
||||
@ -956,17 +956,17 @@ return array(
|
||||
'NOGENI' => array('nom'=>"TI NOGENT SUR SEINE", 'siret'=>"17510111200308", 'dep'=>"10"),
|
||||
'NEUFCI' => array('nom'=>"TI NEUFCHATEAU", 'siret'=>"17540111600363", 'dep'=>"88"),
|
||||
'REIMSI' => array('nom'=>"TI REIMS", 'siret'=>"17510111200241", 'dep'=>"51"),
|
||||
'RETHEI' => array('nom'=>"TI RETHEL", 'siret'=>"17510111200316", 'dep'=>"83"),
|
||||
'RETHEI' => array('nom'=>"TI RETHEL", 'siret'=>"17510111200316", 'dep'=>"08"),
|
||||
'RIOMI' => array('nom'=>"TI RIOM", 'siret'=>"17630111700311", 'dep'=>"63"),
|
||||
'ROANNI' => array('nom'=>"TI ROANNE", 'siret'=>"17690111400163", 'dep'=>"42"),
|
||||
'FLOURI' => array('nom'=>"TI SAINT FLOUR", 'siret'=>"17630111700444", 'dep'=>"15"),
|
||||
'THIERI' => array('nom'=>"TI THIERS", 'siret'=>"17630111700329", 'dep'=>"63"),
|
||||
'THONOI' => array('nom'=>"TI THONON LES BAINS", 'siret'=>"17730111600287", 'dep'=>"74"),
|
||||
'VICHYI' => array('nom'=>"TI VICHY", 'siret'=>"17630111700287", 'dep'=>"32"),
|
||||
'VICHYI' => array('nom'=>"TI VICHY", 'siret'=>"17630111700287", 'dep'=>"03"),
|
||||
'VIENNI' => array('nom'=>"TI VIENNE", 'siret'=>"17380111900236", 'dep'=>"38"),
|
||||
'VBANNI' => array('nom'=>"TI VILLEURBANNE", 'siret'=>"17690111400346", 'dep'=>"69"),
|
||||
'VITRYI' => array('nom'=>"TI VITRY LE FRANCOIS", 'siret'=>"17510111200217", 'dep'=>"51"),
|
||||
'VOUZII' => array('nom'=>"TI VOUZIERS", 'siret'=>"17510111200340", 'dep'=>"84"),
|
||||
'VOUZII' => array('nom'=>"TI VOUZIERS", 'siret'=>"17510111200340", 'dep'=>"08"),
|
||||
'ALESI' => array('nom'=>"TI ALES", 'siret'=>"17300111600305", 'dep'=>"30"),
|
||||
'APTI' => array('nom'=>"TI APT", 'siret'=>"17300111600370", 'dep'=>"84"),
|
||||
'OLONNI' => array('nom'=>"TI DES SABLES D'OLONNE", 'siret'=>"17860111800635", 'dep'=>"85"),
|
||||
@ -981,12 +981,12 @@ return array(
|
||||
'DIJONI' => array('nom'=>"TI DIJON", 'siret'=>"17210111500472", 'dep'=>"21"),
|
||||
'MAYENI' => array('nom'=>"TI MAYENNE", 'siret'=>"17490111600296", 'dep'=>"53"),
|
||||
'GONTII' => array('nom'=>"TI CHATEAU GONTIER", 'siret'=>"17490111600288", 'dep'=>"53"),
|
||||
'MANOSI' => array('nom'=>"TI MANOSQUE", 'siret'=>"17130111200453", 'dep'=>"41"),
|
||||
'FORCAI' => array('nom'=>"TI FORCALQUIER", 'siret'=>"17130111200446", 'dep'=>"41"),
|
||||
'TOURNI' => array('nom'=>"TI TOURNON SUR RHONE", 'siret'=>"17300111600065", 'dep'=>"73"),
|
||||
'FOIXI' => array('nom'=>"TI FOIX", 'siret'=>"17310111400192", 'dep'=>"90"),
|
||||
'PAMIEI' => array('nom'=>"TI PAMIERS", 'siret'=>"17310111400184", 'dep'=>"91"),
|
||||
'GIRONI' => array('nom'=>"TI SAINT GIRONS", 'siret'=>"17310111400317", 'dep'=>"92"),
|
||||
'MANOSI' => array('nom'=>"TI MANOSQUE", 'siret'=>"17130111200453", 'dep'=>"04"),
|
||||
'FORCAI' => array('nom'=>"TI FORCALQUIER", 'siret'=>"17130111200446", 'dep'=>"04"),
|
||||
'TOURNI' => array('nom'=>"TI TOURNON SUR RHONE", 'siret'=>"17300111600065", 'dep'=>"07"),
|
||||
'FOIXI' => array('nom'=>"TI FOIX", 'siret'=>"17310111400192", 'dep'=>"09"),
|
||||
'PAMIEI' => array('nom'=>"TI PAMIERS", 'siret'=>"17310111400184", 'dep'=>"09"),
|
||||
'GIRONI' => array('nom'=>"TI SAINT GIRONS", 'siret'=>"17310111400317", 'dep'=>"09"),
|
||||
'ROUERI' => array('nom'=>"TI VILLEFRANCHE DE ROUERGUE", 'siret'=>"17340111800240", 'dep'=>"12"),
|
||||
'AFFRII' => array('nom'=>"TI SAINT AFFRIQUE", 'siret'=>"17340111800273", 'dep'=>"12"),
|
||||
'ESPALI' => array('nom'=>"TI ESPALION", 'siret'=>"17340111800125", 'dep'=>"12"),
|
||||
@ -1070,7 +1070,7 @@ return array(
|
||||
'LOUHAI' => array('nom'=>"TI LOUHANS", 'siret'=>"17210111500407", 'dep'=>"71"),
|
||||
'FONTEI' => array('nom'=>"TI FONTENAY LE COMTE", 'siret'=>"17860111800403", 'dep'=>"85"),
|
||||
'BELFOI' => array('nom'=>"TI BELFORT", 'siret'=>"17250111600310", 'dep'=>"90"),
|
||||
'CAGNEI' => array('nom'=>"TI CAGNES SUR MER", 'siret'=>"17130111200719", 'dep'=>"68"),
|
||||
'CAGNEI' => array('nom'=>"TI CAGNES SUR MER", 'siret'=>"17130111200719", 'dep'=>"06"),
|
||||
'AGENI' => array('nom'=>"TI AGEN", 'siret'=>"17470111000218", 'dep'=>"47"),
|
||||
'MARMAI' => array('nom'=>"TI MARMANDE", 'siret'=>"17470111000226", 'dep'=>"47"),
|
||||
'VILOTI' => array('nom'=>"TI VILLENEUVE SUR LOT", 'siret'=>"17470111000242", 'dep'=>"47"),
|
||||
@ -1078,7 +1078,7 @@ return array(
|
||||
'PAUI' => array('nom'=>"TI PAU", 'siret'=>"17640111500215", 'dep'=>"64"),
|
||||
'LILLEI' => array('nom'=>"TI LILLE", 'siret'=>"17590111500717", 'dep'=>"59"),
|
||||
'ARRASI' => array('nom'=>"TI ARRAS", 'siret'=>"17590111500808", 'dep'=>"62"),
|
||||
'LARGEI' => array('nom'=>"TI LARGENTIERE", 'siret'=>"17300111600255", 'dep'=>"71"),
|
||||
'LARGEI' => array('nom'=>"TI LARGENTIERE", 'siret'=>"17300111600255", 'dep'=>"07"),
|
||||
'MANSI' => array('nom'=>"TI LE MANS", 'siret'=>"17490111600361", 'dep'=>"72"),
|
||||
'ST LOI' => array('nom'=>"TI SAINT LO", 'siret'=>"17140111000324", 'dep'=>"50"),
|
||||
'AVRAI' => array('nom'=>"TI AVRANCHES", 'siret'=>"17140111000233", 'dep'=>"50"),
|
||||
@ -1092,13 +1092,13 @@ return array(
|
||||
'SETEI' => array('nom'=>"TI SETE", 'siret'=>"17340111800430", 'dep'=>"34"),
|
||||
'CERETI' => array('nom'=>"TI CERET", 'siret'=>"17340111800471", 'dep'=>"66"),
|
||||
'PRADEI' => array('nom'=>"TI PRADES", 'siret'=>"17340111800463", 'dep'=>"66"),
|
||||
'DIGNEI' => array('nom'=>"TI DIGNE", 'siret'=>"17130111200727", 'dep'=>"40"),
|
||||
'DIGNEI' => array('nom'=>"TI DIGNE", 'siret'=>"17130111200727", 'dep'=>"04"),
|
||||
'SPAULI' => array('nom'=>"TI SAINT PAUL", 'siret'=>"17974111100076", 'dep'=>"978"),
|
||||
'BENOII' => array('nom'=>"TI SAINT BENOIT", 'siret'=>"17974111100084", 'dep'=>"974"),
|
||||
'MIRECI' => array('nom'=>"TI MIRECOURT", 'siret'=>"17540111600397", 'dep'=>"88"),
|
||||
'MIHIEI' => array('nom'=>"TI SAINT MIHIEL", 'siret'=>"17540111600405", 'dep'=>"55"),
|
||||
'YRIEXI' => array('nom'=>"TI SAINT YRIEIX LA PERCHE", 'siret'=>"17870111600265", 'dep'=>"87"),
|
||||
'BARCEI' => array('nom'=>"TI BARCELONNETTE", 'siret'=>"17130111200743", 'dep'=>"44"),
|
||||
'BARCEI' => array('nom'=>"TI BARCELONNETTE", 'siret'=>"17130111200743", 'dep'=>"04"),
|
||||
'LUNEVI' => array('nom'=>"TI LUNEVILLE", 'siret'=>"17540111600421", 'dep'=>"54"),
|
||||
'REMIRI' => array('nom'=>"TI REMIREMONT", 'siret'=>"17540111600439", 'dep'=>"88"),
|
||||
'ALENCI' => array('nom'=>"TI ALENCON", 'siret'=>"17140111000381", 'dep'=>"61"),
|
||||
@ -1113,14 +1113,14 @@ return array(
|
||||
'MEAUXI' => array('nom'=>"TI MEAUX", 'siret'=>"17750111101250", 'dep'=>"77"),
|
||||
'AUBAGI' => array('nom'=>"TI AUBAGNE", 'siret'=>"17130111200339", 'dep'=>"13"),
|
||||
'BRIGNI' => array('nom'=>"TI BRIGNOLES", 'siret'=>"17130111200545", 'dep'=>"83"),
|
||||
'CANNEI' => array('nom'=>"TI CANNES", 'siret'=>"17130111200362", 'dep'=>"64"),
|
||||
'CANNEI' => array('nom'=>"TI CANNES", 'siret'=>"17130111200362", 'dep'=>"06"),
|
||||
'ABBEVI' => array('nom'=>"TI ABBEVILLE", 'siret'=>"17800111100396", 'dep'=>"80"),
|
||||
'AIXLEI' => array('nom'=>"TI AIX LES BAINS", 'siret'=>"17730111600253", 'dep'=>"73"),
|
||||
'ALTKII' => array('nom'=>"TI ALTKIRCH", 'siret'=>"17680111600094", 'dep'=>"68"),
|
||||
'AMIENI' => array('nom'=>"TI AMIENS", 'siret'=>"17800111100404", 'dep'=>"80"),
|
||||
'ANNECI' => array('nom'=>"TI ANNECY", 'siret'=>"17730111600154", 'dep'=>"74"),
|
||||
'ANNEMI' => array('nom'=>"TI ANNEMASSE", 'siret'=>"17730111600303", 'dep'=>"74"),
|
||||
'ANTIBI' => array('nom'=>"TI ANTIBES", 'siret'=>"17130111200354", 'dep'=>"66"),
|
||||
'ANTIBI' => array('nom'=>"TI ANTIBES", 'siret'=>"17130111200354", 'dep'=>"06"),
|
||||
'ANTONI' => array('nom'=>"TI ANTONY", 'siret'=>"17780111500250", 'dep'=>"92"),
|
||||
'ARGENI' => array('nom'=>"TI ARGENTAN", 'siret'=>"17140111000357", 'dep'=>"61"),
|
||||
'ARLESI' => array('nom'=>"TI ARLES", 'siret'=>"17130111200115", 'dep'=>"13"),
|
||||
@ -1146,7 +1146,7 @@ return array(
|
||||
'BOBIGI' => array('nom'=>"TI BOBIGNY", 'siret'=>"17750111101086", 'dep'=>"93"),
|
||||
'BOULOI' => array('nom'=>"TI BOULOGNE BILLANCOURT", 'siret'=>"17780111500276", 'dep'=>"92"),
|
||||
'BRUMAI' => array('nom'=>"TI BRUMATH", 'siret'=>"17680111600250", 'dep'=>"67"),
|
||||
'CTHIEI' => array('nom'=>"TI CHATEAU THIERRY", 'siret'=>"17800111100362", 'dep'=>"24"),
|
||||
'CTHIEI' => array('nom'=>"TI CHATEAU THIERRY", 'siret'=>"17800111100362", 'dep'=>"02"),
|
||||
'CHINNI' => array('nom'=>"TI CHINON", 'siret'=>"17450111400253", 'dep'=>"37"),
|
||||
'CLEROI' => array('nom'=>"TI CLERMONT", 'siret'=>"17800111100461", 'dep'=>"60"),
|
||||
'CLICHI' => array('nom'=>"TI CLICHY", 'siret'=>"17780111500284", 'dep'=>"92"),
|
||||
@ -1160,13 +1160,13 @@ return array(
|
||||
'FREJUI' => array('nom'=>"TI FREJUS", 'siret'=>"17130111200560", 'dep'=>"83"),
|
||||
'GIENI' => array('nom'=>"TI GIEN", 'siret'=>"17450111400188", 'dep'=>"45"),
|
||||
'GONESI' => array('nom'=>"TI GONESSE", 'siret'=>"17780111500227", 'dep'=>"95"),
|
||||
'GRASSI' => array('nom'=>"TI GRASSE", 'siret'=>"17130111200370", 'dep'=>"61"),
|
||||
'GRASSI' => array('nom'=>"TI GRASSE", 'siret'=>"17130111200370", 'dep'=>"06"),
|
||||
'GRENOI' => array('nom'=>"TI GRENOBLE", 'siret'=>"17380111900038", 'dep'=>"38"),
|
||||
'GUEBWI' => array('nom'=>"TI GUEBWILLER", 'siret'=>"17680111600086", 'dep'=>"68"),
|
||||
'HAGUEI' => array('nom'=>"TI HAGUENAU", 'siret'=>"17680111600219", 'dep'=>"67"),
|
||||
'HUNINI' => array('nom'=>"TI HUNINGUE", 'siret'=>"17680111600060", 'dep'=>"68"),
|
||||
'JUVISI' => array('nom'=>"TI JUVISY SUR ORGE", 'siret'=>"17750111100898", 'dep'=>"91"),
|
||||
'LAONI' => array('nom'=>"TI LAON", 'siret'=>"17800111100446", 'dep'=>"20"),
|
||||
'LAONI' => array('nom'=>"TI LAON", 'siret'=>"17800111100446", 'dep'=>"02"),
|
||||
'LEVALI' => array('nom'=>"TI LEVALLOIS PERRET", 'siret'=>"17780111500300", 'dep'=>"92"),
|
||||
'LISIEI' => array('nom'=>"TI LISIEUX", 'siret'=>"17140111000399", 'dep'=>"14"),
|
||||
'LOCHEI' => array('nom'=>"TI LOCHES", 'siret'=>"17450111400246", 'dep'=>"37"),
|
||||
@ -1185,9 +1185,9 @@ return array(
|
||||
'SEGREI' => array('nom'=>"TI SEGRE", 'siret'=>"17490111600387", 'dep'=>"49"),
|
||||
'SELESI' => array('nom'=>"TI SELESTAT", 'siret'=>"17680111600177", 'dep'=>"67"),
|
||||
'SENLII' => array('nom'=>"TI SENLIS", 'siret'=>"17800111100479", 'dep'=>"60"),
|
||||
'SOISSI' => array('nom'=>"TI SOISSONS", 'siret'=>"17800111100370", 'dep'=>"22"),
|
||||
'SOISSI' => array('nom'=>"TI SOISSONS", 'siret'=>"17800111100370", 'dep'=>"02"),
|
||||
'SPALAI' => array('nom'=>"TI SAINT PALAIS", 'siret'=>"17640111500223", 'dep'=>"64"),
|
||||
'SQUENI' => array('nom'=>"TI SAINT QUENTIN", 'siret'=>"17800111100438", 'dep'=>"23"),
|
||||
'SQUENI' => array('nom'=>"TI SAINT QUENTIN", 'siret'=>"17800111100438", 'dep'=>"02"),
|
||||
'THANNI' => array('nom'=>"TI THANN", 'siret'=>"17680111600037", 'dep'=>"68"),
|
||||
'TOULNI' => array('nom'=>"TI TOULON", 'siret'=>"17130111200578", 'dep'=>"83"),
|
||||
'TOURSI' => array('nom'=>"TI TOURS", 'siret'=>"17450111400220", 'dep'=>"37"),
|
||||
@ -1254,7 +1254,7 @@ return array(
|
||||
'BOBIGE' => array('nom'=>"Tribunal pour Enfants de Bobigny", 'siret'=>"", 'dep'=>"93"),
|
||||
'BORDEE' => array('nom'=>"Tribunal pour Enfants de Bordeaux", 'siret'=>"", 'dep'=>"33"),
|
||||
'BOULOE' => array('nom'=>"Tribunal pour Enfants de Boulogne-Sur-Mer", 'siret'=>"", 'dep'=>"62"),
|
||||
'BOURGE' => array('nom'=>"Tribunal pour Enfants de Bourg-en-Bresse", 'siret'=>"", 'dep'=>"10"),
|
||||
'BOURGE' => array('nom'=>"Tribunal pour Enfants de Bourg-en-Bresse", 'siret'=>"", 'dep'=>"01"),
|
||||
'BOURHE' => array('nom'=>"Tribunal pour Enfants de Bourges", 'siret'=>"", 'dep'=>"18"),
|
||||
'JALLIE' => array('nom'=>"Tribunal pour Enfants de Bourgoin-Jallieu", 'siret'=>"", 'dep'=>"38"),
|
||||
'BRESTE' => array('nom'=>"Tribunal pour Enfants de Brest", 'siret'=>"", 'dep'=>"29"),
|
||||
@ -1270,7 +1270,7 @@ return array(
|
||||
'CHALOE' => array('nom'=>"Tribunal pour Enfants de Châlons-en-Champagne", 'siret'=>"", 'dep'=>"51"),
|
||||
'CHALSE' => array('nom'=>"Tribunal pour Enfants de Chalon-sur-Saône", 'siret'=>"", 'dep'=>"71"),
|
||||
'CHAMBE' => array('nom'=>"Tribunal pour Enfants de Chambéry", 'siret'=>"", 'dep'=>"73"),
|
||||
'CHARLE' => array('nom'=>"Tribunal pour Enfants de Charleville-Mézières", 'siret'=>"", 'dep'=>"80"),
|
||||
'CHARLE' => array('nom'=>"Tribunal pour Enfants de Charleville-Mézières", 'siret'=>"", 'dep'=>"08"),
|
||||
'CHARTE' => array('nom'=>"Tribunal pour Enfants de Chartres", 'siret'=>"", 'dep'=>"28"),
|
||||
'CHATEE' => array('nom'=>"Tribunal pour Enfants de Châteauroux", 'siret'=>"", 'dep'=>"36"),
|
||||
'CHAUME' => array('nom'=>"Tribunal pour Enfants de Chaumont", 'siret'=>"", 'dep'=>"52"),
|
||||
@ -1282,20 +1282,20 @@ return array(
|
||||
'CRETEE' => array('nom'=>"Tribunal pour Enfants de Créteil", 'siret'=>"", 'dep'=>"94"),
|
||||
'DAXE' => array('nom'=>"Tribunal pour Enfants de Dax", 'siret'=>"", 'dep'=>"40"),
|
||||
'DIEPPE' => array('nom'=>"Tribunal pour Enfants de Dieppe", 'siret'=>"", 'dep'=>"76"),
|
||||
'DIGNEE' => array('nom'=>"Tribunal pour Enfants de Digne-les-Bains", 'siret'=>"", 'dep'=>"40"),
|
||||
'DIGNEE' => array('nom'=>"Tribunal pour Enfants de Digne-les-Bains", 'siret'=>"", 'dep'=>"04"),
|
||||
'DIJONE' => array('nom'=>"Tribunal pour Enfants de Dijon", 'siret'=>"", 'dep'=>"21"),
|
||||
'DOUAIE' => array('nom'=>"Tribunal pour Enfants de Douai", 'siret'=>"", 'dep'=>"59"),
|
||||
'DRAGUE' => array('nom'=>"Tribunal pour Enfants de Draguignan", 'siret'=>"", 'dep'=>"83"),
|
||||
'DUNKEE' => array('nom'=>"Tribunal pour Enfants de Dunkerque", 'siret'=>"", 'dep'=>"59"),
|
||||
'FOIXE' => array('nom'=>"Tribunal pour Enfants de Foix", 'siret'=>"", 'dep'=>"90"),
|
||||
'FOIXE' => array('nom'=>"Tribunal pour Enfants de Foix", 'siret'=>"", 'dep'=>"09"),
|
||||
'FORTDE' => array('nom'=>"Tribunal pour Enfants de Fort-de-France", 'siret'=>"", 'dep'=>"972"),
|
||||
'GAPE' => array('nom'=>"Tribunal pour Enfants de Gap", 'siret'=>"", 'dep'=>"50"),
|
||||
'GRASSE' => array('nom'=>"Tribunal pour Enfants de Grasse", 'siret'=>"", 'dep'=>"61"),
|
||||
'GAPE' => array('nom'=>"Tribunal pour Enfants de Gap", 'siret'=>"", 'dep'=>"05"),
|
||||
'GRASSE' => array('nom'=>"Tribunal pour Enfants de Grasse", 'siret'=>"", 'dep'=>"06"),
|
||||
'GRENOE' => array('nom'=>"Tribunal pour Enfants de Grenoble", 'siret'=>"", 'dep'=>"38"),
|
||||
'GUEREE' => array('nom'=>"Tribunal pour Enfants de Guéret", 'siret'=>"", 'dep'=>"23"),
|
||||
'GUINGE' => array('nom'=>"Tribunal pour Enfants de Guingamp", 'siret'=>"", 'dep'=>"22"),
|
||||
'LAROCE' => array('nom'=>"Tribunal pour Enfants de La Rochelle", 'siret'=>"", 'dep'=>"17"),
|
||||
'LAONE' => array('nom'=>"Tribunal pour Enfants de Laon", 'siret'=>"", 'dep'=>"20"),
|
||||
'LAONE' => array('nom'=>"Tribunal pour Enfants de Laon", 'siret'=>"", 'dep'=>"02"),
|
||||
'LAVALE' => array('nom'=>"Tribunal pour Enfants de Laval", 'siret'=>"", 'dep'=>"53"),
|
||||
'LIBOUE' => array('nom'=>"Tribunal pour Enfants de Libourne", 'siret'=>"", 'dep'=>"33"),
|
||||
'LILLEE' => array('nom'=>"Tribunal pour Enfants de Lille", 'siret'=>"", 'dep'=>"59"),
|
||||
@ -1315,13 +1315,13 @@ return array(
|
||||
'MONTBE' => array('nom'=>"Tribunal pour Enfants de Montbéliard", 'siret'=>"", 'dep'=>"25"),
|
||||
'MONTDE' => array('nom'=>"Tribunal pour Enfants de Mont-de-Marsan", 'siret'=>"", 'dep'=>"40"),
|
||||
'MONTPE' => array('nom'=>"Tribunal pour Enfants de Montpellier", 'siret'=>"", 'dep'=>"34"),
|
||||
'MOULIE' => array('nom'=>"Tribunal pour Enfants de Moulins", 'siret'=>"", 'dep'=>"30"),
|
||||
'MOULIE' => array('nom'=>"Tribunal pour Enfants de Moulins", 'siret'=>"", 'dep'=>"03"),
|
||||
'MULHOE' => array('nom'=>"Tribunal pour Enfants de Mulhouse", 'siret'=>"", 'dep'=>"68"),
|
||||
'NANCYE' => array('nom'=>"Tribunal pour Enfants de Nancy", 'siret'=>"", 'dep'=>"54"),
|
||||
'NANTEE' => array('nom'=>"Tribunal pour Enfants de Nanterre", 'siret'=>"", 'dep'=>"92"),
|
||||
'NARBOE' => array('nom'=>"Tribunal pour Enfants de Narbonne", 'siret'=>"", 'dep'=>"11"),
|
||||
'NEVERE' => array('nom'=>"Tribunal pour Enfants de Nevers", 'siret'=>"", 'dep'=>"58"),
|
||||
'NICEE' => array('nom'=>"Tribunal pour Enfants de Nice", 'siret'=>"", 'dep'=>"63"),
|
||||
'NICEE' => array('nom'=>"Tribunal pour Enfants de Nice", 'siret'=>"", 'dep'=>"06"),
|
||||
'NIMESE' => array('nom'=>"Tribunal pour Enfants de Nîmes", 'siret'=>"", 'dep'=>"30"),
|
||||
'NIORTE' => array('nom'=>"Tribunal pour Enfants de Niort", 'siret'=>"", 'dep'=>"79"),
|
||||
'NOUMEE' => array('nom'=>"Tribunal pour Enfants de Nouméa", 'siret'=>"", 'dep'=>"988"),
|
||||
@ -1333,7 +1333,7 @@ return array(
|
||||
'POINTE' => array('nom'=>"Tribunal pour Enfants de Pointe-à-Pitre", 'siret'=>"", 'dep'=>"971"),
|
||||
'POITIE' => array('nom'=>"Tribunal pour Enfants de Poitiers", 'siret'=>"", 'dep'=>"86"),
|
||||
'CERGYE' => array('nom'=>"Tribunal pour Enfants de Pontoise", 'siret'=>"", 'dep'=>"95"),
|
||||
'PRIVAE' => array('nom'=>"Tribunal pour Enfants de Privas", 'siret'=>"", 'dep'=>"70"),
|
||||
'PRIVAE' => array('nom'=>"Tribunal pour Enfants de Privas", 'siret'=>"", 'dep'=>"07"),
|
||||
'QUIMPE' => array('nom'=>"Tribunal pour Enfants de Quimper", 'siret'=>"", 'dep'=>"29"),
|
||||
'REIMSE' => array('nom'=>"Tribunal pour Enfants de Reims", 'siret'=>"", 'dep'=>"51"),
|
||||
'RENNEE' => array('nom'=>"Tribunal pour Enfants de Rennes", 'siret'=>"", 'dep'=>"35"),
|
||||
@ -1348,7 +1348,7 @@ return array(
|
||||
'STNAZE' => array('nom'=>"Tribunal pour Enfants de Saint-Nazaire", 'siret'=>"", 'dep'=>"44"),
|
||||
'STOMEE' => array('nom'=>"Tribunal pour Enfants de Saint-Omer", 'siret'=>"", 'dep'=>"62"),
|
||||
'STPIEE' => array('nom'=>"Tribunal pour Enfants de Saint-Pierre", 'siret'=>"", 'dep'=>"974"),
|
||||
'STQUEE' => array('nom'=>"Tribunal pour Enfants de Saint-Quentin", 'siret'=>"", 'dep'=>"23"),
|
||||
'STQUEE' => array('nom'=>"Tribunal pour Enfants de Saint-Quentin", 'siret'=>"", 'dep'=>"02"),
|
||||
'SARREE' => array('nom'=>"Tribunal pour Enfants de Sarreguemines", 'siret'=>"", 'dep'=>"57"),
|
||||
'SAVERE' => array('nom'=>"Tribunal pour Enfants de Saverne", 'siret'=>"", 'dep'=>"67"),
|
||||
'SENLIE' => array('nom'=>"Tribunal pour Enfants de Senlis", 'siret'=>"", 'dep'=>"60"),
|
||||
@ -1471,7 +1471,7 @@ return array(
|
||||
'STPRMB' => array('nom'=>"SOUS PREFECTURE DE ST PIERRE", 'siret'=>"17972001600064", 'dep'=>"972"),
|
||||
'ETATV' => array('nom'=>"Conseil d'Etat", 'siret'=>"11000027000014", 'dep'=>"75"),
|
||||
'VERSAV' => array('nom'=>"Cour Administrative de Versailles", 'siret'=>"17780704700010", 'dep'=>"78"),
|
||||
'INCONU' => array('nom'=>"Tribunal Inconnu", 'siret'=>"", 'dep'=>"0"),
|
||||
'INCONU' => array('nom'=>"Tribunal Inconnu", 'siret'=>"", 'dep'=>"00"),
|
||||
'GUEREC' => array('nom'=>"TC GUERET", 'siret'=>"17870111600026", 'dep'=>"23"),
|
||||
'ANNECC' => array('nom'=>"TC ANNECY", 'siret'=>"17730111600063", 'dep'=>"74"),
|
||||
'THONOC' => array('nom'=>"TC THONON LES BAINS", 'siret'=>"17730111600089", 'dep'=>"74"),
|
||||
@ -1486,10 +1486,10 @@ return array(
|
||||
'DJOFFJ' => array('nom'=>"DIRECTION DES JOURNAUX OFFICIELS", 'siret'=>"16000102000017", 'dep'=>"75"),
|
||||
'FLERSI' => array('nom'=>"TI FLERS", 'siret'=>"17140111000845", 'dep'=>"61"),
|
||||
'MBARDI' => array('nom'=>"TI MONTBARD", 'siret'=>"17210111500746", 'dep'=>"21"),
|
||||
'AUBENI' => array('nom'=>"TI AUBENAS", 'siret'=>"17300111600636", 'dep'=>"72"),
|
||||
'ANNONI' => array('nom'=>"TI ANNONAY", 'siret'=>"17300111600644", 'dep'=>"71"),
|
||||
'AUBENI' => array('nom'=>"TI AUBENAS", 'siret'=>"17300111600636", 'dep'=>"07"),
|
||||
'ANNONI' => array('nom'=>"TI ANNONAY", 'siret'=>"17300111600644", 'dep'=>"07"),
|
||||
'PERTUI' => array('nom'=>"TI PERTUIS", 'siret'=>"17300111600651", 'dep'=>"84"),
|
||||
'SOISSE' => array('nom'=>"Tribunal pour Enfants de Soissons", 'siret'=>"17800111100800", 'dep'=>"22"),
|
||||
'SOISSE' => array('nom'=>"Tribunal pour Enfants de Soissons", 'siret'=>"17800111100800", 'dep'=>"02"),
|
||||
'BONNEE' => array('nom'=>"Tribunal pour Enfants de BONNEVILLE", 'siret'=>"17730111600519", 'dep'=>"74"),
|
||||
'ABBEVF' => array('nom'=>"JUGE DE PROXIMITE D'ABBEVILLE", 'siret'=>"17800111100396", 'dep'=>"80"),
|
||||
'AGENF' => array('nom'=>"JUGE DE PROXIMITE D'AGEN", 'siret'=>"17470111000218", 'dep'=>"47"),
|
||||
@ -1504,8 +1504,8 @@ return array(
|
||||
'ANGOUF' => array('nom'=>"JUGE DE PROXIMITE D'ANGOULEME", 'siret'=>"17330111000099", 'dep'=>"16"),
|
||||
'ANNECF' => array('nom'=>"JUGE DE PROXIMITE D'ANNECY", 'siret'=>"17730111600154", 'dep'=>"74"),
|
||||
'ANNEMF' => array('nom'=>"JUGE DE PROXIMITE D'ANNEMASSE", 'siret'=>"17730111600303", 'dep'=>"74"),
|
||||
'ANNONF' => array('nom'=>"JUGE DE PROXIMITE D'ANNONAY", 'siret'=>"17300111600644", 'dep'=>"71"),
|
||||
'ANTIBF' => array('nom'=>"JUGE DE PROXIMITE D'ANTIBES", 'siret'=>"17130111200354", 'dep'=>"66"),
|
||||
'ANNONF' => array('nom'=>"JUGE DE PROXIMITE D'ANNONAY", 'siret'=>"17300111600644", 'dep'=>"07"),
|
||||
'ANTIBF' => array('nom'=>"JUGE DE PROXIMITE D'ANTIBES", 'siret'=>"17130111200354", 'dep'=>"06"),
|
||||
'ANTONF' => array('nom'=>"JUGE DE PROXIMITE D'ANTONY", 'siret'=>"17780111500250", 'dep'=>"92"),
|
||||
'ARCACF' => array('nom'=>"JUGE DE PROXIMITE D'ARCACHON", 'siret'=>"17330111000024", 'dep'=>"33"),
|
||||
'ARGENF' => array('nom'=>"JUGE DE PROXIMITE D'ARGENTAN", 'siret'=>"17140111000357", 'dep'=>"61"),
|
||||
@ -1521,7 +1521,7 @@ return array(
|
||||
'BAYONF' => array('nom'=>"JUGE DE PROXIMITE DE BAYONNE", 'siret'=>"17640111500140", 'dep'=>"64"),
|
||||
'BEAUNF' => array('nom'=>"JUGE DE PROXIMITE DE BEAUNE", 'siret'=>"17210111500027", 'dep'=>"21"),
|
||||
'BEAUVF' => array('nom'=>"JUGE DE PROXIMITE DE BEAUVAIS", 'siret'=>"17800111100453", 'dep'=>"60"),
|
||||
'BELLEF' => array('nom'=>"JUGE DE PROXIMITE DE BELLEY", 'siret'=>"17690111400502", 'dep'=>"13"),
|
||||
'BELLEF' => array('nom'=>"JUGE DE PROXIMITE DE BELLEY", 'siret'=>"17690111400502", 'dep'=>"01"),
|
||||
'BERNAF' => array('nom'=>"JUGE DE PROXIMITE DE BERNAY", 'siret'=>"17760111900387", 'dep'=>"27"),
|
||||
'BESANF' => array('nom'=>"JUGE DE PROXIMITE DE BESANCON", 'siret'=>"17250111600211", 'dep'=>"25"),
|
||||
'BETHUF' => array('nom'=>"JUGE DE PROXIMITE DE BETHUNE", 'siret'=>"17590111500063", 'dep'=>"62"),
|
||||
@ -1533,7 +1533,7 @@ return array(
|
||||
'BORDEF' => array('nom'=>"JUGE DE PROXIMITE DE BORDEAUX", 'siret'=>"17330111000313", 'dep'=>"33"),
|
||||
'BOULOF' => array('nom'=>"JUGE DE PROXIMITE DE BOULOGNE BILLANCOURT", 'siret'=>"17780111500276", 'dep'=>"92"),
|
||||
'BSMERF' => array('nom'=>"JUGE DE PROXIMITE DE BOULOGNE SUR MER", 'siret'=>"17590111500105", 'dep'=>"62"),
|
||||
'BBRESF' => array('nom'=>"JUGE DE PROXIMITE DE BOURG EN BRESSE", 'siret'=>"17690111400486", 'dep'=>"10"),
|
||||
'BBRESF' => array('nom'=>"JUGE DE PROXIMITE DE BOURG EN BRESSE", 'siret'=>"17690111400486", 'dep'=>"01"),
|
||||
'BRGESF' => array('nom'=>"JUGE DE PROXIMITE DE BOURGES", 'siret'=>"17180111100187", 'dep'=>"18"),
|
||||
'BOURGF' => array('nom'=>"JUGE DE PROXIMITE DE BOURGOIN JALLIEU", 'siret'=>"17380111900103", 'dep'=>"38"),
|
||||
'BRESSF' => array('nom'=>"JUGE DE PROXIMITE DE BRESSUIRE", 'siret'=>"17860111800478", 'dep'=>"79"),
|
||||
@ -1542,11 +1542,11 @@ return array(
|
||||
'BRIGNF' => array('nom'=>"JUGE DE PROXIMITE DE BRIGNOLES", 'siret'=>"17130111200545", 'dep'=>"83"),
|
||||
'BRIVEF' => array('nom'=>"JUGE DE PROXIMITE DE BRIVE", 'siret'=>"17870111600190", 'dep'=>"19"),
|
||||
'CAENF' => array('nom'=>"JUGE DE PROXIMITE DE CAEN", 'siret'=>"17140111000456", 'dep'=>"14"),
|
||||
'CAGNEF' => array('nom'=>"JUGE DE PROXIMITE DE CAGNES SUR MER", 'siret'=>"17130111200719", 'dep'=>"68"),
|
||||
'CAGNEF' => array('nom'=>"JUGE DE PROXIMITE DE CAGNES SUR MER", 'siret'=>"17130111200719", 'dep'=>"06"),
|
||||
'CAHORF' => array('nom'=>"JUGE DE PROXIMITE DE CAHORS", 'siret'=>"17470111000028", 'dep'=>"46"),
|
||||
'CALAIF' => array('nom'=>"JUGE DE PROXIMITE DE CALAIS", 'siret'=>"17590111500121", 'dep'=>"62"),
|
||||
'CAMBRF' => array('nom'=>"JUGE DE PROXIMITE DE CAMBRAI", 'siret'=>"17590111500949", 'dep'=>"59"),
|
||||
'CANNEF' => array('nom'=>"JUGE DE PROXIMITE DE CANNES", 'siret'=>"17130111200362", 'dep'=>"64"),
|
||||
'CANNEF' => array('nom'=>"JUGE DE PROXIMITE DE CANNES", 'siret'=>"17130111200362", 'dep'=>"06"),
|
||||
'CARCAF' => array('nom'=>"JUGE DE PROXIMITE DE CARCASSONNE", 'siret'=>"17340111800364", 'dep'=>"11"),
|
||||
'CARPEF' => array('nom'=>"JUGE DE PROXIMITE DE CARPENTRAS", 'siret'=>"17300111600164", 'dep'=>"84"),
|
||||
'CASTEF' => array('nom'=>"JUGE DE PROXIMITE DE CASTELSARRASIN", 'siret'=>"17310111400135", 'dep'=>"82"),
|
||||
@ -1556,7 +1556,7 @@ return array(
|
||||
'CHALOF' => array('nom'=>"JUGE DE PROXIMITE DE CHALONS EN CHAMPAGNE", 'siret'=>"17510111200225", 'dep'=>"51"),
|
||||
'CHAMBF' => array('nom'=>"JUGE DE PROXIMITE DE CHAMBERY", 'siret'=>"17730111600113", 'dep'=>"73"),
|
||||
'CHAREF' => array('nom'=>"JUGE DE PROXIMITE DE CHARENTON LE PONT", 'siret'=>"17750111100609", 'dep'=>"94"),
|
||||
'CHARLF' => array('nom'=>"JUGE DE PROXIMITE DE CHARLEVILLE MEZIERES", 'siret'=>"17510111200324", 'dep'=>"80"),
|
||||
'CHARLF' => array('nom'=>"JUGE DE PROXIMITE DE CHARLEVILLE MEZIERES", 'siret'=>"17510111200324", 'dep'=>"08"),
|
||||
'CHARTF' => array('nom'=>"JUGE DE PROXIMITE DE CHARTRES", 'siret'=>"17780111500102", 'dep'=>"28"),
|
||||
'CROUXF' => array('nom'=>"JUGE DE PROXIMITE DE CHATEAUROUX", 'siret'=>"17180111100138", 'dep'=>"36"),
|
||||
'RAULTF' => array('nom'=>"JUGE DE PROXIMITE DE CHATELLERAULT", 'siret'=>"17860111800585", 'dep'=>"86"),
|
||||
@ -1572,7 +1572,7 @@ return array(
|
||||
'COUTAF' => array('nom'=>"JUGE DE PROXIMITE DE COUTANCES", 'siret'=>"17140111000282", 'dep'=>"50"),
|
||||
'DAXF' => array('nom'=>"JUGE DE PROXIMITE DE DAX", 'siret'=>"17640111500165", 'dep'=>"40"),
|
||||
'DIEPPF' => array('nom'=>"JUGE DE PROXIMITE DE DIEPPE", 'siret'=>"17760111900247", 'dep'=>"76"),
|
||||
'DIGNEF' => array('nom'=>"JUGE DE PROXIMITE DE DIGNE", 'siret'=>"17130111200727", 'dep'=>"40"),
|
||||
'DIGNEF' => array('nom'=>"JUGE DE PROXIMITE DE DIGNE", 'siret'=>"17130111200727", 'dep'=>"04"),
|
||||
'DIJONF' => array('nom'=>"JUGE DE PROXIMITE DE DIJON", 'siret'=>"17210111500472", 'dep'=>"21"),
|
||||
'DINANF' => array('nom'=>"JUGE DE PROXIMITE DE DINAN", 'siret'=>"17350111500674", 'dep'=>"22"),
|
||||
'DOLEF' => array('nom'=>"JUGE DE PROXIMITE DE DOLE", 'siret'=>"17250111600054", 'dep'=>"39"),
|
||||
@ -1585,14 +1585,14 @@ return array(
|
||||
'ETAMPF' => array('nom'=>"JUGE DE PROXIMITE D'ETAMPES", 'siret'=>"17750111100708", 'dep'=>"91"),
|
||||
'EVREUF' => array('nom'=>"JUGE DE PROXIMITE D'EVREUX", 'siret'=>"17760111900379", 'dep'=>"27"),
|
||||
'EVRYF' => array('nom'=>"JUGE DE PROXIMITE D'EVRY", 'siret'=>"17750111101110", 'dep'=>"91"),
|
||||
'FOIXF' => array('nom'=>"JUGE DE PROXIMITE DE FOIX", 'siret'=>"17310111400192", 'dep'=>"90"),
|
||||
'FOIXF' => array('nom'=>"JUGE DE PROXIMITE DE FOIX", 'siret'=>"17310111400192", 'dep'=>"09"),
|
||||
'FONTF' => array('nom'=>"JUGE DE PROXIMITE DE FONTAINEBLEAU", 'siret'=>"17750111101292", 'dep'=>"77"),
|
||||
'FONTEF' => array('nom'=>"JUGE DE PROXIMITE DE FONTENAY LE COMTE", 'siret'=>"17860111800403", 'dep'=>"85"),
|
||||
'FORTFF' => array('nom'=>"JUGE DE PROXIMITE DE FORT DE FRANCE", 'siret'=>"17972111300126", 'dep'=>"972"),
|
||||
'FREJUF' => array('nom'=>"JUGE DE PROXIMITE DE FREJUS", 'siret'=>"17130111200560", 'dep'=>"83"),
|
||||
'GAPF' => array('nom'=>"JUGE DE PROXIMITE DE GAP", 'siret'=>"17380111900285", 'dep'=>"50"),
|
||||
'GAPF' => array('nom'=>"JUGE DE PROXIMITE DE GAP", 'siret'=>"17380111900285", 'dep'=>"05"),
|
||||
'GONESF' => array('nom'=>"JUGE DE PROXIMITE DE GONESSE", 'siret'=>"17780111500227", 'dep'=>"95"),
|
||||
'GRASSF' => array('nom'=>"JUGE DE PROXIMITE DE GRASSE", 'siret'=>"17130111200370", 'dep'=>"61"),
|
||||
'GRASSF' => array('nom'=>"JUGE DE PROXIMITE DE GRASSE", 'siret'=>"17130111200370", 'dep'=>"06"),
|
||||
'GRENOF' => array('nom'=>"JUGE DE PROXIMITE DE GRENOBLE", 'siret'=>"17380111900038", 'dep'=>"38"),
|
||||
'GUEBWF' => array('nom'=>"JUGE DE PROXIMITE DE GUEBWILLER", 'siret'=>"17680111600086", 'dep'=>"68"),
|
||||
'GUEREF' => array('nom'=>"JUGE DE PROXIMITE DE GUERET", 'siret'=>"17870111600174", 'dep'=>"23"),
|
||||
@ -1607,7 +1607,7 @@ return array(
|
||||
'LAROCF' => array('nom'=>"JUGE DE PROXIMITE DE LA ROCHE SUR YON", 'siret'=>"17860111800239", 'dep'=>"85"),
|
||||
'ROCHLF' => array('nom'=>"JUGE DE PROXIMITE DE LA ROCHELLE", 'siret'=>"17860111800148", 'dep'=>"17"),
|
||||
'LAGNYF' => array('nom'=>"JUGE DE PROXIMITE DE LAGNY SUR MARNE", 'siret'=>"17750111100724", 'dep'=>"77"),
|
||||
'LAONF' => array('nom'=>"JUGE DE PROXIMITE DE LAON", 'siret'=>"17800111100446", 'dep'=>"20"),
|
||||
'LAONF' => array('nom'=>"JUGE DE PROXIMITE DE LAON", 'siret'=>"17800111100446", 'dep'=>"02"),
|
||||
'LAVALF' => array('nom'=>"JUGE DE PROXIMITE DE LAVAL", 'siret'=>"17490111600254", 'dep'=>"53"),
|
||||
'HAVREF' => array('nom'=>"JUGE DE PROXIMITE DU HAVRE", 'siret'=>"17760111900320", 'dep'=>"76"),
|
||||
'MANSF' => array('nom'=>"JUGE DE PROXIMITE DU MANS", 'siret'=>"17490111600361", 'dep'=>"72"),
|
||||
@ -1625,7 +1625,7 @@ return array(
|
||||
'LUREF' => array('nom'=>"JUGE DE PROXIMITE DE LURE", 'siret'=>"17250111600179", 'dep'=>"70"),
|
||||
'LYONF' => array('nom'=>"JUGE DE PROXIMITE DE LYON", 'siret'=>"17690111400437", 'dep'=>"69"),
|
||||
'MACONF' => array('nom'=>"JUGE DE PROXIMITE DE MACON", 'siret'=>"17210111500423", 'dep'=>"71"),
|
||||
'MANOSF' => array('nom'=>"JUGE DE PROXIMITE DE MANOSQUE", 'siret'=>"17130111200453", 'dep'=>"41"),
|
||||
'MANOSF' => array('nom'=>"JUGE DE PROXIMITE DE MANOSQUE", 'siret'=>"17130111200453", 'dep'=>"04"),
|
||||
'MANTEF' => array('nom'=>"JUGE DE PROXIMITE DE MANTES LA JOLIE", 'siret'=>"17780111500193", 'dep'=>"78"),
|
||||
'MARMAF' => array('nom'=>"JUGE DE PROXIMITE DE MARMANDE", 'siret'=>"17470111000226", 'dep'=>"47"),
|
||||
'MARSEF' => array('nom'=>"JUGE DE PROXIMITE DE MARSEILLE", 'siret'=>"17130111200321", 'dep'=>"13"),
|
||||
@ -1634,7 +1634,7 @@ return array(
|
||||
'MEAUXF' => array('nom'=>"JUGE DE PROXIMITE DE MEAUX", 'siret'=>"17750111101250", 'dep'=>"77"),
|
||||
'MELUNF' => array('nom'=>"JUGE DE PROXIMITE DE MELUN", 'siret'=>"17750111100211", 'dep'=>"77"),
|
||||
'MENDEF' => array('nom'=>"JUGE DE PROXIMITE DE MENDE", 'siret'=>"17300111600073", 'dep'=>"48"),
|
||||
'MENTOF' => array('nom'=>"JUGE DE PROXIMITE DE MENTON", 'siret'=>"17130111200347", 'dep'=>"65"),
|
||||
'MENTOF' => array('nom'=>"JUGE DE PROXIMITE DE MENTON", 'siret'=>"17130111200347", 'dep'=>"06"),
|
||||
'METZF' => array('nom'=>"JUGE DE PROXIMITE DE METZ", 'siret'=>"17570111900125", 'dep'=>"57"),
|
||||
'MILLAF' => array('nom'=>"JUGE DE PROXIMITE DE MILLAU", 'siret'=>"17340111800380", 'dep'=>"12"),
|
||||
'MARSAF' => array('nom'=>"JUGE DE PROXIMITE DE MONT DE MARSAN", 'siret'=>"17640111500173", 'dep'=>"40"),
|
||||
@ -1642,7 +1642,7 @@ return array(
|
||||
'MONTNF' => array('nom'=>"JUGE DE PROXIMITE DE MONTAUBAN", 'siret'=>"17310111400242", 'dep'=>"82"),
|
||||
'MONTBF' => array('nom'=>"JUGE DE PROXIMITE DE MONTBRISON", 'siret'=>"17690111400098", 'dep'=>"42"),
|
||||
'MONTEF' => array('nom'=>"JUGE DE PROXIMITE DE MONTELIMAR", 'siret'=>"17380111900301", 'dep'=>"26"),
|
||||
'MONTLF' => array('nom'=>"JUGE DE PROXIMITE DE MONTLUCON", 'siret'=>"17630111700261", 'dep'=>"31"),
|
||||
'MONTLF' => array('nom'=>"JUGE DE PROXIMITE DE MONTLUCON", 'siret'=>"17630111700261", 'dep'=>"03"),
|
||||
'MONTYF' => array('nom'=>"JUGE DE PROXIMITE DE MONTMORENCY", 'siret'=>"17780111500235", 'dep'=>"95"),
|
||||
'MONTPF' => array('nom'=>"JUGE DE PROXIMITE DE MONTPELLIER", 'siret'=>"17340111800604", 'dep'=>"34"),
|
||||
'MONTUF' => array('nom'=>"JUGE DE PROXIMITE DE MONTREUIL SUR MER", 'siret'=>"17590111500444", 'dep'=>"62"),
|
||||
@ -1651,10 +1651,10 @@ return array(
|
||||
'MURETF' => array('nom'=>"JUGE DE PROXIMITE DE MURET", 'siret'=>"17310111400093", 'dep'=>"31"),
|
||||
'NANCYF' => array('nom'=>"JUGE DE PROXIMITE DE NANCY", 'siret'=>"17540111600108", 'dep'=>"54"),
|
||||
'NANTEF' => array('nom'=>"JUGE DE PROXIMITE DE NANTES", 'siret'=>"17350111500880", 'dep'=>"44"),
|
||||
'NANTUF' => array('nom'=>"JUGE DE PROXIMITE DE NANTUA", 'siret'=>"17690111400155", 'dep'=>"11"),
|
||||
'NANTUF' => array('nom'=>"JUGE DE PROXIMITE DE NANTUA", 'siret'=>"17690111400155", 'dep'=>"01"),
|
||||
'NARBOF' => array('nom'=>"JUGE DE PROXIMITE DE NARBONNE", 'siret'=>"17340111800372", 'dep'=>"11"),
|
||||
'NEVERF' => array('nom'=>"JUGE DE PROXIMITE DE NEVERS", 'siret'=>"17180111100377", 'dep'=>"58"),
|
||||
'NICEF' => array('nom'=>"JUGE DE PROXIMITE DE NICE", 'siret'=>"17130111200685", 'dep'=>"63"),
|
||||
'NICEF' => array('nom'=>"JUGE DE PROXIMITE DE NICE", 'siret'=>"17130111200685", 'dep'=>"06"),
|
||||
'NIMESF' => array('nom'=>"JUGE DE PROXIMITE DE NIMES", 'siret'=>"17300111600099", 'dep'=>"30"),
|
||||
'NIORTF' => array('nom'=>"JUGE DE PROXIMITE DE NIORT", 'siret'=>"17860111800460", 'dep'=>"79"),
|
||||
'NOGEMF' => array('nom'=>"JUGE DE PROXIMITE DE NOGENT SUR MARNE", 'siret'=>"17750111100500", 'dep'=>"94"),
|
||||
@ -1672,7 +1672,7 @@ return array(
|
||||
'POITIF' => array('nom'=>"JUGE DE PROXIMITE DE POITIERS", 'siret'=>"17860111800411", 'dep'=>"86"),
|
||||
'PONTAF' => array('nom'=>"JUGE DE PROXIMITE DE PONTARLIER", 'siret'=>"17250111600237", 'dep'=>"25"),
|
||||
'PONTOF' => array('nom'=>"JUGE DE PROXIMITE DE PONTOISE", 'siret'=>"17780111500573", 'dep'=>"95"),
|
||||
'PRIVF' => array('nom'=>"JUGE DE PROXIMITE DE PRIVAS", 'siret'=>"17300111600313", 'dep'=>"70"),
|
||||
'PRIVF' => array('nom'=>"JUGE DE PROXIMITE DE PRIVAS", 'siret'=>"17300111600313", 'dep'=>"07"),
|
||||
'PUTEAF' => array('nom'=>"JUGE DE PROXIMITE DE PUTEAUX", 'siret'=>"17780111500334", 'dep'=>"92"),
|
||||
'QUIMPF' => array('nom'=>"JUGE DE PROXIMITE DE QUIMPER", 'siret'=>"17350111500591", 'dep'=>"29"),
|
||||
'RAMBOF' => array('nom'=>"JUGE DE PROXIMITE DE RAMBOUILLET", 'siret'=>"17780111500169", 'dep'=>"78"),
|
||||
@ -1698,7 +1698,7 @@ return array(
|
||||
'STETIF' => array('nom'=>"JUGE DE PROXIMITE DE SAINT ETIENNE", 'siret'=>"17690111400189", 'dep'=>"42"),
|
||||
'GAUDEF' => array('nom'=>"JUGE DE PROXIMITE DE SAINT GAUDENS", 'siret'=>"17310111400200", 'dep'=>"31"),
|
||||
'SGERMF' => array('nom'=>"JUGE DE PROXIMITE DE SAINT GERMAIN EN LAYE", 'siret'=>"17780111500177", 'dep'=>"78"),
|
||||
'GIRONF' => array('nom'=>"JUGE DE PROXIMITE DE SAINT GIRONS", 'siret'=>"17310111400317", 'dep'=>"92"),
|
||||
'GIRONF' => array('nom'=>"JUGE DE PROXIMITE DE SAINT GIRONS", 'siret'=>"17310111400317", 'dep'=>"09"),
|
||||
'STMALF' => array('nom'=>"JUGE DE PROXIMITE DE SAINT MALO", 'siret'=>"17350111500120", 'dep'=>"35"),
|
||||
'MAURDF' => array('nom'=>"JUGE DE PROXIMITE DE SAINT MAUR DES FOSSES", 'siret'=>"17750111100492", 'dep'=>"94"),
|
||||
'NAZAIF' => array('nom'=>"JUGE DE PROXIMITE DE SAINT NAZAIRE", 'siret'=>"17350111500724", 'dep'=>"44"),
|
||||
@ -1706,7 +1706,7 @@ return array(
|
||||
'STOUEF' => array('nom'=>"JUGE DE PROXIMITE DE SAINT OUEN", 'siret'=>"17750111101078", 'dep'=>"93"),
|
||||
'SPAULF' => array('nom'=>"JUGE DE PROXIMITE DE SAINT PAUL", 'siret'=>"17974111100076", 'dep'=>"978"),
|
||||
'PIERRF' => array('nom'=>"JUGE DE PROXIMITE DE SAINT PIERRE", 'siret'=>"17974111100100", 'dep'=>"974"),
|
||||
'SQUENF' => array('nom'=>"JUGE DE PROXIMITE DE SAINT QUENTIN", 'siret'=>"17800111100438", 'dep'=>"23"),
|
||||
'SQUENF' => array('nom'=>"JUGE DE PROXIMITE DE SAINT QUENTIN", 'siret'=>"17800111100438", 'dep'=>"02"),
|
||||
'SNTESF' => array('nom'=>"JUGE DE PROXIMITE DE SAINTES", 'siret'=>"17860111800189", 'dep'=>"17"),
|
||||
'SALONF' => array('nom'=>"JUGE DE PROXIMITE DE SALON DE PROVENCE", 'siret'=>"17130111200131", 'dep'=>"13"),
|
||||
'SANNOF' => array('nom'=>"JUGE DE PROXIMITE DE SANNOIS", 'siret'=>"17780111500474", 'dep'=>"95"),
|
||||
@ -1718,7 +1718,7 @@ return array(
|
||||
'SENLIF' => array('nom'=>"JUGE DE PROXIMITE DE SENLIS", 'siret'=>"17800111100479", 'dep'=>"60"),
|
||||
'SENSF' => array('nom'=>"JUGE DE PROXIMITE DE SENS", 'siret'=>"17750111100856", 'dep'=>"89"),
|
||||
'SETEF' => array('nom'=>"JUGE DE PROXIMITE DE SETE", 'siret'=>"17340111800430", 'dep'=>"34"),
|
||||
'SOISSF' => array('nom'=>"JUGE DE PROXIMITE DE SOISSONS", 'siret'=>"17800111100370", 'dep'=>"22"),
|
||||
'SOISSF' => array('nom'=>"JUGE DE PROXIMITE DE SOISSONS", 'siret'=>"17800111100370", 'dep'=>"02"),
|
||||
'STRASF' => array('nom'=>"JUGE DE PROXIMITE DE STRASBOURG", 'siret'=>"17680111600268", 'dep'=>"67"),
|
||||
'TARASF' => array('nom'=>"JUGE DE PROXIMITE DE TARASCON", 'siret'=>"17130111200420", 'dep'=>"13"),
|
||||
'TARBEF' => array('nom'=>"JUGE DE PROXIMITE DE TARBES", 'siret'=>"17640111500090", 'dep'=>"65"),
|
||||
@ -1730,7 +1730,7 @@ return array(
|
||||
'TOULOF' => array('nom'=>"JUGE DE PROXIMITE DE TOULOUSE", 'siret'=>"17310111400325", 'dep'=>"31"),
|
||||
'TOURCF' => array('nom'=>"JUGE DE PROXIMITE DE TOURCOING", 'siret'=>"17590111500360", 'dep'=>"59"),
|
||||
'TOURSF' => array('nom'=>"JUGE DE PROXIMITE DE TOURS", 'siret'=>"17450111400220", 'dep'=>"37"),
|
||||
'TREVOF' => array('nom'=>"JUGE DE PROXIMITE DE TREVOUX", 'siret'=>"17690111400494", 'dep'=>"16"),
|
||||
'TREVOF' => array('nom'=>"JUGE DE PROXIMITE DE TREVOUX", 'siret'=>"17690111400494", 'dep'=>"01"),
|
||||
'TROYEF' => array('nom'=>"JUGE DE PROXIMITE DE TROYES", 'siret'=>"17510111200266", 'dep'=>"10"),
|
||||
'TULLEF' => array('nom'=>"JUGE DE PROXIMITE DE TULLE", 'siret'=>"17870111600166", 'dep'=>"19"),
|
||||
'UZESF' => array('nom'=>"JUGE DE PROXIMITE DE UZES", 'siret'=>"17300111600347", 'dep'=>"30"),
|
||||
@ -1740,7 +1740,7 @@ return array(
|
||||
'VANVEF' => array('nom'=>"JUGE DE PROXIMITE DE VANVES", 'siret'=>"17780111500342", 'dep'=>"92"),
|
||||
'VERSAF' => array('nom'=>"JUGE DE PROXIMITE DE VERSAILLES", 'siret'=>"17780111500458", 'dep'=>"78"),
|
||||
'VESOUF' => array('nom'=>"JUGE DE PROXIMITE DE VESOUL", 'siret'=>"17250111600161", 'dep'=>"70"),
|
||||
'VICHYF' => array('nom'=>"JUGE DE PROXIMITE DE VICHY", 'siret'=>"17630111700287", 'dep'=>"32"),
|
||||
'VICHYF' => array('nom'=>"JUGE DE PROXIMITE DE VICHY", 'siret'=>"17630111700287", 'dep'=>"03"),
|
||||
'VIENNF' => array('nom'=>"JUGE DE PROXIMITE DE VIENNE", 'siret'=>"17380111900236", 'dep'=>"38"),
|
||||
'VILLFF' => array('nom'=>"JUGE DE PROXIMITE DE VILLEFRANCHE SUR SAONE", 'siret'=>"17690111400510", 'dep'=>"69"),
|
||||
'VILLEF' => array('nom'=>"JUGE DE PROXIMITE DE VILLEJUIF", 'siret'=>"17750111101284", 'dep'=>"94"),
|
||||
|
@ -280,4 +280,5 @@ return array(
|
||||
9970 => "Groupement de coopération sanitaire à gestion privée",
|
||||
7357 => "P?le d'?quilibre territorial",
|
||||
7367 => "Centre Intercommunal d'action sociale",
|
||||
6500 => "",
|
||||
);
|
||||
|
@ -2149,6 +2149,13 @@ return array(
|
||||
'Version' => 15,
|
||||
'LienEtab' => 1,
|
||||
),
|
||||
'5461' => array(
|
||||
'libEven' => "Cession/donation dans le cadre d'un divorce",
|
||||
'Bodacc_Code' => "BODA",
|
||||
'Rubrique' => "ventes",
|
||||
'Version' => 18,
|
||||
'LienEtab' => 1,
|
||||
),
|
||||
'5500' => array(
|
||||
'libEven' => "Entreprise réalisant la vente",
|
||||
'Bodacc_Code' => "BODA",
|
||||
|
5
library/Metier/sphinx/Engine.php
Normal file
5
library/Metier/sphinx/Engine.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class Metier_Sphinx_Engine
|
||||
{
|
||||
public function __construct() {}
|
||||
}
|
@ -6,10 +6,6 @@ if (defined('DEBUG') == false) {
|
||||
define( 'DEBUG', 0);
|
||||
}
|
||||
|
||||
require_once realpath(dirname(__FILE__)).'/criteresFonc.php';
|
||||
|
||||
$gDatabaseJO = databaseJO();
|
||||
|
||||
// --------------------------------------------------------------------------- //
|
||||
// databaseJO
|
||||
// --------------------------------------------------------------------------- //
|
||||
@ -36,17 +32,15 @@ function println($ln = '')
|
||||
// debugln
|
||||
// --------------------------------------------------------------------------- //
|
||||
if (DEBUG) {
|
||||
function debugln($ln = '')
|
||||
{
|
||||
function debugln($ln = '') {
|
||||
print $ln.'<br/>';
|
||||
}
|
||||
} else if (LOCAL) {
|
||||
function debugln($ln = '')
|
||||
{
|
||||
}
|
||||
} else {
|
||||
function debugln($ln = '')
|
||||
{
|
||||
}
|
||||
else if (LOCAL) {
|
||||
function debugln($ln = '') {}
|
||||
}
|
||||
else {
|
||||
function debugln($ln = '') {
|
||||
/*
|
||||
$fp = fopen(LOG_PATH.'/recherchesDebug.log', 'a');
|
||||
fwrite($fp, $ln."\n");
|
||||
@ -55,6 +49,199 @@ if (DEBUG) {
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------- //
|
||||
// Nouvelle sequence
|
||||
// --------------------------------------------------------------------------- //
|
||||
function nouvelleSequence(&$criteres)
|
||||
{
|
||||
$sequence = array(
|
||||
array( 'crit' => 'IT ', 'next' => '12' ),
|
||||
array( 'crit' => 'I ', 'next' => '00' ),
|
||||
array( 'crit' => 'I SEP ', 'next' => '12' ),
|
||||
array( 'crit' => ' T ', 'next' => '00' ),
|
||||
array( 'crit' => ' TSEP ', 'next' => '13 61 61o61p' ),
|
||||
array( 'crit' => ' D VNR', 'next' => '24 45o24o24p' ),
|
||||
array( 'crit' => ' D NR', 'next' => '21o21p' ),
|
||||
array( 'crit' => ' DL NR', 'next' => '21 21o21p' ),
|
||||
array( 'crit' => ' DLVNR', 'next' => '36 45 24 45o24o24p' ),
|
||||
array( 'crit' => ' P VNR', 'next' => '74 78o74o74p' ),
|
||||
array( 'crit' => ' PD VNR', 'next' => '74 78o74o74p' ),
|
||||
array( 'crit' => ' PDL NR', 'next' => '78 83o74 74o74p' ),
|
||||
array( 'crit' => ' PDLV R', 'next' => '78 81 82 77 71' ),
|
||||
array( 'crit' => ' PDLVN ', 'next' => '82 75 28 71' ),
|
||||
array( 'crit' => ' PDLVNR', 'next' => '78 74 82 78o74o82o82p' ),
|
||||
array( 'crit' => ' S ', 'next' => '30o30p' ),
|
||||
array( 'crit' => ' S R', 'next' => '72o71 71o71p' ),
|
||||
array( 'crit' => ' S N ', 'next' => '31' ),
|
||||
array( 'crit' => ' S NR', 'next' => '77 43 71' ),
|
||||
array( 'crit' => ' S V ', 'next' => '35o35p30' ),
|
||||
array( 'crit' => ' S VN ', 'next' => '75 77o75o77p75p' ),
|
||||
array( 'crit' => ' S V R', 'next' => '75 83' ),
|
||||
array( 'crit' => ' S VNR', 'next' => '43 44 75 83 61 71' ),
|
||||
array( 'crit' => ' S D ', 'next' => '40p40o61p61' ),
|
||||
array( 'crit' => ' S D R', 'next' => '45o77 77o77p' ),
|
||||
array( 'crit' => ' S D N ', 'next' => '71' ),
|
||||
array( 'crit' => ' S D NR', 'next' => '77 43 71 31' ),
|
||||
array( 'crit' => ' S D V ', 'next' => '77o40 40o' ),
|
||||
array( 'crit' => ' S D V R', 'next' => '75 72 71' ),
|
||||
array( 'crit' => ' S D VN ', 'next' => '43 41 77 71' ),
|
||||
array( 'crit' => ' S D VNR', 'next' => '44 43 49 73 75 72 71' ),
|
||||
array( 'crit' => ' S DL ', 'next' => '78 78p61p61p' ),
|
||||
array( 'crit' => ' S DL R', 'next' => '82 78 77 71' ),
|
||||
array( 'crit' => ' S DL N ', 'next' => '41 71' ),
|
||||
array( 'crit' => ' S DL NR', 'next' => '78 82 81 78p77 43 71 31' ),
|
||||
array( 'crit' => ' S DLV ', 'next' => '78 78p71' ),
|
||||
array( 'crit' => ' S DLV R', 'next' => '78 83 82 75 72 40 71' ),
|
||||
array( 'crit' => ' S DLVN ', 'next' => '78 82 78p43 71' ),
|
||||
array( 'crit' => ' S DLVNR', 'next' => '78 49 77 43 78p75 41 72 71 22' ),
|
||||
array( 'crit' => ' S P ', 'next' => '60o60p31 31o31p' ),
|
||||
array( 'crit' => ' S P R', 'next' => '45 77 41' ),
|
||||
array( 'crit' => ' S P N ', 'next' => '71 71o45 45p' ),
|
||||
array( 'crit' => ' S P NR', 'next' => '77 72 33 32' ),
|
||||
array( 'crit' => ' S P V ', 'next' => '63o45 45o45p' ),
|
||||
array( 'crit' => ' S P VN ', 'next' => '45 43 61 64' ),
|
||||
array( 'crit' => ' S P V R', 'next' => '75 83 45 35' ),
|
||||
array( 'crit' => ' S P VNR', 'next' => '77 45 44 43 73 75 72 71 41 42 40' ),
|
||||
array( 'crit' => ' S PD ', 'next' => '45 71p71o' ),
|
||||
array( 'crit' => ' S PD R', 'next' => '77 45 71' ),
|
||||
array( 'crit' => ' S PD N ', 'next' => '71 71o45 45o' ),
|
||||
array( 'crit' => ' S PD NR', 'next' => '77 76 45 41 43 40' ),
|
||||
array( 'crit' => ' S PD V ', 'next' => '45 45o71 42 42p' ),
|
||||
array( 'crit' => ' S PD V R', 'next' => '77 83 43 71 41' ),
|
||||
array( 'crit' => ' S PD VN ', 'next' => '83 75 71 44 83o75o71o44o43 41 40 40o40p' ),
|
||||
array( 'crit' => ' S PD VNR', 'next' => '77 74 45 44 43 75 71 61 63 60 40' ),
|
||||
array( 'crit' => ' S PDL ', 'next' => '71 71o71p45 45o' ),
|
||||
array( 'crit' => ' S PDL R', 'next' => '78 82 75 45 44' ),
|
||||
array( 'crit' => ' S PDL N ', 'next' => '73 48 41' ),
|
||||
array( 'crit' => ' S PDL NR', 'next' => '78 82 81 49 77 65 44 43 75 60 31' ),
|
||||
array( 'crit' => ' S PDLV ', 'next' => '78 45 45o71 42 42p40' ),
|
||||
array( 'crit' => ' S PDLV R', 'next' => '78 83 82 75 45 49 46 42 71 40' ),
|
||||
array( 'crit' => ' S PDLVN ', 'next' => '78 83 77 45 71 42 41 40' ),
|
||||
array( 'crit' => ' S PDLVNR', 'next' => '78 83 27 74 45 44 43 42 40' ),
|
||||
array( 'crit' => ' SE ', 'next' => '31o31p' ),
|
||||
array( 'crit' => ' SE R', 'next' => '72o71 71o71p' ),
|
||||
array( 'crit' => ' SE N ', 'next' => '31' ),
|
||||
array( 'crit' => ' SE NR', 'next' => '77 43 71' ),
|
||||
array( 'crit' => ' SE V ', 'next' => '35o35p30' ),
|
||||
array( 'crit' => ' SE V R', 'next' => '75 83' ),
|
||||
array( 'crit' => ' SE VN ', 'next' => '75 77' ),
|
||||
array( 'crit' => ' SE VNR', 'next' => '43 44 75 83 61 71' ),
|
||||
array( 'crit' => ' SE D ', 'next' => '40o30' ),
|
||||
array( 'crit' => ' SE D R', 'next' => '45o77' ),
|
||||
array( 'crit' => ' SE D N ', 'next' => '71' ),
|
||||
array( 'crit' => ' SE D NR', 'next' => '77 43 71 31' ),
|
||||
array( 'crit' => ' SE D V ', 'next' => '77o40' ),
|
||||
array( 'crit' => ' SE D V R', 'next' => '75 72 71' ),
|
||||
array( 'crit' => ' SE D VN ', 'next' => '43 41 77' ),
|
||||
array( 'crit' => ' SE D VNR', 'next' => '44 43 49 73 75 72 71' ),
|
||||
array( 'crit' => ' SE DL ', 'next' => '40' ),
|
||||
array( 'crit' => ' SE DL R', 'next' => '82 78 77' ),
|
||||
array( 'crit' => ' SE DL N ', 'next' => '45 43 82o45o43o43p' ),
|
||||
array( 'crit' => ' SE DL NR', 'next' => '78 82 81 46 77 43 71 31' ),
|
||||
array( 'crit' => ' SE DLV ', 'next' => '78 78o71 71o71p' ),
|
||||
array( 'crit' => ' SE DLV R', 'next' => '78 83 82 75 72 40' ),
|
||||
array( 'crit' => ' SE DLVN ', 'next' => '78 82 46 43 71' ),
|
||||
array( 'crit' => ' SE DLVNR', 'next' => '78 49 77 43 46 75 41 72 71 22' ),
|
||||
array( 'crit' => ' SEP ', 'next' => '61p31 31p30' ),
|
||||
array( 'crit' => ' SEP R', 'next' => '45 77 41' ),
|
||||
array( 'crit' => ' SEP N ', 'next' => '71 71o45 45p' ),
|
||||
array( 'crit' => ' SEP NR', 'next' => '77 72 33 32' ),
|
||||
array( 'crit' => ' SEP V ', 'next' => '63o45' ),
|
||||
array( 'crit' => ' SEP V R', 'next' => '75 83 45 35' ),
|
||||
array( 'crit' => ' SEP VN ', 'next' => '45 43 61 64' ),
|
||||
array( 'crit' => ' SEP VNR', 'next' => '77 45 44 43 73 75 72 71 41 42 40' ),
|
||||
array( 'crit' => ' SEPD ', 'next' => '45 71p' ),
|
||||
array( 'crit' => ' SEPD R', 'next' => '77 45' ),
|
||||
array( 'crit' => ' SEPD N ', 'next' => '71 71o45 40' ),
|
||||
array( 'crit' => ' SEPD NR', 'next' => '77 76 45 41 43 40' ),
|
||||
array( 'crit' => ' SEPD V ', 'next' => '45 71p71o40' ),
|
||||
array( 'crit' => ' SEPD V R', 'next' => '77 83 43 71 41 40' ),
|
||||
array( 'crit' => ' SEPD VN ', 'next' => '83 75 71 44 83o75o71o44o43 41 40 40o40p' ),
|
||||
array( 'crit' => ' SEPD VNR', 'next' => '77 74 45 44 43 75 71 61 63 60 40' ),
|
||||
array( 'crit' => ' SEPDL ', 'next' => '45 71p40' ),
|
||||
array( 'crit' => ' SEPDL R', 'next' => '78 82 75 45 44 40' ),
|
||||
array( 'crit' => ' SEPDL N ', 'next' => '73 48 41 40' ),
|
||||
array( 'crit' => ' SEPDL NR', 'next' => '78 82 81 49 77 65 44 43 75 60 31' ),
|
||||
array( 'crit' => ' SEPDLV ', 'next' => '78 45 45o71 42 42p' ),
|
||||
array( 'crit' => ' SEPDLV R', 'next' => '78 83 82 75 45 49 46 42 71 40' ),
|
||||
array( 'crit' => ' SEPDLVN ', 'next' => '78 83 77 45 71 42 41 40' ),
|
||||
array( 'crit' => ' SEPDLVNR', 'next' => '78 83 27 74 45 44 43 42 40' ),
|
||||
);
|
||||
|
||||
foreach ($sequence as $ligne) {
|
||||
if (strstr($ligne['crit'], $criteres) != false) {
|
||||
return str_split($ligne['next'], 3);
|
||||
}
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------- //
|
||||
// Nouvelle combinaison
|
||||
// --------------------------------------------------------------------------- //
|
||||
function nouvelleCombinaison(&$sequence, &$sequencePos, $pass, &$index, &$mode)
|
||||
{
|
||||
for (;;) {
|
||||
if (isset($sequence[$sequencePos]) === false) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$combinaison = trim($sequence[$sequencePos]);
|
||||
++$sequencePos;
|
||||
|
||||
if (strlen($combinaison) == 2) {
|
||||
return $combinaison;
|
||||
}
|
||||
|
||||
// Passage en phonetique ou en orthographique
|
||||
if (strlen($combinaison) == 3) {
|
||||
if ($pass == 2 || $pass == 3) {
|
||||
continue;
|
||||
}
|
||||
$car = strtolower(substr($combinaison, 2, 1));
|
||||
|
||||
//Search Engine Version 2, we remove the orthographique
|
||||
if (SPHINX_ENT_VERSION == 2 && $car == 'o') {
|
||||
return strtolower(substr($combinaison, 0, 2));
|
||||
}
|
||||
|
||||
switch($car) {
|
||||
case 'p':
|
||||
$index = 'ent_phx';
|
||||
$mode = SPH_MATCH_EXTENDED2;
|
||||
break;
|
||||
case 'o':
|
||||
$index = 'ent_mns';
|
||||
$mode = SPH_MATCH_ISPELL;
|
||||
break;
|
||||
default:
|
||||
debugln("attention: mode inconnu: '$car'");
|
||||
}
|
||||
} else if ($pass == 1) {
|
||||
$index = 'ent_mns';
|
||||
//Search Engine Version 2, we remove the orthographique
|
||||
if (SPHINX_ENT_VERSION == 2) {
|
||||
$index = 'ent';
|
||||
}
|
||||
}
|
||||
|
||||
return $combinaison;
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------- //
|
||||
// Nouveaux criteres
|
||||
// --------------------------------------------------------------------------- //
|
||||
function nouveauxCriteres($comb2crit, $combinaison)
|
||||
{
|
||||
if ( array_key_exists($combinaison, $comb2crit) ) {
|
||||
$ligne = $comb2crit[$combinaison];
|
||||
return $ligne;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------- //
|
||||
// Filtre les caracteres speciaux
|
||||
// --------------------------------------------------------------------------- //
|
||||
@ -1811,4 +1998,4 @@ function recherche(&$formR, $deb = 0, $nbRep = 20, $max = 1000)
|
||||
'erreur' => 'Type de recherche inconnu');
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
112
library/Scores/Account/Category.php
Normal file
112
library/Scores/Account/Category.php
Normal file
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
return array(
|
||||
'RECHERCHE' => array(
|
||||
'label' => "Recherche",
|
||||
'droits' => array(
|
||||
'RECHCSV',
|
||||
'IPARI',
|
||||
'HISTOBODACC',
|
||||
'INVESTIG',
|
||||
'SEARCHENT',
|
||||
'SEARCHDIR',
|
||||
'SEARCHACT'
|
||||
),
|
||||
),
|
||||
'IDENTITE' => array(
|
||||
'label' => "Identité",
|
||||
'droits' => array(
|
||||
'IDENTITE',
|
||||
'IDPROCOL',
|
||||
'LIENS',
|
||||
'ETABLISSEMENTS',
|
||||
'GROUPE',
|
||||
'EVENINSEE',
|
||||
'AVISINSEE',
|
||||
'AVISRNCS',
|
||||
'RNVP'
|
||||
),
|
||||
),
|
||||
'DIRIGEANT' => array(
|
||||
'label' => "Dirigeant",
|
||||
'droits' => array(
|
||||
'DIRIGEANTS',
|
||||
'DIRIGEANTSOP',
|
||||
'WORLDCHECK'
|
||||
),
|
||||
),
|
||||
'FINANCE' => array(
|
||||
'label' => 'Elements Financiers',
|
||||
'droits' => array(
|
||||
'SYNTHESE',
|
||||
'RATIOS',
|
||||
'FLUX',
|
||||
'LIASSE',
|
||||
'LIASSEXLS',
|
||||
'UPLOADBILAN',
|
||||
'BOURSE',
|
||||
'BANQUE'
|
||||
),
|
||||
),
|
||||
'JURIDIQUE' => array(
|
||||
'label' => 'Elements Juridiques',
|
||||
'droits' => array('ANNONCES',
|
||||
'INFOSREG',
|
||||
'COMPETENCES',
|
||||
'CONVENTIONS',
|
||||
'MARQUES',
|
||||
'CONTENTIEUX'
|
||||
),
|
||||
),
|
||||
'EVALUATION' => array(
|
||||
'label' => 'Evaluation',
|
||||
'droits' => array(
|
||||
'INDISCORE',
|
||||
'INDISCORE2',
|
||||
'INDISCORE3',
|
||||
'INDISCOREP',
|
||||
'INDISCORE2P',
|
||||
'INDISCORE3P',
|
||||
'VALORISATION',
|
||||
'ENQUETEC',
|
||||
'AVISCREDIT'
|
||||
),
|
||||
),
|
||||
'PIECES' => array(
|
||||
'label' => 'Pièces officielles',
|
||||
'droits' => array(
|
||||
'KBIS',
|
||||
'ACTES',
|
||||
'PRIVILEGES'
|
||||
),
|
||||
),
|
||||
'SURVEILLANCES' => array(
|
||||
'label' => 'Surveillances',
|
||||
'droits' => array(
|
||||
'SURVANNONCE',
|
||||
'SURVINSEE',
|
||||
'SURVBILAN',
|
||||
'SURVSCORE',
|
||||
'SURVACTES',
|
||||
'SURVDIRIGEANTS',
|
||||
'SURVPAIEMENTS',
|
||||
'SURVLIENS',
|
||||
'SURVPRIV',
|
||||
),
|
||||
),
|
||||
'OPTIONS' => array(
|
||||
'label' => 'Options',
|
||||
'droits' => array(
|
||||
'MONPROFIL',
|
||||
'SURVLISTE',
|
||||
'PORTEFEUILLE',
|
||||
'EDITION'
|
||||
),
|
||||
),
|
||||
'DIVERS' => array(
|
||||
'label' => 'Divers',
|
||||
'droits' => array(
|
||||
'INTERNATIONAL',
|
||||
'BDF'
|
||||
),
|
||||
),
|
||||
);
|
@ -543,21 +543,6 @@ class Scores_Extract_Dict
|
||||
'help' => "",
|
||||
'columns' => array()
|
||||
),
|
||||
'ZonePrioritaire' => array(
|
||||
'lib' => 'Zone Prioritaire',
|
||||
'help' => "",
|
||||
'columns' => array()
|
||||
),
|
||||
'AdresseDom'=> array(
|
||||
'lib' => 'AdresseDom',
|
||||
'help' => "",
|
||||
'columns' => array()
|
||||
),
|
||||
'Iris'=> array(
|
||||
'lib' => 'Iris',
|
||||
'help' => "",
|
||||
'columns' => array()
|
||||
),
|
||||
);
|
||||
|
||||
public function __construct(){}
|
||||
|
67
library/Scores/Logger/Sql.php
Normal file
67
library/Scores/Logger/Sql.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
use Doctrine\DBAL\Logging\SQLLogger;
|
||||
|
||||
class Scores_Logger_Sql implements SQLLogger
|
||||
{
|
||||
/**
|
||||
* Executed SQL queries.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $query = array();
|
||||
|
||||
/**
|
||||
* If Debug Stack is enabled (log queries) or not.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $enabled = true;
|
||||
|
||||
/**
|
||||
* @var float|null
|
||||
*/
|
||||
public $start = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $total = 0;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $nb = 0;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function startQuery($sql, array $params = null, array $types = null)
|
||||
{
|
||||
if ($this->enabled) {
|
||||
$this->start = microtime(true);
|
||||
$this->query = array('sql' => $sql, 'params' => $params, 'types' => $types, 'executionMS' => 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function stopQuery()
|
||||
{
|
||||
if ($this->enabled) {
|
||||
$time = microtime(true) - $this->start;
|
||||
$this->total+= $time;
|
||||
$this->query['executionTotal'] = $this->total;
|
||||
$this->query['executionMS'] = $time;
|
||||
if ($this->nb == 0) {
|
||||
file_put_contents('logger.log', print_r($this->query,1));
|
||||
}
|
||||
else {
|
||||
file_put_contents('logger.log', print_r($this->query,1), FILE_APPEND);
|
||||
}
|
||||
$this->nb++;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,6 @@
|
||||
<?php
|
||||
use Doctrine\DBAL\Connection;
|
||||
|
||||
class Scores_Ws_Server
|
||||
{
|
||||
/**
|
||||
@ -72,65 +74,16 @@ class Scores_Ws_Server
|
||||
);
|
||||
|
||||
/**
|
||||
* List all permission
|
||||
* Liste des permissions
|
||||
* @var array
|
||||
*
|
||||
* category
|
||||
*
|
||||
* acces
|
||||
* code | label | category
|
||||
*
|
||||
*/
|
||||
protected $listeDroits = array ();
|
||||
protected $listeDroits = array();
|
||||
|
||||
protected $listeCategory = array(
|
||||
'RECHERCHE' => array(
|
||||
'label' => "Recherche",
|
||||
'droits' => array('RECHCSV', 'IPARI', 'HISTOBODACC', 'INVESTIG', 'SEARCHENT',
|
||||
'SEARCHDIR', 'SEARCHACT'),
|
||||
),
|
||||
'IDENTITE' => array(
|
||||
'label' => "Identité",
|
||||
'droits' => array('IDENTITE','IDPROCOL', 'LIENS', 'ETABLISSEMENTS', 'GROUPE',
|
||||
'EVENINSEE', 'AVISINSEE', 'AVISRNCS', 'RNVP'),
|
||||
),
|
||||
'DIRIGEANT' => array(
|
||||
'label' => "Dirigeant",
|
||||
'droits' => array('DIRIGEANTS','DIRIGEANTSOP', 'WORLDCHECK'),
|
||||
),
|
||||
'FINANCE' => array(
|
||||
'label' => 'Elements Financiers',
|
||||
'droits' => array('SYNTHESE','RATIOS','FLUX','LIASSE','LIASSEXLS', 'UPLOADBILAN',
|
||||
'BOURSE','BANQUE'),
|
||||
),
|
||||
'JURIDIQUE' => array(
|
||||
'label' => 'Elements Juridiques',
|
||||
'droits' => array('ANNONCES','INFOSREG','COMPETENCES','CONVENTIONS','MARQUES'),
|
||||
),
|
||||
'EVALUATION' => array(
|
||||
'label' => 'Evaluation',
|
||||
'droits' => array('INDISCORE', 'INDISCORE2', 'INDISCORE3', 'INDISCOREP', 'INDISCORE2P',
|
||||
'INDISCORE3P','VALORISATION','ENQUETEC','AVISCREDIT'),
|
||||
),
|
||||
'PIECES' => array(
|
||||
'label' => 'Pièces officielles',
|
||||
'droits' => array('KBIS', 'ACTES', 'PRIVILEGES'),
|
||||
),
|
||||
'SURVEILLANCES' => array(
|
||||
'label' => 'Surveillances',
|
||||
'droits' => array('SURVANNONCE', 'SURVINSEE', 'SURVBILAN', 'SURVSCORE', 'SURVACTES',
|
||||
'SURVDIRIGEANTS', 'SURVPAIEMENTS', 'SURVLIENS', 'SURVPRIV',
|
||||
),
|
||||
),
|
||||
'OPTIONS' => array(
|
||||
'label' => 'Options',
|
||||
'droits' => array('MONPROFIL','SURVLISTE','PORTEFEUILLE','EDITION'),
|
||||
),
|
||||
'DIVERS' => array(
|
||||
'label' => 'Divers',
|
||||
'droits' => array('INTERNATIONAL', 'BDF'),
|
||||
),
|
||||
);
|
||||
/**
|
||||
* Permissions et catégories
|
||||
* @var array
|
||||
*/
|
||||
protected $listeCategory = array();
|
||||
|
||||
/**
|
||||
* List preferences
|
||||
@ -281,25 +234,21 @@ class Scores_Ws_Server
|
||||
'9020' => "Requête incorrecte",
|
||||
);
|
||||
|
||||
/**
|
||||
* PDO Connection with Doctrine
|
||||
* @var \Doctrine\DBAL\Connection
|
||||
*/
|
||||
protected $conn;
|
||||
|
||||
/**
|
||||
* Server SOAP
|
||||
* Document/Literal Wrapped - WS-I Compliant
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
defined('DATETIME')
|
||||
|| define ('DATETIME', date('YmdHis'));
|
||||
|
||||
defined('DATE')
|
||||
|| define ('DATE', substr(DATETIME,0,8));
|
||||
|
||||
defined('TIME')
|
||||
|| define ('TIME', substr(DATETIME,8,6));
|
||||
|
||||
defined('DATE_LISIBLE')
|
||||
|| define ('DATE_LISIBLE', substr(DATETIME,6,2).'/'.substr(DATETIME,4,2).'/'.substr(DATETIME,0,4));
|
||||
|
||||
defined('TIME_LISIBLE')
|
||||
|| define ('TIME_LISIBLE', substr(DATETIME,8,2).':'.substr(DATETIME,10,2).':'.substr(DATETIME,12,2));
|
||||
|
||||
|
||||
$this->conn = Zend_Registry::get('doctrine');
|
||||
$this->listeDroits = include APPLICATION_PATH . '/../library/Scores/Account/Access.php';
|
||||
$this->listeCategory = include APPLICATION_PATH . '/../library/Scores/Account/Category.php';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -313,7 +262,7 @@ class Scores_Ws_Server
|
||||
if (array_key_exists($code, $this->listError)){
|
||||
$message = $this->listError[$code];
|
||||
}
|
||||
throw new SoapFault($code,$message);
|
||||
throw new SoapFault($code, $message);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -324,20 +273,21 @@ class Scores_Ws_Server
|
||||
* @param $ref
|
||||
* @return void
|
||||
*/
|
||||
protected function wsLog($service, $siret='', $ref='')
|
||||
protected function wsLog($service, $siret = '', $ref = '')
|
||||
{
|
||||
//Is it a test
|
||||
if ( $this->User->clientTest=='Oui' || $this->User->typeCompte=='TEST' ) {
|
||||
$test=1;
|
||||
if ($this->User->clientTest=='Oui' || $this->User->typeCompte=='TEST') {
|
||||
$test = 1;
|
||||
} else {
|
||||
$test=0;
|
||||
$test = 0;
|
||||
}
|
||||
|
||||
$siren = 0;
|
||||
if ( strlen($siret) == 14 ) {
|
||||
$siren = substr($siret,0,9);
|
||||
$nic = substr($siret,9,5);
|
||||
} elseif ( strlen($siret) == 9 ) {
|
||||
if (strlen($siret) == 14) {
|
||||
$siren = substr($siret, 0, 9);
|
||||
$nic = substr($siret, 9, 5);
|
||||
}
|
||||
elseif (strlen($siret) == 9) {
|
||||
$siren = $siret;
|
||||
$nic = '';
|
||||
}
|
||||
@ -357,8 +307,6 @@ class Scores_Ws_Server
|
||||
'ipClient' => $this->User->ipConnexion,
|
||||
);
|
||||
|
||||
$db = Zend_Db_Table_Abstract::getDefaultAdapter();
|
||||
|
||||
$pageRS = array(
|
||||
'identite',
|
||||
'greffe_bilans',
|
||||
@ -381,54 +329,47 @@ class Scores_Ws_Server
|
||||
}
|
||||
|
||||
if ( intval($siren)!=0 && in_array($service, $pageRS) ) {
|
||||
$qb = $this->conn->createQueryBuilder();
|
||||
$qb->select(array('e.siren', 'e.nic', 'e.actif', 'e.siege', 'e.raisonSociale',
|
||||
'e.adr_cp', 'e.adr_ville', 'e.source', 'COUNT(r.siren) AS nb'))
|
||||
->from('jo.etablissements', 'e')
|
||||
->where('e.siren = :siren')->setParameter('siren', $siren)
|
||||
->rightJoin('e', 'jo.rncs_entrep', 'r', 'e.siren = r.siren');
|
||||
|
||||
$sql = $db->select()->from('jo.etablissements', array('siren', 'nic', 'actif', 'siege', 'raisonSociale',
|
||||
'adr_cp', 'adr_ville', 'source'))->where('siren=?', $siren);
|
||||
|
||||
if ( intval($siren)>1000 && intval($nic)>9 ) {
|
||||
$sql->where('nic=?', $nic);
|
||||
} elseif ( intval($siren)==0 && $ref>0 ) {
|
||||
$sql->where('id=?', $ref);
|
||||
} elseif ( intval($siren)>1000 ) {
|
||||
$sql->where('siege=1')->order('actif DESC')->order('nic DESC');
|
||||
if (intval($siren) > 1000 && intval($nic) > 9) {
|
||||
$qb->andWhere('e.nic = :nic')->setParameter('nic', $nic);
|
||||
} elseif (intval($siren) == 0 && $ref > 0) {
|
||||
$qb->andWhere('e.id = :id')->setParameter('id', $ref);
|
||||
} elseif (intval($siren) > 1000) {
|
||||
$qb->andWhere('e.siege = 1')->orderBy('e.actif', 'DESC')->orderBy('e.nic', 'DESC');
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
$result = $db->fetchRow($sql, null, Zend_Db::FETCH_OBJ);
|
||||
if ( $result !== null ) {
|
||||
//file_put_contents('lecture.log', print_r($result,1));
|
||||
$stmt = $qb->execute();
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$result = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
$dataInsert['raisonSociale'] = $result->raisonSociale;
|
||||
$dataInsert['cp'] = $result->adr_cp;
|
||||
$dataInsert['ville'] = $result->adr_ville;
|
||||
$dataInsert['source'] = $result->source;
|
||||
if ( $result->actif == 0 ) {
|
||||
if ($result->actif == 0) {
|
||||
$dataInsert['actifInsee'] = 0;
|
||||
} elseif ( intval($siren)>1000 ) {
|
||||
}
|
||||
elseif (intval($siren) > 1000) {
|
||||
$dataInsert['actifInsee'] = 1;
|
||||
$sql = $db->select()->from('jo.rncs_entrep', 'count(*) AS nb')->where('siren=?', $siren);
|
||||
$result = $db->fetchRow($sql, null, Zend_Db::FETCH_OBJ);
|
||||
if ( $result !== null ) {
|
||||
if ($result->nb>0 ) {
|
||||
if ($result->nb > 0 ) {
|
||||
$dataInsert['source'] = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(Zend_Db_Exception $e) {
|
||||
//@todo : log exception
|
||||
//file_put_contents('test.log', $e->getMessage());
|
||||
}
|
||||
} catch(\Doctrine\DBAL\DBALException $e) {}
|
||||
}
|
||||
|
||||
try {
|
||||
//file_put_contents('insert.log', print_r($dataInsert,1));
|
||||
$db->insert('sdv1.logs', $dataInsert);
|
||||
} catch(Zend_Db_Exception $e) {
|
||||
//@todo : log exception
|
||||
//file_put_contents('test.log', $e->getMessage());
|
||||
}
|
||||
$this->conn->insert('sdv1.logs', $dataInsert);
|
||||
} catch(\Doctrine\DBAL\DBALException $e) {}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -439,10 +380,8 @@ class Scores_Ws_Server
|
||||
*/
|
||||
public function authenticate($username = null, $password = null)
|
||||
{
|
||||
if ( $this->authenticated === false )
|
||||
{
|
||||
if ( empty($username) )
|
||||
{
|
||||
if ( $this->authenticated === false ) {
|
||||
if ( empty($username) ) {
|
||||
/**
|
||||
* @todo : Digest auth
|
||||
*/
|
||||
@ -450,8 +389,7 @@ class Scores_Ws_Server
|
||||
$username = $_SERVER['PHP_AUTH_USER'];
|
||||
$password = $_SERVER['PHP_AUTH_PW'];
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
/**
|
||||
* Auth Header in client
|
||||
* $ns = 'auth';
|
||||
@ -494,7 +432,8 @@ class Scores_Ws_Server
|
||||
$this->authenticated = $this->checkAuth($username, $password, $ip);
|
||||
if ( $this->authenticated === false ) {
|
||||
$this->sendError('0900');
|
||||
} elseif ( is_string($this->authenticated) ) {
|
||||
}
|
||||
elseif ( is_string($this->authenticated) ) {
|
||||
$this->sendError($this->authenticated);
|
||||
}
|
||||
}
|
||||
@ -506,7 +445,7 @@ class Scores_Ws_Server
|
||||
*/
|
||||
protected function permission($perm)
|
||||
{
|
||||
if ( !$this->checkPerm($perm) ){
|
||||
if ( !$this->checkPerm($perm) ) {
|
||||
$this->sendError('0902');
|
||||
}
|
||||
}
|
||||
@ -519,7 +458,7 @@ class Scores_Ws_Server
|
||||
{
|
||||
//Vérifier que l'utilisateur à le droit accesWS (clients/utilisateurs)
|
||||
$accesWs = $this->User->accesWS;
|
||||
if ($accesWs){
|
||||
if ($accesWs) {
|
||||
$this->sendError('0901');
|
||||
}
|
||||
}
|
||||
@ -537,7 +476,8 @@ class Scores_Ws_Server
|
||||
if ( in_array(strtolower($perm), $droits) ){
|
||||
$output = true;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if ( preg_match('/\b'.$perm.'\b/i', $droits) ){
|
||||
$output = true;
|
||||
}
|
||||
@ -551,11 +491,13 @@ class Scores_Ws_Server
|
||||
*/
|
||||
protected function checkEdition()
|
||||
{
|
||||
if ($this->User->idClient==1)
|
||||
if ($this->User->idClient == 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->checkPerm('edition'))
|
||||
if ($this->checkPerm('edition')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -577,59 +519,62 @@ class Scores_Ws_Server
|
||||
/**
|
||||
* User information
|
||||
*/
|
||||
$userM = new Application_Model_Sdv1Utilisateurs();
|
||||
$sql = $userM->select()
|
||||
->setIntegrityCheck(false)
|
||||
->from(array('u'=>'utilisateurs'), array(
|
||||
try {
|
||||
$qb = $this->conn->createQueryBuilder();
|
||||
$qb->select(array(
|
||||
'u.login', 'u.id', 'u.email', 'u.password', 'u.idClient', 'u.typeCompte', 'u.actif',
|
||||
'u.filtre_ip', 'u.profil', 'u.civilite', 'u.nom', 'u.prenom', 'u.tel', 'u.fax',
|
||||
'u.mobile', 'u.pref', 'u.rechRefType', 'u.profil', 'u.nombreConnexions',
|
||||
'u.dateDerniereConnexion', 'u.droits', 'u.referenceParDefaut', 'u.nbReponses', 'u.lang',
|
||||
'u.formatMail', 'u.dateDebutCompte', 'u.dateFinCompte', 'u.accesWS', 'u.acceptationCGU'))
|
||||
->join(array('c'=>'clients'), 'u.idClient = c.id', array(
|
||||
'u.formatMail', 'u.dateDebutCompte', 'u.dateFinCompte', 'u.accesWS', 'u.acceptationCGU',
|
||||
'c.droits AS droitsClients', 'c.test AS clientTest', 'c.typeScore', 'c.timeout',
|
||||
))
|
||||
->joinLeft(array('s'=>'sdv1.utilisateurs_service'), 'u.login=s.login', array('Service AS serviceCode'))
|
||||
->joinLeft(array('v'=>'sdv1.clients_version'), 'u.idClient=v.clientId', array('version'))
|
||||
->where('u.actif=?', 1)
|
||||
->where('u.deleted=?', 0)
|
||||
->where('c.actif=?','Oui');
|
||||
's.Service AS serviceCode', 'v.version'))
|
||||
->from('sdv1.utilisateurs', 'u')
|
||||
->join('u', 'sdv1.clients', 'c', 'u.idClient = c.id')
|
||||
->leftJoin('u', 'sdv1.utilisateurs_service', 's', 'u.login=s.login')
|
||||
->leftJoin('u', 'sdv1.clients_version', 'v', 'u.idClient=v.clientId')
|
||||
->where('u.actif = 1')->andWhere('u.deleted = 0')->andWhere("c.actif = 'Oui'");
|
||||
|
||||
/**
|
||||
* Connexion avec login = email
|
||||
*/
|
||||
if (strstr($login, '@') !== false) {
|
||||
$sql->where('u.email=?', $login);
|
||||
$qb->andWhere('u.email = :email')->setParameter('email', $login);
|
||||
}
|
||||
/**
|
||||
* Connexion standard
|
||||
*/
|
||||
else {
|
||||
$sql->where('u.login=?', $login);
|
||||
}
|
||||
try {
|
||||
$resultId = $userM->fetchAll($sql);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
$c = Zend_Registry::get('config');
|
||||
file_put_contents($c->profil->path->shared.'/log/application.log',
|
||||
date('Y-m-d H:i:s').'- AUTH : '.$e->getMessage()."\n", FILE_APPEND);
|
||||
return '0000';
|
||||
$qb->andWhere('u.login = :login')->setParameter('login', $login);
|
||||
}
|
||||
$stmt = $qb->execute();
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {}
|
||||
|
||||
/**
|
||||
* No user, deleted or disable
|
||||
*/
|
||||
if ( null === $resultId ) {
|
||||
if ($stmt->rowCount() == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiple compte
|
||||
*/
|
||||
if ( count($resultId) > 1 ) {
|
||||
if ($stmt->rowCount() > 1) {
|
||||
return '0906';
|
||||
}
|
||||
|
||||
$result = $resultId[0];
|
||||
/**
|
||||
* Get Data
|
||||
*/
|
||||
try {
|
||||
$result = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {
|
||||
$c = Zend_Registry::get('config');
|
||||
file_put_contents($c->profil->path->shared.'/log/application.log',
|
||||
date('Y-m-d H:i:s').'- AUTH : '.$e->getMessage()."\n", FILE_APPEND);
|
||||
return '0000';
|
||||
}
|
||||
|
||||
/**
|
||||
* Date de debut de compte
|
||||
@ -816,6 +761,9 @@ class Scores_Ws_Server
|
||||
$this->User->droits[] = $droits;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//Inclure les droits du service ?
|
||||
}
|
||||
$this->User->droitsClients = $userInfos->droitsClients;
|
||||
$this->User->timeout = $timeout;
|
||||
$this->User->clientTest = $userInfos->clientTest;
|
||||
@ -844,11 +792,18 @@ class Scores_Ws_Server
|
||||
*/
|
||||
protected function authV2($userInfos, $credential, $ip)
|
||||
{
|
||||
$serviceM = new Application_Model_Sdv1ClientsServices();
|
||||
$sql = $serviceM->select()
|
||||
->where('IdClient=?', $userInfos->idClient)
|
||||
->where('Code=?', $userInfos->serviceCode);
|
||||
$result = $serviceM->fetchRow($sql);
|
||||
$result = null;
|
||||
try {
|
||||
$sql = "SELECT * FROM sdv1.clients_services
|
||||
WHERE IdClient = :client AND Code = :service";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('client', $userInfos->idClient);
|
||||
$stmt->bindValue('service', $userInfos->serviceCode);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$result = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
}
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {}
|
||||
|
||||
// Aucun service
|
||||
if ($result === null) {
|
||||
@ -935,7 +890,10 @@ class Scores_Ws_Server
|
||||
}
|
||||
if ($this->authPassword($userInfos, $credential) === true) {
|
||||
if (count($this->User->droits) > 0) {
|
||||
$this->User->droits = $this->getAccessList($userInfos->idClient, $userInfos->serviceCode);
|
||||
$this->User->droits = $this->getAccessList(
|
||||
$userInfos->idClient,
|
||||
$userInfos->serviceCode
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -946,7 +904,10 @@ class Scores_Ws_Server
|
||||
}
|
||||
if ($this->authPasswordCrypt($userInfos, $credential) === true) {
|
||||
if (count($this->User->droits) > 0) {
|
||||
$this->User->droits = $this->getAccessList($userInfos->idClient, $userInfos->serviceCode);
|
||||
$this->User->droits = $this->getAccessList(
|
||||
$userInfos->idClient,
|
||||
$userInfos->serviceCode
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -956,7 +917,10 @@ class Scores_Ws_Server
|
||||
$ip = substr($credential,7);
|
||||
if ($this->authIP($ip) === true) {
|
||||
if (count($this->User->droits) > 0) {
|
||||
$this->User->droits = $this->getAccessList($userInfos->idClient, $userInfos->serviceCode);
|
||||
$this->User->droits = $this->getAccessList(
|
||||
$userInfos->idClient,
|
||||
$userInfos->serviceCode
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -1002,7 +966,9 @@ class Scores_Ws_Server
|
||||
*/
|
||||
protected function authPasswordCrypt($userInfos, $password)
|
||||
{
|
||||
if ( substr($password, 0, 4) == '$2y$' && strlen($password) == 60 && $password == $userInfos->password ) {
|
||||
if ( substr($password, 0, 4) == '$2y$'
|
||||
&& strlen($password) == 60
|
||||
&& $password == $userInfos->password ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1022,12 +988,16 @@ class Scores_Ws_Server
|
||||
{
|
||||
//Check IP
|
||||
if (!in_array($ip, $this->listApplicationIp)) {
|
||||
$serviceIPM = new Application_Model_Sdv1ClientsServicesIP();
|
||||
$sql = $serviceIPM->select(true)->columns('IP')
|
||||
->where('IdClient=?', $this->User->idClient)
|
||||
->where('Service=?', $this->User->serviceCode);
|
||||
$ipResult = $serviceIPM->fetchAll($sql);
|
||||
if (count($ipResult) > 0) {
|
||||
|
||||
try {
|
||||
$sql = "SELECT IP FROM sdv1.clients_services_ip
|
||||
WHERE IdClient = :client AND Service = :service";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('client', $this->User->idClient);
|
||||
$stmt->bindValue('service', $this->User->serviceCode);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$ipResult = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
//Validation
|
||||
$overallIpValidate = false;
|
||||
foreach ($ipResult->IP as $filtre) {
|
||||
@ -1054,7 +1024,10 @@ class Scores_Ws_Server
|
||||
if ( $overallIpValidate === false ) {
|
||||
return '0904';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1069,7 +1042,8 @@ class Scores_Ws_Server
|
||||
$authenticate = null;
|
||||
if ($result === false) {
|
||||
$authenticate = 'KO';
|
||||
} else if (is_string($result)) {
|
||||
}
|
||||
elseif (is_string($result)) {
|
||||
$authenticate = $result;
|
||||
}
|
||||
if ($authenticate !== null) {
|
||||
@ -1080,9 +1054,8 @@ class Scores_Ws_Server
|
||||
'dateInsert' => date('YmdHis'),
|
||||
);
|
||||
try {
|
||||
$authLogM = new Application_Model_Sdv1UtilisateursAuthLog();
|
||||
$authLogM->insert($data);
|
||||
} catch (Zend_Db_Exception $e) {}
|
||||
$this->conn->insert('sdv1.utilisateurs_auth_log', $data);
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1094,21 +1067,21 @@ class Scores_Ws_Server
|
||||
*/
|
||||
protected function getAccessList($clientId, $serviceCode)
|
||||
{
|
||||
$accesM = new Application_Model_Sdv1ClientsServicesDroits();
|
||||
$sql = $accesM->select(true)->columns(array('Acces'))
|
||||
->where('IdClient=?', $this->User->idClient)
|
||||
->where('Service=?', $this->User->serviceCode);
|
||||
try {
|
||||
$accesResult = $accesM->fetchAll($sql);
|
||||
} catch ( Zend_Db_Exception $e ) {
|
||||
}
|
||||
|
||||
$list = array();
|
||||
if (count($accesResult) > 0 ) {
|
||||
try {
|
||||
$sql = "SELECT Acces FROM sdv1.clients_services_droits
|
||||
WHERE IdClient = :client AND Service = :service";
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('client', $this->User->idClient);
|
||||
$stmt->bindValue('service', $this->User->serviceCode);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$accesResult = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
foreach ($accesResult as $row) {
|
||||
$list[] = $row->Acces;
|
||||
}
|
||||
}
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user