16 hours ago, skyguyt said:
Worked great, thank you!
you’re welcome
17 hours ago, ProAvia said:
But you will loose the ability to update the schedules. And if you just delete the schedules to upload a full set again, if the DB is set to auto-increment the record number (which is the usual default), all your old data will be screwed up. For example - you upload 100 routes to a blank schedules table, so record number 1-100. Now, since you can’t update any longer, you delete the old schedules and add the new/updated ones back. The record number will start with 101 - so any data stored in other tables referencing the record numbers of the previous schedules won’t be able to locate that data cause you deleted it.
Seems way more trouble than it’s worth - unless you want to manually edit the DB directly.
as ProAvia said, you will loose that feature, the best thing you can do is import de DB directly from phpmyadmin (or other mysql gestor) instead of use import function in admin panel, this will ignore that rule (because the duplicate check is created with a php if rule so in data table this rule doesn’t exist).
Other thing you can do is add to your csv a column (last column) called id and put the id of the schedule here with the format of autoincrement (starting by 1 and so…)
in line 359 of admin/module/Import/Import.php you should add $id variable
// list fields: $code = $fields[0]; $flightnum = $fields[1]; $depicao = $fields[2]; $arricao = $fields[3]; $route = $fields[4]; $aircraft = $fields[5]; $flightlevel = $fields[6]; $distance = $fields[7]; $deptime = $fields[8]; $arrtime = $fields[9]; $flighttime = $fields[10]; $notes = $fields[11]; $price = $fields[12]; $flighttype = $fields[13]; $daysofweek = $fields[14]; $enabled = $fields[15]; $week1 = $fields[16]; $week2 = $fields[17]; $week3 = $fields[18]; $week4 = $fields[19]; $id = $fields[20];
in line 437 of admin/module/Import/Import.php in $data array replace the following (adding ‘id’ value to the data):
$data = array( 'code' =\> $code, 'flightnum' =\> $flightnum, 'depicao' =\> $depicao, 'arricao' =\> $arricao, 'route' =\> $route, 'aircraft' =\> $ac, 'flightlevel' =\> $flightlevel, 'distance' =\> $distance, 'deptime' =\> $deptime, 'arrtime' =\> $arrtime, 'flighttime' =\> $flighttime, 'daysofweek' =\> $daysofweek, 'notes' =\> $notes, 'enabled' =\> $enabled, 'price' =\> $price, 'flighttype' =\> $flighttype, 'week1' =\> $week1, 'week2' =\> $week2, 'week3' =\> $week3, 'week4' =\> $week4, 'id' =\> $id );