Fix to remove special character from N-NUMBER heading.

pull/212/head
jprochazka 2016-05-20 16:16:34 -04:00
rodzic 3121c63c09
commit 330bf1e292
1 zmienionych plików z 11 dodań i 4 usunięć

Wyświetl plik

@ -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.