Skip to content

Commit

Permalink
convert export to excel compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
AUDUL committed Dec 8, 2023
1 parent 7ce7e8d commit b36c9de
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bundle/Controller/Admin/ExportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ private function generate(Connection $connection, string $sql, array $parameters
fputcsv($csv, ['Courriel', 'Prénom', 'Nom', 'Sexe', 'Date de naissance', 'Téléphone', 'Code postal', 'Ville', 'Etat', 'Pays', 'Profession', 'Société', 'status'], ';');

foreach ($connection->iterateAssociative($sql, $parameters) as $user) {
array_walk(
$user,
function (&$entry) {
$entry = iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $entry);
}
);
fputcsv($csv, $user, ';');
}
fclose($csv);
Expand Down

0 comments on commit b36c9de

Please sign in to comment.