From 06297e76e5f76c1ddf8f009ae7db29c5bf75e2f8 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Fri, 16 Aug 2019 12:11:46 +0100 Subject: [PATCH] Moved Clublog lookup function to Clublog controller --- application/controllers/Clublog.php | 12 ++++++++++++ application/controllers/Logbook.php | 2 ++ 2 files changed, 14 insertions(+) diff --git a/application/controllers/Clublog.php b/application/controllers/Clublog.php index e3af51ec..b390107b 100644 --- a/application/controllers/Clublog.php +++ b/application/controllers/Clublog.php @@ -111,6 +111,18 @@ class Clublog extends CI_Controller { $this->load->model('clublog_model'); $this->clublog_model->mark_all_qsos_notsent(); } + + // Find DXCC + function find_dxcc($callsign) { + // Live lookup against Clublogs API + $url = "https://secure.clublog.org/dxcc?call=".$callsign."&api=a11c3235cd74b88212ce726857056939d52372bd&full=1"; + + $json = file_get_contents($url); + $data = json_decode($json, TRUE); + + // echo ucfirst(strtolower($data['Name'])); + return $data; + } } \ No newline at end of file diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index d0071e10..661ceb2b 100755 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -165,6 +165,8 @@ class Logbook extends CI_Controller { * Function: jsonlookupgrid * * Usage: Used to look up gridsquares when creating a QSO to check whether its needed or not + * the $type variable is only used for satellites, set this to SAT. + * */ function jsonlookupgrid($gridsquare, $type, $band, $mode) { $return = [