mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-11-09 19:20:09 +01:00
fix fgetcsv deprecation and apply pending DB migrations
This commit is contained in:
1 parent
126703f340
commit
5c00886db6
3 files changed
+7
-5
No files matched your search
@@ -48,10 +48,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {
|
||||
}
|
||||
|
||||
// Skip first two rows (empty and headers)
|
||||
fgetcsv($handle); // Empty row
|
||||
$headers = fgetcsv($handle); // Header row
|
||||
fgetcsv($handle); // Description row
|
||||
$headers = fgetcsv($handle); // Actual column names
|
||||
fgetcsv($handle, 0, ',', '"', ''); // Empty row
|
||||
$headers = fgetcsv($handle, 0, ',', '"', ''); // Header row
|
||||
fgetcsv($handle, 0, ',', '"', ''); // Description row
|
||||
$headers = fgetcsv($handle, 0, ',', '"', ''); // Actual column names
|
||||
|
||||
// Map CSV columns
|
||||
$columnMap = [
|
||||
@@ -99,7 +99,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {
|
||||
|
||||
// Process each row
|
||||
$lineNumber = 5; // Start after headers
|
||||
while (($row = fgetcsv($handle)) !== false) {
|
||||
while (($row = fgetcsv($handle, 0, ',', '"', '')) !== false) {
|
||||
$lineNumber++;
|
||||
|
||||
// Skip empty rows
|
||||
|
||||
Reference in new issue
Block a user