issue #0001575: encoding UTF-8
This commit is contained in:
parent
4c30dae316
commit
1f1e217a45
@ -51,8 +51,8 @@ $frontendOptions = array(
|
||||
'automatic_serialization' => true
|
||||
);
|
||||
$backendOptions = array();
|
||||
$cache = Zend_Cache::factory('Core','Apc', $frontendOptions, $backendOptions);
|
||||
Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
|
||||
//$cache = Zend_Cache::factory('Core','Apc', $frontendOptions, $backendOptions);
|
||||
//Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
|
||||
|
||||
//Définition bdd
|
||||
try {
|
||||
@ -147,6 +147,8 @@ $tabEntete[] = 'teff_etabLib';
|
||||
$tabEntete[] = 'teff_entrepLib';
|
||||
$tabEnteteLabel[] = 'Libelle Tranche Effectif Etablissement ';
|
||||
$tabEnteteLabel[] = 'Libelle Tranche Effectif Entreprise';
|
||||
//Convert
|
||||
$tabEnteteLabel = array_map('utf8_decode',array_values($tabEnteteLabel));
|
||||
//Pour chaque identifiant traiter les données
|
||||
$row = 0;
|
||||
$fp = fopen($path.'/'.$outFile, 'w');
|
||||
@ -166,7 +168,6 @@ if ($opts->id) {
|
||||
|
||||
|
||||
$model = $sql;
|
||||
//print_r($model);exit;
|
||||
//Date de debut de traitement.
|
||||
$dateStart = date('YmdHms');
|
||||
$db = Zend_Db_Table::getDefaultAdapter();
|
||||
@ -190,7 +191,6 @@ foreach ($identifiants as $key=>$siret )
|
||||
$sql->where($where);
|
||||
try {
|
||||
$result = $db->fetchAll($sql);
|
||||
//print_r($result);exit;
|
||||
} catch(Exception $e) {
|
||||
echo $e;
|
||||
}
|
||||
@ -204,12 +204,14 @@ foreach ($result as $tabData) {
|
||||
if (array_key_exists('siege', $tabData)) {
|
||||
($tabData[siege])?$tabData[siege]='Siège':$tabData[siege]='Secondaire';
|
||||
}
|
||||
|
||||
//Trier pour la sortie
|
||||
$tabSortie = array();
|
||||
foreach($tabEntete as $key){
|
||||
$tabSortie[] = isset($tabData[$key]) ? $tabData[$key] : '';
|
||||
}
|
||||
//Convert
|
||||
$tabSortie = array_map('utf8_decode',array_values($tabSortie));
|
||||
|
||||
fputcsv($fp, $tabSortie, ',', '"');
|
||||
|
||||
//Mise à jour des lignes traitées dans la base
|
||||
|
Loading…
Reference in New Issue
Block a user