diff --git a/application/controllers/Adif.php b/application/controllers/Adif.php
index 5992bfdb..55f8c8c3 100644
--- a/application/controllers/Adif.php
+++ b/application/controllers/Adif.php
@@ -195,18 +195,22 @@ class adif extends CI_Controller {
$this->adif_parser->initialize();
$custom_errors = "";
+ $alladif=[];
while($record = $this->adif_parser->get_record())
{
if(count($record) == 0) {
break;
};
-
- $one_error = $this->logbook_model->import($record, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName'), false, $this->input->post('skipStationCheck'));
- if ($one_error != '') {
- $custom_errors.=$one_error."
";
- }
+ array_push($alladif,$record);
+ // $one_error = $this->logbook_model->import($record, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName'), false, $this->input->post('skipStationCheck'));
+ // if ($one_error != '') {
+ // $custom_errors.=$one_error."
";
+ // }
};
unlink('./uploads/'.$data['upload_data']['file_name']);
+ $record='';
+ $data='';
+ $custom_errors = $this->logbook_model->import_bulk($alladif, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName'), false, $this->input->post('skipStationCheck'));
} else {
$custom_errors='Station Profile not valid for User';
}
diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php
index bf659eea..47a76ee4 100755
--- a/application/models/Logbook_model.php
+++ b/application/models/Logbook_model.php
@@ -3077,6 +3077,16 @@ function lotw_last_qsl_date($user_id) {
return '1900-01-01 00:00:00.000';
}
+ function import_bulk($records, $station_id = "0", $skipDuplicate = false, $markClublog = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $markHrd = false,$skipexport = false, $operatorName = false, $apicall = false, $skipStationCheck = false) {
+ $custom_errors='';
+ foreach ($records as $record) {
+ $one_error = $this->logbook_model->import($record, $station_id, $skipDuplicate, $markClublog, $markLotw,$dxccadif, $markQrz, $markHrd, $skipexport, $operatorName, $apicall, $skipStationCheck);
+ if ($one_error != '') {
+ $custom_errors.=$one_error."
";
+ }
+ }
+ return $custom_errors;
+ }
/*
* $skipDuplicate - used in ADIF import to skip duplicate checking when importing QSOs
* $markLoTW - used in ADIF import to mark QSOs as exported to LoTW when importing QSOs