From c2a389cb99bc2ca88eb76351ffbf29690bc1c181 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Wed, 4 Dec 2019 15:16:56 +0000 Subject: [PATCH] When importing only check QSO exists for that station profile --- application/models/Logbook_model.php | 15 +++++++-------- application/views/station_profile/index.php | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 8aed6401..444b6398 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -847,7 +847,7 @@ class Logbook_model extends CI_Model { } /* Used to check if the qso is already in the database */ - function import_check($datetime, $callsign, $band) { + function import_check($datetime, $callsign, $band) { $this->db->select('COL_TIME_ON, COL_CALL, COL_BAND'); $this->db->where('COL_TIME_ON >= DATE_ADD(DATE_FORMAT("'.$datetime.'", \'%Y-%m-%d %H:%i\' ), INTERVAL -15 MINUTE )'); @@ -1251,12 +1251,17 @@ class Logbook_model extends CI_Model { $input_lotw_qslsdate = NULL; } - + if($station_id == "" || $station_id == "0") { + $CI =& get_instance(); + $CI->load->model('Stations'); + $station_id = $CI->Stations->find_active(); + } if (isset($record['call'])){ $this->db->where('COL_CALL', $record['call']); } $this->db->where('COL_TIME_ON', $time_on); + $this->db->where('station_id', $station_id); $check = $this->db->get($this->config->item('table_name')); if ($check->num_rows() <= 0) @@ -1418,12 +1423,6 @@ class Logbook_model extends CI_Model { 'COL_WEB' => (!empty($record['web'])) ? $record['web'] : '' ); - if($station_id == "" || $station_id == "0") { - $CI =& get_instance(); - $CI->load->model('Stations'); - $station_id = $CI->Stations->find_active(); - } - if($station_id != "0") { $station_result = $this->db->where('station_id', $station_id) ->get('station_profile'); diff --git a/application/views/station_profile/index.php b/application/views/station_profile/index.php index 15e9ef69..0cb1ec72 100644 --- a/application/views/station_profile/index.php +++ b/application/views/station_profile/index.php @@ -63,7 +63,7 @@ = 1) { ?> - Reassign + Reassign