From 04d09b5783308e5fd3df7fd423bb9e2d7cb53745 Mon Sep 17 00:00:00 2001 From: int2001 Date: Sat, 22 Jul 2023 06:00:02 +0000 Subject: [PATCH] Check DXCC also for spotted plus a little errorhandling --- application/models/Logbook_model.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index ff03b16f..20f85036 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -4025,9 +4025,15 @@ class Logbook_model extends CI_Model { $minutes += $spotage->i; $singlespot->age=$minutes; if ($minutes<=$maxage) { - $dxcc=$this->dxcc_lookup($singlespot->spotter,date('Ymd', time())); - $singlespot->dxcc_spotter=$dxcc; - if ($de != '') { + if (!(property_exists($singlespot,'dxcc_spotted'))) { // Check if we already have dxcc of spotted + $dxcc=$this->dxcc_lookup($singlespot->spotted,date('Ymd', time())); + $singlespot->dxcc_spotted=$dxcc; + } + if (!(property_exists($singlespot,'dxcc_spotter'))) { // Check if we already have dxcc of spotter + $dxcc=$this->dxcc_lookup($singlespot->spotter,date('Ymd', time())); + $singlespot->dxcc_spotter=$dxcc; + } + if ( ($de != '') && (array_key_exists('cont',$dxcc)) ){ if ($de == $dxcc['cont']) { $singlespot->worked_call = ($this->check_if_callsign_worked_in_logbook($singlespot->spotted, $logbooks_locations_array, $singlespot->band) == 1); array_push($spotsout,$singlespot);