2013-11-06 14:29:20 +00:00
< ? php
2016-01-27 21:10:45 +00:00
class Metier_Partenaires_MGreffes
2014-06-02 08:41:24 +00:00
{
2013-11-05 11:18:30 +00:00
public $iDb ;
2014-06-02 08:41:24 +00:00
public function __construct ( $db = null )
{
if ( $db === null ) {
2016-07-18 15:21:48 +02:00
$this -> iDb = new Metier_Util_Db ();
2014-06-02 08:41:24 +00:00
} else {
$this -> iDb = $db ;
}
2013-11-06 14:29:20 +00:00
}
2016-07-12 16:33:02 +02:00
/**
* Retourne Identite Greffe
* @ param string $siren
*/
public function getIdentite ( $siren )
2013-11-06 14:29:20 +00:00
{
2015-05-20 15:14:38 +00:00
$id = false ;
2015-07-03 13:28:52 +00:00
2016-07-12 16:33:02 +02:00
$res = $this -> iDb -> select ( 'jo.greffes_identite' ,
'id, siren, nom, nomCommercial, adresse, adresse2, cp, ville, enseigne, siege, fj, fjLib, naf, nafLib, numRC, numRC2, typeRCS, numGreffe, libGreffe, dateCreation, dateRadiation, dateCloture, ca, res, eff, dateInsert' ,
" siren= $siren " );
if ( count ( $res ) > 0 ) {
2013-11-05 11:18:30 +00:00
$ent = $res [ 0 ];
$id = $ent [ 'id' ];
$siren = $ent [ 'siren' ];
$siege = $ent [ 'siege' ];
$nom = $ent [ 'nom' ];
$nomCom = $ent [ 'nomCommercial' ];
$ens = $ent [ 'ens' ];
$adr = $ent [ 'adresse' ];
$adr2 = $ent [ 'adresse2' ];
$cp = $ent [ 'cp' ];
$ville = $ent [ 'ville' ];
$cj = $ent [ 'fj' ];
$cjLib = $ent [ 'fjLib' ];
$naf = $ent [ 'naf' ];
$nafLib = $ent [ 'nafLib' ];
$numRC = $ent [ 'numRC' ];
$numRC2 = $ent [ 'numRC2' ];
$greffe_num = $ent [ 'numGreffe' ];
$typeRCS = $ent [ 'typeRCS' ];
$dateCre = $ent [ 'dateCreation' ];
$dateRad = $ent [ 'dateRadiation' ];
$dateCloture = $ent [ 'dateCloture' ];
$dateInsert = $ent [ 'dateInsert' ];
2013-11-06 14:29:20 +00:00
}
2013-11-05 11:18:30 +00:00
2015-05-20 15:14:38 +00:00
if ( $id ) {
$tabRet = array (
'id' => $id , // A calculer après insert
'Pertinence' => 100 ,
'Siret' => $siren . '00000' ,
'Siege' => $siege ,
'Nom' => $nom ,
'Nom2' => $nomCom ,
2016-07-13 17:35:13 +02:00
'Sigle' => '' ,
2015-05-20 15:14:38 +00:00
'Enseigne' => $ens ,
'Adresse' => $adr ,
2016-07-13 17:35:13 +02:00
'Adresse2' => $adr2 ,
2015-05-20 15:14:38 +00:00
'CP' => $cp ,
'Ville' => $ville ,
2016-07-13 17:35:13 +02:00
'Tel' => '' ,
'Fax' => '' ,
2015-05-20 15:14:38 +00:00
'FJ' => $cj ,
'FJLib' => $cjLib ,
'Siren' => $siren ,
'Nic' => '00000' ,
'Actif' => 0 ,
'NafEtab' => $naf ,
'NafEtabLib' => $nafLib ,
'NafEnt' => $naf ,
'NafEntLib' => $nafLib ,
'NumRC' => $numRC ,
'NumRC2' => $numRC2 ,
'NumGreffe' => $greffe_num ,
'DateCreation' => $dateCre ,
'DateRadiation' => $dateRad ,
'DateCloture' => $dateCloture ,
'DateUpdate' => substr ( $dateInsert , 0 , 10 ),
);
return $tabRet ;
}
2013-11-05 11:18:30 +00:00
2015-05-20 15:14:38 +00:00
return false ;
2013-11-05 11:18:30 +00:00
}
/**
2016-07-12 16:33:02 +02:00
* Cession
* @ param string $siren
2015-07-03 13:28:52 +00:00
*/
public function getInfosCessions ( $siren )
{
$ret = $this -> iDb -> select ( 'jo.greffes_cessions' , 'id, siren, nom, libGreffe, inscrit, etat, dateImmat, dateJuge, dateConv, dateLJS, dateInventaire, dateBodacc, caDeclare, effectif, descriptif, pdfLink, pdfSize, pdfVer, pdfPage, descDateDepot, dateLimite, mandataire, dateInsert' , " siren= $siren " , false , MYSQL_ASSOC );
if ( count ( $ret ) > 0 ) {
$tabCes = $ret [ 0 ];
2016-01-22 10:20:16 +00:00
if ( count ( $ret ) > 1 ) {
$mail = new Metier_Common_Mail ();
$mail -> send ( 'debug@scores-decisions.com' , 'ylenaour@scores-decisions.com' , " classMGreffes.php : Debug getInfosCessions $siren " , " Plus de 1 cession pour ce siren " );
}
2016-07-12 16:33:02 +02:00
return array (
'cessJuge' => $tabCes [ 'etat' ],
'cessDateJuge' => $tabCes [ 'dateJuge' ],
'cessDateConv' => $tabCes [ 'dateConv' ],
'cessDateLJS' => $tabCes [ 'dateLJS' ],
'cessDateInv' => $tabCes [ 'dateInventaire' ],
'cessDateBod' => $tabCes [ 'dateBodacc' ],
'cessCAdec' => $tabCes [ 'caDeclare' ],
'cessEffectif' => $tabCes [ 'effectif' ],
'cessDesc' => $tabCes [ 'descriptif' ],
'cessDateDesc' => $tabCes [ 'descDateDepot' ],
'cessDateLim' => $tabCes [ 'dateLimite' ],
'cessMand' => $tabCes [ 'mandataire' ],
);
2015-07-03 13:28:52 +00:00
}
2016-07-12 16:33:02 +02:00
else {
return false ;
2015-07-03 13:28:52 +00:00
}
}
2014-06-02 08:41:24 +00:00
}