From 1b8ebfa90c0c7cb4c9ef1c3f2f73aaaa6d709449 Mon Sep 17 00:00:00 2001 From: DB4SCW Date: Tue, 26 Nov 2024 11:01:39 +0000 Subject: [PATCH] add info about imported contests during adif import --- application/controllers/Adif.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/application/controllers/Adif.php b/application/controllers/Adif.php index 7ead333e8..0d8d93328 100644 --- a/application/controllers/Adif.php +++ b/application/controllers/Adif.php @@ -225,10 +225,24 @@ class adif extends CI_Controller { $this->adif_parser->initialize(); $custom_errors = ""; $alladif=[]; + $contest_qso_infos = []; while($record = $this->adif_parser->get_record()) { + + //overwrite the contest id if user chose a contest in UI if ($contest != '') { - $record['contest_id']=$contest; + $record['contest_id'] = $contest; } + + //check if contest_id exists in record and extract all found contest_ids + if(array_key_exists('contest_id', $record)){ + $contest_id = $record['contest_id']; + if(array_key_exists($contest_id, $contest_qso_infos)){ + $contest_qso_infos[$contest_id] += 1; + }else{ + $contest_qso_infos[$contest_id] = 1; + } + } + if(count($record) == 0) { break; }; @@ -265,6 +279,7 @@ class adif extends CI_Controller { log_message("Error","ADIF End"); $data['adif_errors'] = $custom_errors; $data['skip_dupes'] = $this->input->post('skipDuplicate'); + $data['imported_contests'] = $contest_qso_infos; $data['page_title'] = __("ADIF Imported"); $this->load->view('interface_assets/header', $data);