ifnex/04_Laravel/inspect_awb.php
Kazem Alghasi 5874568c63 feat(shipment): implement PDF generation for AWB, invoice, and labels
Introduce PDF generation capabilities for shipments using laravel-dompdf.
This includes a new service layer, dedicated controller, and routes
to handle the generation of Air Waybills (AWB), Invoices, and Shipping
Labels.

- Add `PdfService` to encapsulate PDF generation logic.
- Add `ShipmentPdfController` to handle PDF download requests.
- Integrate `barryvdh/laravel-dompdf` dependency.
- Add Filament header actions to view shipment pages for quick PDF access.
- Update order success view to provide direct download links for documents.
- Add label methods to `ShipmentDirection` and `ShipmentType` enums.
- Update project status documentation to reflect initial PDF implementation.
2026-08-04 09:20:23 +03:30

35 lines
1.4 KiB
PHP

<?php
require 'C:/xampp/htdocs/IFNEX-Logistics/04_Laravel/vendor/autoload.php';
$reader = new \PhpOffice\PhpSpreadsheet\IOFactory();
$spreadsheet = $reader->load('C:/xampp/htdocs/IFNEX-Logistics/04_Laravel/storage/app/public/01KYWGVNKS5TNMN37RV77PCYNZ.xlsx');
$sheets = $spreadsheet->getSheetNames();
echo "=== ALL SHEET NAMES ===" . PHP_EOL;
echo implode(', ', $sheets) . PHP_EOL . PHP_EOL;
// Inspect AWB sheet
echo "=== AWB SHEET ===" . PHP_EOL;
$awbSheet = $spreadsheet->getSheetByName('AWB');
if ($awbSheet) {
echo "Dimensions: " . $awbSheet->calculateWorksheetDimensions() . PHP_EOL;
echo "Highest row: " . $awbSheet->getHighestRow() . PHP_EOL;
echo "Highest column: " . $awbSheet->getHighestColumn() . PHP_EOL;
echo PHP_EOL;
// Print first 50 rows
for ($row = 1; $row <= min(50, $awbSheet->getHighestRow()); $row++) {
$rowData = [];
for ($col = 1; $col <= 15; $col++) {
$cell = $awbSheet->getCellByColumnAndRow($col, $row);
$value = $cell->getValue();
if ($value !== null) {
$rowData[] = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::stringFromColumnIndex($col) . $row . "=" . json_encode($value);
}
}
if (!empty($rowData)) {
echo "Row $row: " . implode(" | ", $rowData) . PHP_EOL;
}
}
} else {
echo "AWB sheet not found!" . PHP_EOL;
}