remise à jours des fichiers
This commit is contained in:
parent
5fdd0a9e0a
commit
e12080b214
@ -12,25 +12,27 @@ Class Ciblage
|
||||
public $nb_results = 5000;
|
||||
public $max_results = 500000;
|
||||
|
||||
public $mysql_host = '192.168.78.230';
|
||||
public $mysql_user = 'sphinx';
|
||||
public $mysql_password = 'indexer';
|
||||
public $mysql_database = 'jo';
|
||||
|
||||
public $sphinx_host = '192.168.78.252';
|
||||
public $sphinx_port = 3312;
|
||||
public $sphinx_match = SPH_MATCH_EXTENDED2;
|
||||
public $sphinx_sort = SPH_SORT_EXTENDED;
|
||||
|
||||
public function __construct($structure, $need = false)
|
||||
{
|
||||
$configuration = Zend_Registry::get('configuration');
|
||||
|
||||
//Instantiation Sphinx
|
||||
$this->sphinx = new SphinxClient();
|
||||
$this->sphinx->SetServer($configuration->sphinx->host, intval($configuration->sphinx->port));
|
||||
$this->sphinx->SetServer($this->sphinx_host, $this->sphinx_port);
|
||||
$this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED2);
|
||||
$this->sphinx->ResetFilters();
|
||||
foreach($structure as $key => $valeur)
|
||||
{
|
||||
foreach($structure as $key => $valeur) {
|
||||
if (method_exists($this, $key)) {
|
||||
if(is_array($valeur)) {
|
||||
if($valeur[0] != "" and $valeur[0] != 'tous'){
|
||||
if($valeur[0] != "" and $valeur[0] != 'tous')
|
||||
$this->$key($valeur);
|
||||
}
|
||||
} else {
|
||||
if($valeur != 'tous' and $valeur != "")
|
||||
$this->$key($valeur);
|
||||
@ -224,7 +226,7 @@ Class Ciblage
|
||||
$valeur = $format[2].$format[1].$format[0];
|
||||
} else {
|
||||
$format1 = explode('/', $valeur[0]);
|
||||
$format2 = explode('/', $valeur[0]);
|
||||
$format2 = explode('/', $valeur[1]);
|
||||
|
||||
$valeur[0] = $format1[2].$format1[1].$format1[0];
|
||||
$valeur[1] = $format2[2].$format2[1].$format2[0];
|
||||
@ -239,7 +241,7 @@ Class Ciblage
|
||||
$valeur = $format[2].$format[1].$format[0];
|
||||
} else {
|
||||
$format1 = explode('/', $valeur[0]);
|
||||
$format2 = explode('/', $valeur[0]);
|
||||
$format2 = explode('/', $valeur[1]);
|
||||
|
||||
$valeur[0] = $format1[2].$format1[1].$format1[0];
|
||||
$valeur[1] = $format2[2].$format2[1].$format2[0];
|
||||
@ -358,7 +360,8 @@ Class Ciblage
|
||||
}
|
||||
|
||||
protected function avisCs($valeur) {
|
||||
$this->setFilte('avisCs', $valeur);
|
||||
$valeur = explode('-', $valeur);
|
||||
$this->setFilter('avisCs', $valeur);
|
||||
}
|
||||
|
||||
protected function bilFS($valeur) {
|
||||
|
@ -4,16 +4,16 @@ Class Fields
|
||||
protected $fields = array
|
||||
(
|
||||
'siege' => array(
|
||||
'label' => 'Sociétés Sieges',
|
||||
'label' => 'Type d\'établissement',
|
||||
'fields' => array(
|
||||
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
|
||||
'select' => array('value' => array('1' => 'Sièges uniquement', '0' => 'Secondaires')),
|
||||
),
|
||||
'famille' => 'entreprise',
|
||||
'activated' => true,
|
||||
'type' => 'select'
|
||||
),
|
||||
'sirenGrp' => array(
|
||||
'label' => 'Société appartenant à un groupe',
|
||||
'label' => 'Présence d\'un groupe',
|
||||
'fields' => array(
|
||||
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
|
||||
),
|
||||
@ -22,7 +22,7 @@ Class Fields
|
||||
'type' => 'select'
|
||||
),
|
||||
'tel' => array(
|
||||
'label' => 'Contenant un Telephone',
|
||||
'label' => 'Téléphone renseigné',
|
||||
'fields' => array(
|
||||
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
||||
),
|
||||
@ -31,7 +31,7 @@ Class Fields
|
||||
'type' => 'select'
|
||||
),
|
||||
'fax' => array(
|
||||
'label' => 'Contenant un Fax',
|
||||
'label' => 'Télécopie renseignée',
|
||||
'fields' => array(
|
||||
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
||||
),
|
||||
@ -41,7 +41,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'web' => array(
|
||||
'label' => 'Contenant un site internet',
|
||||
'label' => 'Site Web renseigné',
|
||||
'fields' => array(
|
||||
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
||||
),
|
||||
@ -51,7 +51,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'mail' => array(
|
||||
'label' => 'Contenant une adresse email',
|
||||
'label' => 'Email de contact renseigné',
|
||||
'fields' => array(
|
||||
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
||||
),
|
||||
@ -61,9 +61,9 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'presentRcs' => array(
|
||||
'label' => 'Société présente au RNCS',
|
||||
'label' => 'Etablissement présent au RNCS',
|
||||
'fields' => array(
|
||||
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
||||
'select' => array('value' => array('1' => 'Etablissement présent au RNCS', '0' => 'Non'))
|
||||
),
|
||||
'famille' => 'entreprise',
|
||||
'activated' => true,
|
||||
@ -71,7 +71,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'adrDom' => array(
|
||||
'label' => 'A une adresse de domiciliation',
|
||||
'label' => 'Adresse de domiciliation',
|
||||
'fields' => array(
|
||||
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
||||
),
|
||||
@ -81,9 +81,9 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'dirNom' => array(
|
||||
'label' => 'Contenant le nom du principal dirigeant',
|
||||
'label' => 'Nom du principal dirigeant',
|
||||
'fields' => array(
|
||||
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
||||
'select' => array('value' => array('1' => 'Principal dirigeant renseigné', '0' => 'Non'))
|
||||
),
|
||||
'famille' => 'entreprise',
|
||||
'activated' => true,
|
||||
@ -102,13 +102,13 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'nbMPubli' => array(
|
||||
'label' => 'Nombre de marches publiques remportes',
|
||||
'label' => 'Marchés publiques remportés',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '1000'))
|
||||
'select' => array('value' => array('1' => 'Oui', '0' => 'Non'))
|
||||
),
|
||||
'famille' => 'entreprise',
|
||||
'activated' => true,
|
||||
'type' => 'interval',
|
||||
'type' => 'select',
|
||||
'class' => null
|
||||
),
|
||||
'dateCrea_ent' => array(
|
||||
@ -122,7 +122,7 @@ Class Fields
|
||||
'class' => 'datepicker'
|
||||
),
|
||||
'dateCrea_etab' => array(
|
||||
'label' => 'Date de création de l\'etablissement',
|
||||
'label' => 'Date de création de l\'établissement',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '1000'))
|
||||
),
|
||||
@ -153,7 +153,7 @@ Class Fields
|
||||
),
|
||||
// economique
|
||||
'ape_etab' => array(
|
||||
'label' => 'Codes NAF Etablissement',
|
||||
'label' => 'Activité de l\'établissement (Code NAF)',
|
||||
'fields' => array(
|
||||
'text' => array('value' => null),
|
||||
'textarea' => array('value' => null)
|
||||
@ -166,7 +166,7 @@ Class Fields
|
||||
'title' => 'Selection des codes NAF etablissement'
|
||||
),
|
||||
'ape_entrep' => array(
|
||||
'label' => 'Codes NAF Entreprise',
|
||||
'label' => 'Activité de l\'entreprise (Code NAF)',
|
||||
'fields' => array(
|
||||
'text' => array('value' => null),
|
||||
'textarea' => array('value' => null)
|
||||
@ -201,7 +201,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'age_etab' => array(
|
||||
'label' => 'L\'age de l\'etablissement',
|
||||
'label' => 'Age de l\'entreprise',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => null)
|
||||
),
|
||||
@ -211,7 +211,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'age_entrep' => array(
|
||||
'label' => 'L\'age de l\'entreprise',
|
||||
'label' => 'Age de l\'établissement',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => null)
|
||||
),
|
||||
@ -247,7 +247,7 @@ Class Fields
|
||||
'class' => null,
|
||||
),
|
||||
'teff_etab' => array(
|
||||
'label' => 'Tranche d\'effectif de l\'etablissement',
|
||||
'label' => 'Tranche d\'effectif de l\'établissement',
|
||||
'fields' => array(
|
||||
'intervalSelect' => array(
|
||||
'value' => array(
|
||||
@ -275,7 +275,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'nbEtab' => array(
|
||||
'label' => 'Nombre d\'établassiment',
|
||||
'label' => 'Nombre d\'établissements',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
@ -324,8 +324,8 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
//geographique
|
||||
'adr_cp' => array(
|
||||
'label' => 'Codes postaux',
|
||||
'adr_com' => array(
|
||||
'label' => 'Code commune Insee',
|
||||
'fields' => array(
|
||||
'text' => array('value' => null),
|
||||
'textarea' => array('value' => null)
|
||||
@ -337,27 +337,19 @@ Class Fields
|
||||
'action' => 'geographique',
|
||||
'title' => 'Localisation'
|
||||
),
|
||||
'adr_com' => array(
|
||||
'label' => 'Code commune Insee',
|
||||
'fields' => array(
|
||||
'text' => array('value' => null),
|
||||
'textarea' => array('value' => null)
|
||||
),
|
||||
'famille' => 'geographique',
|
||||
'activated' => true,
|
||||
'type' => 'textarea',
|
||||
'class' => null
|
||||
),
|
||||
//juridique
|
||||
'cj' => array(
|
||||
'label' => 'Forme Juridique',
|
||||
'fields' => array(
|
||||
'select' => array('value' => array('1' => '1', '2' => '2', '3' => '3')),
|
||||
'text' => array('value' => null),
|
||||
'textarea' => array('value' => null)
|
||||
),
|
||||
'famille' => 'juridique',
|
||||
'activated' => true,
|
||||
'type' => 'select',
|
||||
'class' => null
|
||||
'type' => 'textarea',
|
||||
'class' => null,
|
||||
'action' => 'juridique',
|
||||
'title' => 'Forme Juridique'
|
||||
),
|
||||
'actifEco' => array(
|
||||
'label' => 'Établissement économiquement actif',
|
||||
@ -370,7 +362,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'procolHisto' => array(
|
||||
'label' => 'Procédure collective dans l\'historique.',
|
||||
'label' => 'Présence procédure collective dans histo',
|
||||
'fields' => array(
|
||||
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
|
||||
),
|
||||
@ -380,7 +372,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'tvaIntraValide' => array(
|
||||
'label' => 'Numéro de TVA Valide',
|
||||
'label' => 'Numéro de TVA intracommunautaire valide',
|
||||
'fields' => array(
|
||||
'select' => array('value' => array('1' => 'Oui', '0' => 'Non')),
|
||||
),
|
||||
@ -403,7 +395,7 @@ Class Fields
|
||||
'bilType' => array(
|
||||
'label' => 'Type du dernier bilan',
|
||||
'fields' => array(
|
||||
'select' => array('value' => array('I' => 'Inconnue', 'E' => 'Estimé', 'R' => 'Réel')),
|
||||
'select' => array('value' => array('I' => 'Inconnue', 'R' => 'Réel', 'E' => 'Estimé')),
|
||||
),
|
||||
'famille' => 'financier',
|
||||
'activated' => true,
|
||||
@ -413,31 +405,58 @@ Class Fields
|
||||
'avisCs' => array(
|
||||
'label' => 'Informations de paiements',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => null),
|
||||
'select' => array('value' => array(
|
||||
'' => 'Risque indéterminé',
|
||||
'00' => 'Aucun risque resencé',
|
||||
'10' => 'Présence d\'impayé(s)',
|
||||
'15' => 'Présence de privilèges',
|
||||
'23-29-39-43' => 'Risque moyen',
|
||||
'21-26-28' => 'Risque important',
|
||||
'31-50' => 'Risque très important',
|
||||
'24' => 'Risque dans le groupe')
|
||||
),
|
||||
),
|
||||
'famille' => 'financier',
|
||||
'activated' => true,
|
||||
'type' => 'interval',
|
||||
'type' => 'select',
|
||||
'class' => null
|
||||
),
|
||||
'bilDuree' => array(
|
||||
'label' => 'Durée du dernier bilan en mois',
|
||||
'fields' => array(
|
||||
'interval' => array('value'=> null),
|
||||
'intervalSelect' => array(
|
||||
'value' => array(
|
||||
array(0, 5),
|
||||
array(5, 10),
|
||||
array(10, 15),
|
||||
array(20, 23),
|
||||
)
|
||||
)
|
||||
),
|
||||
'famille' => 'financier',
|
||||
'activated' => true,
|
||||
'type' => 'interval',
|
||||
'type' => 'intervalSelect',
|
||||
'class' => null
|
||||
),
|
||||
'bilTca' => array(
|
||||
'label' => 'Tranche de CA issue du bilan',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => null),
|
||||
),
|
||||
'select' => array('value' => array(
|
||||
'0' => 'Non déterminée',
|
||||
'1' => 'de 500K€ à1M€',
|
||||
'2' => 'de 1 à 2 ME',
|
||||
'3' => 'de 2 à 5 ME',
|
||||
'4' => 'de 5 à 10 ME',
|
||||
'5' => 'de 10 à 20 ME',
|
||||
'6' => 'de 20 à 50 ME',
|
||||
'7' => '50 à 100 ME',
|
||||
'8' => 'de 100 à 200 ME',
|
||||
'9' => '+ de 200 ME'
|
||||
)),
|
||||
),
|
||||
'famille' => 'financier',
|
||||
'activated' => true,
|
||||
'type' => 'interval',
|
||||
'type' => 'select',
|
||||
'class' => null
|
||||
),
|
||||
'bilAnnee' => array(
|
||||
@ -461,7 +480,7 @@ Class Fields
|
||||
'class' => 'datepicker'
|
||||
),
|
||||
'bilEE' => array(
|
||||
'label' => 'Total bilan',
|
||||
'label' => 'Total bilan (EE)',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
@ -471,7 +490,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'bilFL' => array(
|
||||
'label' => 'CA total',
|
||||
'label' => 'CA total (FL)',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
@ -481,7 +500,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'bilFK' => array(
|
||||
'label' => 'Chiffre d\'affaires Export',
|
||||
'label' => 'Chiffre d\'affaires Export (FK)',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
@ -491,7 +510,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'bilFR' => array(
|
||||
'label' => 'Produits d\'Exploitation',
|
||||
'label' => 'Produits d\'Exploitation (FR)',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
@ -501,7 +520,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'bilGF' => array(
|
||||
'label' => 'Charges d\'Exploitation',
|
||||
'label' => 'Charges d\'Exploitation (GF)',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
@ -511,17 +530,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'bilGP' => array(
|
||||
'label' => 'Produits Financiers',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
'famille' => 'financier',
|
||||
'activated' => true,
|
||||
'type' => 'interval',
|
||||
'class' => null
|
||||
),
|
||||
'bilGP' => array(
|
||||
'label' => 'Charges Financières',
|
||||
'label' => 'Charges Financières (GP)',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
@ -531,7 +540,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'bilGW' => array(
|
||||
'label' => 'RCAI (résultat courant avant impôt)',
|
||||
'label' => 'R.C.A.I - Résultat courant av. impôt (GW)',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
@ -541,7 +550,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'bilHD' => array(
|
||||
'label' => 'Produits Exceptionnels',
|
||||
'label' => 'Produits Exceptionnels (HD)',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
@ -551,7 +560,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'bilHH' => array(
|
||||
'label' => 'Charges Exceptionnels',
|
||||
'label' => 'Charges Exceptionnels (HH)',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
@ -561,7 +570,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'bilHL' => array(
|
||||
'label' => 'Total des Produits',
|
||||
'label' => 'Total des Produits (HL)',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
@ -571,7 +580,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'bilHM' => array(
|
||||
'label' => 'Total des Charges',
|
||||
'label' => 'Total des Charges (HM)',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
@ -581,7 +590,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'bilHN' => array(
|
||||
'label' => 'Résultat',
|
||||
'label' => 'Résultat (HN)',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
@ -591,7 +600,7 @@ Class Fields
|
||||
'class' => null
|
||||
),
|
||||
'bilYP' => array(
|
||||
'label' => 'Effectif de l\'entreprise au dernier bilan (poste YP)',
|
||||
'label' => 'Effectif salarié (YP)',
|
||||
'fields' => array(
|
||||
'interval' => array('value' => array('0', '10000000'))
|
||||
),
|
||||
@ -611,16 +620,18 @@ Class Fields
|
||||
|
||||
foreach($session->getCriteres() as $key => $item)
|
||||
{
|
||||
if($this->fields[$key]['type'] == 'interval' or
|
||||
$this->fields[$key]['type'] == 'intervalSelect' or
|
||||
$this->fields[$key]['type'] == 'textarea' and
|
||||
empty($this->fields[$key]['action']))
|
||||
{
|
||||
$values[$key] = explode(',', $item);
|
||||
} else if (!empty($this->fields[$key]['action'])) {
|
||||
$values[$key] = $this->selectArbo($key, $item);
|
||||
} else {
|
||||
$values[$key] = $item;
|
||||
if($item != '') {
|
||||
if($this->fields[$key]['type'] == 'interval' or
|
||||
$this->fields[$key]['type'] == 'intervalSelect' or
|
||||
$this->fields[$key]['type'] == 'textarea' and
|
||||
empty($this->fields[$key]['action']))
|
||||
{
|
||||
$values[$key] = explode(',', $item);
|
||||
} else if (!empty($this->fields[$key]['action'])) {
|
||||
$values[$key] = $this->selectArbo($key, $item);
|
||||
} else {
|
||||
$values[$key] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ($values);
|
||||
@ -637,18 +648,76 @@ Class Fields
|
||||
foreach($nafs as $naf)
|
||||
$values = array_merge($values, $this->nafArbo($name, $naf));
|
||||
break;
|
||||
case 'adr_cp':
|
||||
case 'adr_com':
|
||||
$valeurs = explode(',', $valeur);
|
||||
foreach($valeurs as $element) {
|
||||
$array = $this->deptArbo($name, $element);
|
||||
$array = $this->localisationArbo($name, $element);
|
||||
if(!empty($array))
|
||||
$values = array_merge($values, $array);
|
||||
}
|
||||
break;
|
||||
case 'cj':
|
||||
$valeurs = explode(',', $valeur);
|
||||
foreach($valeurs as $valeur)
|
||||
$values = array_merge($values, $this->fj($name, $valeur));
|
||||
}
|
||||
return ($values);
|
||||
}
|
||||
|
||||
protected function fj($name, $valeur)
|
||||
{
|
||||
$table = new Table_Formejuridiques();
|
||||
|
||||
if(strlen($valeur) < 5) {
|
||||
$sql = $table->select('formejuridique', array('fjCode'))
|
||||
->where('fjCode LIKE "'.$valeur.'%"');
|
||||
} else
|
||||
$sql = $table->select('formejuridique', array('fjCode'))
|
||||
->where('fjCode = "'.$valeur.'"');
|
||||
$result = $table->fetchAll($sql)->toArray();
|
||||
|
||||
foreach ($result as $code) {
|
||||
if(strlen($code['fjCode']) > 2) {
|
||||
$return[] = $code['fjCode'];
|
||||
}
|
||||
}
|
||||
return ($return);
|
||||
}
|
||||
|
||||
protected function localisationArbo($name, $valeur)
|
||||
{
|
||||
if(strlen($valeur) == 3) {
|
||||
switch($valeur[0]) {
|
||||
case 'R':
|
||||
$table = new Table_Departements();
|
||||
$sql = $table->select()
|
||||
->from('departements')
|
||||
->join(array('cp' => 'codepostaux'), 'cp.codepos LIKE CONCAT(departements.numdep, "%")', array('INSEE'))
|
||||
->where('codeRegionInsee ='.substr($valeur, 1, strlen($valeur)))
|
||||
->setIntegrityCheck(false);
|
||||
$result = $table->fetchAll($sql)->toArray();
|
||||
foreach ($result as $res) {
|
||||
$return[] = $res['INSEE'];
|
||||
}
|
||||
break;
|
||||
case 'D':
|
||||
$table = new Table_Departements();
|
||||
$sql = $table->select()
|
||||
->from('departements')
|
||||
->join(array('cp' => 'codepostaux'), 'cp.codepos LIKE CONCAT(departements.numdep, "%")', array('INSEE'))
|
||||
->where('numdep ='.substr($valeur, 1, strlen($valeur)))
|
||||
->setIntegrityCheck(false);
|
||||
$result = $table->fetchAll($sql)->toArray();
|
||||
foreach ($result as $res) {
|
||||
$return[] = $res['INSEE'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else
|
||||
return (array($valeur));
|
||||
return ($return);
|
||||
}
|
||||
|
||||
protected function deptArbo($name, $valeur)
|
||||
{
|
||||
if(strlen($valeur) < 5){
|
||||
|
Loading…
Reference in New Issue
Block a user