223 lines
5.2 KiB
PHP
223 lines
5.2 KiB
PHP
<?php
|
|
class Enrichissement
|
|
{
|
|
/**
|
|
* Déclaration des colonnes de la table de données pour la transposition
|
|
* siren + nic + presentRcs
|
|
*/
|
|
protected $columns = array(
|
|
'id' => array(), //Non utilisé
|
|
'source' => array(),
|
|
'source_id' => array(),
|
|
'triCode' => array(),
|
|
'autre_id' => array(),
|
|
'siren' => array(), //Obligatoire
|
|
'nic' => array(), //Obligatoire
|
|
'actif' => array(
|
|
'values' => array(
|
|
'1' => "actif",
|
|
'0' => "inactif",
|
|
)
|
|
),
|
|
'siege' => array(
|
|
'values' => array(
|
|
'1' => "Etablissement Siege",
|
|
'0' => "Etablissement Secondaire",
|
|
)
|
|
),
|
|
'raisonSociale' => array(), //Raison Sociale
|
|
'enseigne' => array(), //Enseigne
|
|
'sigle' => array(), //Sigle
|
|
'identite_pre' => array(),
|
|
'marques' => array(),
|
|
'adr_num' => array(), //Adresse
|
|
'adr_btq' => array(), //Adresse
|
|
'adr_typeVoie' => array(), //Adresse
|
|
'adr_libVoie' => array(), //Adresse
|
|
'adr_comp' => array(), //Adresse - Complément
|
|
'adr_cp' => array(), //Adresse
|
|
'adr_ville' => array(), //Adresse
|
|
'adr_dep' => array(), //Département | Code Commune
|
|
'adr_com' => array(), //Code Commune
|
|
'tel' => array(), //Telephone
|
|
'fax' => array(), //Fax
|
|
'cj' => array(), //Forme Juridique
|
|
'capital' => array(),
|
|
'capitalDev' => array(),
|
|
'capitalSrc' => array(),
|
|
'ape_etab' => array(),
|
|
'ape_entrep' => array(),
|
|
'age_entrep' => array(),
|
|
'age_etab' => array(),
|
|
'tca' => array(),
|
|
'tcaexp' => array(),
|
|
'teff_entrep' => array(),
|
|
'teff_etab' => array(),
|
|
'rang' => array(),
|
|
'web' => array(),
|
|
'mail' => array(),
|
|
'adrDom' => array(),
|
|
'lieuAct' => array(),
|
|
'actifEco' => array(),
|
|
'presentRcs' => array(),
|
|
'procolHisto' => array(),
|
|
'tvaIntraCle' => array(),
|
|
'tvaIntraValide' => array(),
|
|
'ape4_etab' => array(),
|
|
'ape4_entrep' => array(),
|
|
'NaceEtab' => array(),
|
|
'NaceEntrep' => array(),
|
|
'dateCrea_etab' => array(),
|
|
'dateCrea_ent' => array(),
|
|
'dateImmat' => array(),
|
|
'eff_entrep' => array(),
|
|
'eff_etab' => array(),
|
|
'distSP' => array(),
|
|
'achPost' => array(),
|
|
'rivoli' => array(),
|
|
'dirCiv' => array(),
|
|
'dirNom' => array(),
|
|
'dirPrenom' => array(),
|
|
'dirDateNaiss' => array(),
|
|
'dirFct' => array(),
|
|
'nbEtab' => array(),
|
|
'nbMPubli' => array(),
|
|
'sirenGrp' => array(),
|
|
'nbActio' => array(),
|
|
'nbPart' => array(),
|
|
'bilType' => array(),
|
|
'bilAnnee' => array(),
|
|
'bilCloture' => array(),
|
|
'bilDuree' => array(),
|
|
'bilTca' => array(),
|
|
'bilEE' => array(),
|
|
'bilFL' => array(),
|
|
'bilFK' => array(),
|
|
'bilFR' => array(),
|
|
'bilGF' => array(),
|
|
'bilGP' => array(),
|
|
'bilGU' => array(),
|
|
'bilGW' => array(),
|
|
'bilHD' => array(),
|
|
'bilHH' => array(),
|
|
'bilHL' => array(),
|
|
'bilHM' => array(),
|
|
'bilHN' => array(),
|
|
'bilYP' => array(),
|
|
'avisCs' => array(),
|
|
|
|
);
|
|
|
|
/**
|
|
* Déclaration des champs exportable
|
|
* @var unknown_type
|
|
*/
|
|
protected $fields = array(
|
|
'actif' => array(
|
|
'label' => "Actif",
|
|
'column' => 'actif',
|
|
),
|
|
'siege' => array(
|
|
'label' => "Type d'établissement",
|
|
'column' => 'siege'
|
|
),
|
|
'raisonSociale' => array(
|
|
'label' => "Raison Sociale",
|
|
'column' => 'raisonSociale'
|
|
),
|
|
'enseigne' => array(
|
|
'label' => "Enseigne",
|
|
'column' => 'enseigne'
|
|
),
|
|
'sigle' => array(
|
|
'label' => "Sigle",
|
|
'column' => 'sigle'
|
|
),
|
|
'identite_pre' => array(
|
|
'label' => "Identite Précédente",
|
|
'column' => 'identite_pre'
|
|
),
|
|
'marques' => array(
|
|
'label' => "Marques déposées",
|
|
'column' => 'marques'
|
|
),
|
|
'adresse' => array(
|
|
'label' => 'Adresse',
|
|
'column' => 'adresse',
|
|
'sql' => "CONCAT_WS(' ', adr_num, adr_btq, adr_typeVoie, adr_libVoie) as adresse",
|
|
),
|
|
'adr_comp' => array(
|
|
'label' => 'Adresse - Complément',
|
|
'column' => 'adr_comp',
|
|
),
|
|
'codepostal' => array(
|
|
'label' => 'Code Postal',
|
|
'column' => 'adr_cp',
|
|
),
|
|
'departement' => array(
|
|
'label' => 'Département',
|
|
'column' => 'adr_dep',
|
|
),
|
|
'ville' => array(
|
|
'label' => 'Ville',
|
|
'column' => 'adr_ville',
|
|
),
|
|
'codecommune' => array(
|
|
'label' => 'Code Commune',
|
|
'column' => 'codecom',
|
|
'sql' => 'CONCAT(adr_dep, adr_com) as codecom',
|
|
),
|
|
'tel' => array(
|
|
'label' => "Téléphone",
|
|
'column' => 'tel'
|
|
),
|
|
'fax' => array(
|
|
'label' => "Fax",
|
|
'column' => 'fax'
|
|
),
|
|
'cj' => array(
|
|
'label' => "Forme juridique",
|
|
'column' => 'cj'
|
|
),
|
|
'dirigeant' => array(
|
|
'label' => "Dirigeant",
|
|
'column' => 'dirigeant',
|
|
'sql' => "CONCAT_WS(' ', dirCiv, dirNom, dirPrenom) AS dirigeant",
|
|
),
|
|
'dirigeantFct' => array(
|
|
'label' => "Dirigeant - Fonction",
|
|
'column' => 'dirFct',
|
|
),
|
|
'dirigeantnaiss' => array(
|
|
'label' => "Dirigeant - Date de naissance",
|
|
'column' => 'dirFct'
|
|
),
|
|
'nafetablissement' => array(
|
|
'label' => "Code NAF Etablissement",
|
|
'column' => 'ape4_etab'
|
|
),
|
|
'nafentreprise' => array(
|
|
'label' => "Code NAF Entreprise",
|
|
'column' => 'ape4_entrep'
|
|
),
|
|
|
|
);
|
|
|
|
public function __construct(){}
|
|
|
|
public function getFields()
|
|
{
|
|
return $this->fields;
|
|
}
|
|
|
|
public function getColumnValue($key)
|
|
{
|
|
if ( array_key_exists($key, $this->columns) ) {
|
|
if ( array_key_exists('values', $this->columns[$key]) && count($this->columns[$key]['values'])>0 ){
|
|
return $this->columns[$key]['values'];
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
} |