From 946f11d538dbaca1dba354bb394593f249de74f2 Mon Sep 17 00:00:00 2001
From: Andreas <6977712+AndreasK79@users.noreply.github.com>
Date: Fri, 30 Jul 2021 09:06:53 +0200
Subject: [PATCH] [QSO Entry] Maritime Mobile identification fix
---
application/models/Cq.php | 4 ++--
application/models/Logbook_model.php | 20 ++++++++++++++++++--
application/views/qso/index.php | 2 +-
3 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/application/models/Cq.php b/application/models/Cq.php
index d193c699..c22735a0 100644
--- a/application/models/Cq.php
+++ b/application/models/Cq.php
@@ -239,7 +239,7 @@ class CQ extends CI_Model{
function getSummaryByBand($band, $station_id) {
$sql = "SELECT count(distinct thcv.col_cqz) as count FROM " . $this->config->item('table_name') . " thcv";
- $sql .= " where station_id = " . $station_id;
+ $sql .= " where station_id = " . $station_id . ' and col_cqz > 0';
if ($band == 'SAT') {
$sql .= " and thcv.col_prop_mode ='" . $band . "'";
@@ -258,7 +258,7 @@ class CQ extends CI_Model{
function getSummaryByBandConfirmed($band, $station_id){
$sql = "SELECT count(distinct thcv.col_cqz) as count FROM " . $this->config->item('table_name') . " thcv";
- $sql .= " where station_id = " . $station_id;
+ $sql .= " where station_id = " . $station_id . ' and col_cqz > 0';
if ($band == 'SAT') {
$sql .= " and thcv.col_prop_mode ='" . $band . "'";
diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php
index f6d773c2..77bb818b 100755
--- a/application/models/Logbook_model.php
+++ b/application/models/Logbook_model.php
@@ -2082,7 +2082,14 @@ class Logbook_model extends CI_Model {
if (preg_match('/(^KG4)[A-Z09]{3,}/', $call)) { // KG4/ and KG4 5 char calls are Guantanamo Bay. If 6 char, it is USA
$call = "K";
- }
+ } elseif (preg_match_all('/^((\d|[A-Z])+\/)?((\d|[A-Z]){3,})(\/(\d|[A-Z])+)?(\/(\d|[A-Z])+)?$/', $call, $matches)) {
+ if ($matches[5][0] == '/MM') {
+ $row['adif'] = 0;
+ $row['entity'] = 'None';
+ $row['cqz'] = 0;
+ return array($row['adif'], $row['entity'], $row['cqz']);
+ }
+ }
$len = strlen($call);
@@ -2127,7 +2134,16 @@ class Logbook_model extends CI_Model {
if (preg_match('/(^KG4)[A-Z09]{3,}/', $call)) { // KG4/ and KG4 5 char calls are Guantanamo Bay. If 6 char, it is USA
$call = "K";
- }
+ } elseif (preg_match_all('/^((\d|[A-Z])+\/)?((\d|[A-Z]){3,})(\/(\d|[A-Z])+)?(\/(\d|[A-Z])+)?$/', $call, $matches)) {
+ if ($matches[5][0] == '/MM') {
+ $row['adif'] = 0;
+ $row['entity'] = 'None';
+ $row['cqz'] = 0;
+ $row['long'] = '0';
+ $row['lat'] = '0';
+ return $row;
+ }
+ }
$len = strlen($call);
diff --git a/application/views/qso/index.php b/application/views/qso/index.php
index 97607510..3a2fa808 100755
--- a/application/views/qso/index.php
+++ b/application/views/qso/index.php
@@ -258,7 +258,7 @@