Added native os notifications

This commit is contained in:
2026-07-02 15:57:57 +10:00
parent 027437dc9b
commit 4c98b33fb4
4 changed files with 15 additions and 8 deletions
@@ -169,6 +169,7 @@ class FlightImportController extends Controller
'flight_class' => $flightToReconcile->flight_class !== null ? (int) $flightToReconcile->flight_class : null,
'seat_type' => $flightToReconcile->seat_type !== null ? (int) $flightToReconcile->seat_type : null,
'flight_reason' => $flightToReconcile->flight_reason !== null ? (int) $flightToReconcile->flight_reason : null,
'seat_number' => $flightToReconcile->seat_number ?? '',
'airline_options' => $this->getPossibleAirlines($flightToReconcile->airline ?? ''),
'to_options' => $this->getPossibleAirports($flightToReconcile->to ?? ''),
'from_options' => $this->getPossibleAirports($flightToReconcile->from ?? ''),
@@ -380,7 +381,7 @@ class FlightImportController extends Controller
$handle = fopen($path, 'r');
fgetcsv($handle);
fgetcsv($handle); // skip blank first line
// Read and normalise header row
$headers = array_map(
@@ -389,9 +390,6 @@ class FlightImportController extends Controller
);
\Log::debug('CSV headers', $headers);
$firstRow = fgetcsv($handle);
\Log::debug('First row', $firstRow ?? ['empty']);
\Log::debug('Header count: ' . count($headers) . ', Row count: ' . count($firstRow ?? []));
$map = [
'date' => 'date',
@@ -415,6 +413,11 @@ class FlightImportController extends Controller
$imported = 0;
while (($row = fgetcsv($handle)) !== false) {
if ($imported === 0) {
\Log::debug('First row', $row);
\Log::debug('Header count: ' . count($headers) . ', Row count: ' . count($row));
}
if (count($row) !== count($headers)) {
continue; // skip malformed rows
}