mirror of
https://github.com/magicbug/Cloudlog
synced 2026-08-13 17:49:35 -04:00
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.
This commit is contained in:
parent
1ebb3a9942
commit
adf658903b
1 changed files with 10 additions and 1 deletions
|
|
@ -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') == "") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue