From 95e5007d8f61b753fc7a6e5a3e7c98c5f64e25e9 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 14 Feb 2024 13:19:37 +0100 Subject: [PATCH] Migrate to hams.at native API --- application/controllers/Components.php | 2 +- application/views/components/hamsat/table.php | 50 +++++++++---------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/application/controllers/Components.php b/application/controllers/Components.php index 7fc0e27a..94fdd0f9 100644 --- a/application/controllers/Components.php +++ b/application/controllers/Components.php @@ -15,7 +15,7 @@ class Components extends CI_Controller { public function index() { $this->load->model('stations'); - $url = 'https://oscarwatch.org/scripts/hamsat_json.php'; + $url = 'https://hams.at/api/alerts/upcoming'; $json = file_get_contents($url); $data['rovedata'] = json_decode($json, true); $data['gridsquare'] = strtoupper($this->stations->find_gridsquare()); diff --git a/application/views/components/hamsat/table.php b/application/views/components/hamsat/table.php index 80dad90b..bc2b7714 100644 --- a/application/views/components/hamsat/table.php +++ b/application/views/components/hamsat/table.php @@ -21,7 +21,7 @@ - + - - + load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); $CI->load->model('logbook_model'); $call_worked = $CI->logbook_model->check_if_callsign_worked_in_logbook($rove['callsign'], $logbooks_locations_array, "SAT"); if ($call_worked != 0) { @@ -60,48 +60,46 @@ - + + "> logbook_model->check_if_grid_worked_in_logbook($grid, null, "SAT"); - if ($worked != 0) { - echo " " . $grid . ""; - } else { - echo " " . $grid . ""; - } - } - } else { - $worked = $CI->logbook_model->check_if_grid_worked_in_logbook($rove['gridsquare'], null, "SAT"); + foreach ($rove['grids'] as $grid) { + $worked = $CI->logbook_model->check_if_grid_worked_in_logbook($grid, null, "SAT"); if ($worked != 0) { - echo " " . $rove['gridsquare'] . ""; + echo " " . $grid . ""; } else { - echo " " . $rove['gridsquare'] . ""; + echo " " . $grid . ""; } } ?> - Track + Track - Sked + Sked