Merge branch 'develop'

This commit is contained in:
Michael RICOIS 2017-01-19 12:17:57 +01:00
commit 51285f3793
2 changed files with 10 additions and 3 deletions

View File

@ -91,17 +91,20 @@ class Enrichissement
'creaetab' => array(
'label' => "Date de création de l'établissement",
'column' => 'dateCrea_etab',
'sql' => "IF(dateCrea_etab = 0,'',CONCAT_WS('-',SUBSTRING(dateCrea_etab,0,4),SUBSTRING(dateCrea_etab,4,2),SUBSTRING(dateCrea_etab,6,2))) AS creaetab",
'sql' => "IF(dateCrea_etab = 0, '', CONCAT_WS('-',
SUBSTR(dateCrea_etab,1,4), SUBSTR(dateCrea_etab,5,2), SUBSTR(dateCrea_etab,7,2))) AS creaetab",
),
'creaent' => array(
'label' => "Date de création de l'entreprise",
'column' => 'dateCrea_ent',
'sql' => "IF(dateCrea_ent=0,'',CONCAT_WS('-',SUBSTRING(dateCrea_ent,0,4),SUBSTRING(dateCrea_ent,4,2),SUBSTRING(dateCrea_ent,6,2))) AS creaent",
'sql' => "IF(dateCrea_ent=0, '', CONCAT_WS('-',
SUBSTR(dateCrea_ent,1,4), SUBSTR(dateCrea_ent,5,2), SUBSTR(dateCrea_ent,7,2))) AS creaent",
),
'dateimmat' => array(
'label' => "Date d'immatriculation de l'entreprise",
'column' => 'dateImmat',
'sql' => "IF(dateImmat=0,'',CONCAT_WS('-',SUBSTRING(dateImmat,0,4),SUBSTRING(dateImmat,4,2),SUBSTRING(dateImmat,6,2))) AS dateImmat",
'sql' => "IF(dateImmat=0, '', CONCAT_WS('-',
SUBSTR(dateImmat,1,4), SUBSTR(dateImmat,5,2), SUBSTR(dateImmat,7,2))) AS dateImmat",
),
'cj' => array(
'label' => "Code Forme juridique",

View File

@ -159,6 +159,10 @@ foreach ( $dataProfil as $item ) {
$outFile = $profil->login.'_'.$id.'_'.date('YmdHis').'.csv';
$fp = fopen($path.'/'.$outFile, 'w');
if ($fp === false) {
echo "Error ".$path."/".$outFile."\n"; exit;
}
// --- Ecrire l'entete
if ( count($tabEnteteLabel) > 0 ) {
fputcsv($fp, $tabEnteteLabel, ',', '"');