From 8f839674b553f387710d6509f3f6a9c16d4ed1b9 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Tue, 2 Mar 2021 01:49:03 +0000 Subject: [PATCH] Add headers to csv file. #539 --- .../GenerateCustomerSourceReportCommand.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Command/GenerateCustomerSourceReportCommand.php b/src/Command/GenerateCustomerSourceReportCommand.php index a3f85c4a..893fe6ed 100644 --- a/src/Command/GenerateCustomerSourceReportCommand.php +++ b/src/Command/GenerateCustomerSourceReportCommand.php @@ -77,6 +77,23 @@ class GenerateCustomerSourceReportCommand extends Command 'year' => $year, ]); + // add header rows + fputcsv($fp, [ + 'Customer ID', + 'First Name', + 'Last Name', + 'Mobile Phone', + 'Landline', + 'Office Phone', + 'Fax', + 'Email Address', + 'Vehicle Manufacturer', + 'Vehicle Make', + 'Model Year', + 'Plate Number', + 'Source', + ]); + // go through rows while ($row = $stmt->fetch(PDO::FETCH_NUM)) {