From 330bf1e2923cb49ec0b8e6a9f42a2235c987cdcf Mon Sep 17 00:00:00 2001 From: jprochazka Date: Fri, 20 May 2016 16:16:34 -0400 Subject: [PATCH] Fix to remove special character from N-NUMBER heading. --- build/portal/html/admin/import.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/build/portal/html/admin/import.php b/build/portal/html/admin/import.php index 14f4240..02f9e45 100644 --- a/build/portal/html/admin/import.php +++ b/build/portal/html/admin/import.php @@ -36,7 +36,14 @@ $common = new common(); $master = fopen('../import/MASTER.txt', 'r'); - $heading = fgetcsv($master, 0, ','); + $headings = fgetcsv($master, 675, ','); + + // Remove the special character in front of N-NUMBER. + foreach ($headings as &$heading) { + if (strpos($heading, 'N-NUMBER') !== false) { + $heading = "N-NUMBER"; + } + } $recordsUpdated = 0; $recordsInserted = 0; @@ -44,9 +51,9 @@ $dbh = $common->pdoOpen(); // Update existing or insert new records from the FAA MASTER DATABASE. - while($column = fgetcsv($master, 0, ',')) - { - $column = array_combine($heading, $column); + while($column = fgetcsv($master, 675, ',')) { + + $column = array_combine($headings, $column); if (!is_null($column['N-NUMBER'])) { // Check if the N-NUMBER already exists in the database.