add info about imported contests during adif import

This commit is contained in:
DB4SCW
2024-11-26 11:01:39 +00:00
parent 6bfcf39d76
commit 1b8ebfa90c

View File

@@ -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);