Improve DXCC ID assignment logic in Logbook_model

Refines how DXCC ID is set based on country and input values, ensuring correct assignment when country is provided and dxcc_id is zero. This helps prevent incorrect DXCC ID values during logbook entry creation.
这个提交包含在:
Peter Goodhall 2025-08-18 14:32:04 +01:00
父节点 1ebb3a9942
当前提交 adf658903b

查看文件

@ -99,10 +99,13 @@ class Logbook_model extends CI_Model
if ($this->input->post('country') == "") {
$dxcc = $this->check_dxcc_table(strtoupper(trim($callsign)), $datetime);
$country = ucwords(strtolower($dxcc[1]), "- (/");
$dxcc_id = $dxcc[0];
} else {
$country = $this->input->post('country');
}
if ($this->input->post('cqz') == "") {
$dxcc = $this->check_dxcc_table(strtoupper(trim($callsign)), $datetime);
if (empty($dxcc[2])) {
@ -123,7 +126,13 @@ class Logbook_model extends CI_Model
$dxcc_id = $dxcc[0];
}
} else {
$dxcc_id = $this->input->post('dxcc_id');
// if $country isn't empty
if (!empty($country) && $this->input->post('dxcc_id') == "0") {
$dxcc_id = $dxcc_id;
} else {
$dxcc_id = $this->input->post('dxcc_id');
}
}
if ($this->input->post('continent') == "") {