From 9153b18d06b4eb2b0acb208adaef4bc360764d6a Mon Sep 17 00:00:00 2001 From: Kim - DG9VH Date: Wed, 12 Jun 2019 20:01:59 +0200 Subject: [PATCH 1/9] Fixing bug with & in name of DXCC An & in the name of a DXCC causes the webserver to ERROR 500. --- application/views/awards/dxcc/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/awards/dxcc/index.php b/application/views/awards/dxcc/index.php index 7f356fdd..3dba19f4 100644 --- a/application/views/awards/dxcc/index.php +++ b/application/views/awards/dxcc/index.php @@ -36,7 +36,7 @@ if ($count == 0){ print(" "); }else{ - printf("%d", $country, $band, $count); + printf("%d", str_replace("&", "%26", $country), $band, $count); } } print(""); From 2af86a3fd8bcbf2bdd8800c2932d6330416224a2 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 13 Jun 2019 14:34:31 +0100 Subject: [PATCH 2/9] Roughly styled the edit box for new bootstrap (not finished) and added via --- application/controllers/Qso.php | 4 +- application/models/Logbook_model.php | 3 +- application/views/qso/edit.php | 178 ++++++++++++++++----------- assets/css/general.css | 4 + 4 files changed, 111 insertions(+), 78 deletions(-) diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index 1fe15d55..349e9c07 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -99,9 +99,7 @@ class QSO extends CI_Controller { if ($this->form_validation->run() == FALSE) { - $this->load->view('layout/mini_header', $data); - $this->load->view('qso/edit'); - $this->load->view('layout/mini_footer'); + $this->load->view('qso/edit', $data); } else { diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 42762be3..662e57d0 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -257,7 +257,8 @@ class Logbook_model extends CI_Model { 'COL_PROP_MODE' => $this->input->post('prop_mode'), 'COL_FREQ_RX' => $this->parse_frequency($this->input->post('freq_display_rx')), 'COL_STX_STRING' => $this->input->post('stx_string'), - 'COL_SRX_STRING' => $this->input->post('srx_string') + 'COL_SRX_STRING' => $this->input->post('srx_string'), + 'COL_QSL_VIA' => $this->input->post('qsl_via_callsign') ); $this->db->where('COL_PRIMARY_KEY', $this->input->post('id')); diff --git a/application/views/qso/edit.php b/application/views/qso/edit.php index 239efd44..f8ed38c5 100755 --- a/application/views/qso/edit.php +++ b/application/views/qso/edit.php @@ -1,28 +1,28 @@ - - - - - + - + + + + + + + + + + + + - - - - +
-

Delete QSO Delete

+

Delete QSO

@@ -152,102 +152,132 @@

QSLing

- - -
-
- - - - - - - - - + + + - - - - - - -
Sent - Recv
- + + + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+ +
+
+ - -
- - - - - - - -
Sent - Recv + + + +
+ +
+
-
-
- - - - - - - -
Sent + + +
+
+ +
+
Recv + + +
+ +
+
-
- + + + + + diff --git a/assets/css/general.css b/assets/css/general.css index ef03327c..77602427 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -102,4 +102,8 @@ TD.lotw{ .lotw-red{ color: #F00; font-size: 1.1em; +} + +.qso-edit-box { + padding: 10px; } \ No newline at end of file From c676a35b210d2a6f201551369c5fde4427ed2b29 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 13 Jun 2019 14:39:35 +0100 Subject: [PATCH 3/9] Shifted QSO notifications to the right panel rather than top to keep elements at the same height --- application/views/qso/index.php | 24 +++++++++++------------- assets/css/general.css | 4 ++++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 939417dc..86baffcc 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -1,17 +1,5 @@
- - - - - - - -
@@ -287,10 +275,20 @@
+ + + + + +
-

Previous Contacts

+

Previous Contacts

diff --git a/assets/css/general.css b/assets/css/general.css index 77602427..f317601d 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -106,4 +106,8 @@ TD.lotw{ .qso-edit-box { padding: 10px; +} + +.previous-qsos .card-title { + margin-bottom: 0px; } \ No newline at end of file From 8635724568d2bfca7f7b36f2acea808219a7884c Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 13 Jun 2019 18:09:21 +0100 Subject: [PATCH 4/9] Cleaned up the radio interface delete button --- application/controllers/Radio.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Radio.php b/application/controllers/Radio.php index 2f7b6238..1d574108 100755 --- a/application/controllers/Radio.php +++ b/application/controllers/Radio.php @@ -50,7 +50,7 @@ } $phpdate = strtotime($row->timestamp); echo "".date('H:i:s d-m-y', $phpdate)."" ; - echo "id."\" >\"Delete\"" ; + echo "id."\" class=\"btn btn-danger\"> Delete" ; echo ""; } } else { From 4b24dbf3aa3909b8e067ea7cb9f12f7c2756a43a Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 13 Jun 2019 18:12:18 +0100 Subject: [PATCH 5/9] Fixed API Key test link --- application/views/api/help.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/api/help.php b/application/views/api/help.php index 3cef3234..c49c3604 100644 --- a/application/views/api/help.php +++ b/application/views/api/help.php @@ -43,7 +43,7 @@ ?> - status); ?> Test + status); ?> Test From c8368795911f87ae65e670487e881aff35734cfb Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 13 Jun 2019 18:15:51 +0100 Subject: [PATCH 6/9] Made country information a badge with blue background just to see if its useful Changed country text to a badge layout per Bootstrap, thinking being that these could be used for showing things like LOTW and other statuses --- application/views/qso/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 86baffcc..f66e993a 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -60,7 +60,7 @@
- +
From ad76b88ac193f3134ae3e33e4dc83ec52c25eb29 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 13 Jun 2019 18:35:14 +0100 Subject: [PATCH 7/9] Added field for SOTA Ref and its shown in the popups --- application/models/Logbook_model.php | 3 +++ application/views/qso/edit.php | 5 +++++ application/views/qso/index.php | 5 +++++ application/views/view_log/qso.php | 15 +++++++++++++++ assets/css/general.css | 11 ++++++++++- 5 files changed, 38 insertions(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 662e57d0..6f4517ec 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -80,6 +80,7 @@ class Logbook_model extends CI_Model { 'COL_LON' => null, 'COL_DXCC' => $this->input->post('dxcc_id'), 'COL_CQZ' => $this->input->post('cqz'), + 'COL_SOTA_REF' => trim($this->input->post('sota_ref')), ); if (strpos(trim($this->input->post('locator')), ',') !== false) { @@ -161,6 +162,7 @@ class Logbook_model extends CI_Model { 'COL_LON' => null, 'COL_DXCC' => $this->input->post('dxcc_id'), 'COL_CQZ' => $this->input->post('cqz'), + 'COL_SOTA_REF' => trim($this->input->post('sota_ref')), ); // If station profile has been provided fill in the fields @@ -253,6 +255,7 @@ class Logbook_model extends CI_Model { 'COL_LOTW_QSL_SENT' => $this->input->post('lotw_sent'), 'COL_LOTW_QSL_RCVD' => $this->input->post('lotw_recv'), 'COL_IOTA' => $this->input->post('iota_ref'), + 'COL_SOTA_REF' => $this->input->post('sota_ref'), 'COL_QTH' => $this->input->post('qth'), 'COL_PROP_MODE' => $this->input->post('prop_mode'), 'COL_FREQ_RX' => $this->parse_frequency($this->input->post('freq_display_rx')), diff --git a/application/views/qso/edit.php b/application/views/qso/edit.php index f8ed38c5..fedeac0c 100755 --- a/application/views/qso/edit.php +++ b/application/views/qso/edit.php @@ -143,6 +143,11 @@ + + SOTA + + + Country diff --git a/application/views/qso/index.php b/application/views/qso/index.php index f66e993a..8a4de5d8 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -209,6 +209,11 @@ e.g: EU-005
+ +
+ + e.g: GM/NS-001 +
diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index 9861c8d8..5273b82e 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -98,6 +98,21 @@ COL_COUNTRY; ?> + + COL_IOTA != null) { ?> + + IOTA Ref: + COL_IOTA; ?> + + + + COL_SOTA_REF != null) { ?> + + SOTA Ref: + COL_SOTA_REF; ?> + + + COL_QSL_SENT == "Y" || $row->COL_QSL_RCVD == "Y") { ?>

QSL Info

diff --git a/assets/css/general.css b/assets/css/general.css index f317601d..bf3ee992 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -59,6 +59,14 @@ text-transform: uppercase; } +.qso_panel .iota_ref { + text-transform: uppercase; +} + +.qso_panel .sota_ref { + text-transform: uppercase; +} + .workedGrid { border-color: green; } @@ -110,4 +118,5 @@ TD.lotw{ .previous-qsos .card-title { margin-bottom: 0px; -} \ No newline at end of file +} + From c3bb33ff03de295a224e80d84354a7975a63284b Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 13 Jun 2019 18:40:02 +0100 Subject: [PATCH 8/9] SOTA list displayed in awards based on the SOTA field in the add qso being filled in correctly --- application/models/Sota.php | 4 ++-- application/views/awards/sota/index.php | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/application/models/Sota.php b/application/models/Sota.php index a08d9fd9..9088115a 100644 --- a/application/models/Sota.php +++ b/application/models/Sota.php @@ -8,8 +8,8 @@ class Sota extends CI_Model { } function get_all() { - $this->db->order_by("COL_COMMENT", "ASC"); - $this->db->like('COL_COMMENT', 'SOTA:'); + $this->db->order_by("COL_SOTA_REF", "ASC"); + $this->db->where('COL_SOTA_REF !=', ''); return $this->db->get($this->config->item('table_name')); } diff --git a/application/views/awards/sota/index.php b/application/views/awards/sota/index.php index 9b1149e0..ceb378fa 100644 --- a/application/views/awards/sota/index.php +++ b/application/views/awards/sota/index.php @@ -24,15 +24,7 @@ - COL_COMMENT); - foreach($pieces as $val) { - if (strpos($val,'SOTA:') !== false) { - //echo $val; - echo $rest = substr($val, 5); // returns "cde" - } - } - ?> + COL_SOTA_REF; ?> COL_TIME_ON); echo date('d/m/y', $timestamp); ?> - COL_TIME_ON); echo date('H:i', $timestamp); ?> COL_CALL; ?> From ec5c356cc07e755c2f3403c6b44b04d18358ae71 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Fri, 14 Jun 2019 00:14:39 +0100 Subject: [PATCH 9/9] Added a map to the Add QSO page --- application/controllers/Logbook.php | 31 +++++++++- application/models/Logbook_model.php | 28 +++++++++ application/views/interface_assets/footer.php | 59 +++++++++++++++++-- application/views/qso/index.php | 7 +++ assets/css/general.css | 10 ++++ 5 files changed, 128 insertions(+), 7 deletions(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 3182bb4e..71a19756 100755 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -70,7 +70,7 @@ class Logbook extends CI_Controller { "workedBefore" => false ]; - $return['dxcc'] = $this->find_dxcc($callsign); + $return['dxcc'] = $this->dxcheck($callsign); $return['partial'] = $this->partial($callsign); // Do we have local data for the Callsign? @@ -82,6 +82,11 @@ class Logbook extends CI_Controller { $return['callsign_iota'] = $this->logbook_model->call_iota($callsign); $return['bearing'] = $this->bearing($return['callsign_qra']); $return['workedBefore'] = $this->worked_grid_before($return['callsign_qra']); + + if ($return['callsign_qra'] != "") { + $return['latlng'] = $this->qralatlng($return['callsign_qra']); + } + echo json_encode($return, JSON_PRETTY_PRINT); return; } @@ -118,6 +123,9 @@ class Logbook extends CI_Controller { $return['callsign_qra'] = $callbook['gridsquare']; $return['callsign_qth'] = $callbook['city']; $return['callsign_iota'] = $callbook['iota']; + if ($return['callsign_qra'] != "") { + $return['latlng'] = $this->qralatlng($return['callsign_qra']); + } $return['workedBefore'] = $this->worked_grid_before($return['callsign_qra']); } $return['bearing'] = $this->bearing($return['callsign_qra']); @@ -343,6 +351,15 @@ class Logbook extends CI_Controller { print json_encode($ans); } + function dxcheck($call = "", $date = "") { + $this->load->model("logbook_model"); + if ($date == ''){ + $date = date("Y-m-d"); + } + $ans = $this->logbook_model->dxcc_lookup($call, $date); + return $ans; + } + /* return station bearing */ function searchbearing($locator) { @@ -385,4 +402,16 @@ class Logbook extends CI_Controller { } return ""; } + + function qralatlng($qra) { + $this->load->library('Qra'); + $latlng = $this->qra->qra2latlong($qra); + return $latlng; + } + + function qralatlngjson($qra) { + $this->load->library('Qra'); + $latlng = $this->qra->qra2latlong($qra); + print json_encode($latlng); + } } diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 6f4517ec..115b92b4 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1087,6 +1087,34 @@ class Logbook_model extends CI_Model { return array("Not Found", "Not Found"); } + public function dxcc_lookup($call, $date){ + $len = strlen($call); + + // query the table, removing a character from the right until a match + for ($i = $len; $i > 0; $i--){ + //printf("searching for %s\n", substr($call, 0, $i)); + $dxcc_result = $this->db->select('*') + ->where('call', substr($call, 0, $i)) + ->where('(start <= ', $date) + ->or_where("start = '0000-00-00'", NULL, false) + ->or_where("start is null)", NULL, false) + ->where('(end >= ', $date) + ->or_where("end = '0000-00-00'", NULL, false) + ->or_where("end is null)", NULL, false) + ->get('dxcc_prefixes'); + + //$dxcc_result = $this->db->query("select `call`, `entity`, `adif` from dxcc_prefixes where `call` = '".substr($call, 0, $i) ."'"); + //print $this->db->last_query(); + + if ($dxcc_result->num_rows() > 0){ + $row = $dxcc_result->row_array(); + return $row; + } + } + + return array("Not Found", "Not Found"); + } + /* * Same as check_dxcc_table, but the functionality is in * a stored procedure which we call diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 4203d49c..e2035943 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -110,12 +110,26 @@ $(document).ready(function(){ uri->segment(1) == "qso") { ?> + + + +